[Refactor] bytecode `evaluate` and tests
🚀 Refactor
-
The
Instructionstruct’s enum match cases should get turned into a macro (seematch_count!) for an example there is a corner case for the indices (see theToBytes&FromBytesimpls): one needs to specify the index #, which can be done using avec![]and getting its.len()in each iteration while pushing one new random thing to thevec -
The instruction tests are a little weak and verbose, we should consider redesigning it to optimize for two things: a. ensure the output matches against the circuit outputs direct (so no need to snapshot outputs like hashes and such) b. create snapshots of outputs of increasing complexity for each instruction (using
expect_test, see the nativePoseidonimpl tests for example)