-
Notifications
You must be signed in to change notification settings - Fork 840
Modularize mock crate for easier and more customizable testing setup generation #349
Conversation
7de0c87
to
00a14ef
Compare
cc29ebc
to
da5a4ac
Compare
This will remain untouched until #312 gets merged so that no duplicated work/conflicts increase. |
da5a4ac
to
1968f68
Compare
e98d420
to
5d8166d
Compare
Instead of requiering `Bytecode` as the type for the code passed to MockAccount constructor, now it accepts anything that implements `Into<Bytes>` which is much more ergonomic and generic.
b30d2d3
to
806da6f
Compare
@ed255 it's ready for the final review! :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! The builder pattern makes everything easier to understand! Only got some nitpicks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've completed my review! I've left a few notes and comments, please take a look :)
By default, set the TxIndex and the Nonce values of the multiple transactions of the context correlative so that any Ok test passes by default. If the user decides to override these values, they'll then be set to whatever inputs were provided by the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Awesome work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
4c5b1e5
to
7f47aeb
Compare
Adds a Builder pattern for constructing almost any test case and context that is required.
This is an example on how to use it:
Here we can see that works with
const-generics
and we need to specify:NACC
(Number of accounts) andNTX
(Number of transactions).TODO:
EXTCODEHASH
testcases that are not passing. https://github.com/appliedzkp/zkevm-circuits/blob/5d8166ddfa5060b7c3d515ae2a74bd8cb7024bc7/bus-mapping/src/evm/opcodes/extcodehash.rs#L145-L154Resolves: #348