* Move some constants in preparation This makes some minor changes to constants to facilitate splitting out a stepwise interpreter. * Extract a step function from the interpreter This is generally useful for testing, but specifically, we want to be able to run this side-by-side with the C++ interpreter, and check that every bit of our state matches along the way. This change is as minimal as possible, to avoid divergence until after it can be compared against C++. E.g., the massive `match opcode {…}` block that has been moved should only change the dereferencing of `op_count`. * Add a `State` struct to make stepping easier * Expose step interpreter * Add a stepwise comparison interpreter The C++ changes aren’t in place yet, so this is currently just an A/A test. This changes our closures into structs containing a function, because that’s how we can pass around functions with universally-quantified lifetimes. * Make interpreters more flexible Previously the `ZcashScript` impls didn’t use `self`, so the types were just tags. However, with the new `StepwiseInterpreter`, they need `self`. This also removes `RustInterpreter` in favor of a `rust_interpreter` function that instantiates an appropriate `StepwiseInterpreter`. * Add a function for C++/Rust comparison interpreter * Fix fuzzer * Clean up `use` in lib.rs * Fix weird indentation * Make various fields non-`pub` * Add a `new` constructor for `Stack` * Remove incorrect comment * Appease Clippy Adds `Default` impls for `Stack` and `State`. * Rename `State::manual` to `State::from_parts` |
||
---|---|---|
.. | ||
fuzz_targets | ||
.gitignore | ||
Cargo.toml |