Crate zcash_script

Source
Expand description

Zcash transparent script implementations.

Re-exports§

pub use interpreter::CallbackTransactionSignatureChecker;
pub use interpreter::DefaultStepEvaluator;
pub use interpreter::HashType;
pub use interpreter::SighashCalculator;
pub use interpreter::SignedOutputs;
pub use interpreter::VerificationFlags;

Modules§

cxx
Rust bindings for Zcash transparent scripts.
interpreter
script_error

Structs§

ComparisonInterpreter
A tag to indicate that both the C++ and Rust implementations of zcash_script should be used, with their results compared.
ComparisonStepEvaluator
This compares two ZcashScript implementations in a deep way – checking the entire State step by step. Note that this has some tradeoffs: one is performance. Another is that it doesn’t run the entire codepath of either implementation. The setup/wrapup code is specific to this definition, but any differences there should be caught very easily by other testing mechanisms (like check_verify_callback).
CxxInterpreter
StepResults
A payload for comparing the results of two steppers.
StepwiseInterpreter

Enums§

Error
This maps to zcash_script_error_t, but most of those cases aren’t used any more. This only replicates the still-used cases, and then an Unknown bucket for anything else that might happen.

Traits§

ZcashScript
The external API of zcash_script. This is defined to make it possible to compare the C++ and Rust implementations.

Functions§

check_verify_callback
Runs two implementations of ZcashScript::verify_callback with the same arguments and returns both results. This is more useful for testing than the impl that logs a warning if the results differ and always returns the T result.
cxx_rust_comparison_interpreter
normalize_error
Convert errors that don’t exist in the C++ code into the cases that do.
rust_interpreter
stepwise_verify