This repository was archived by the owner on Jul 5, 2024. It is now read-only.
Modularize mock crate for easier and more customizable testing setup generation#349
Merged
Conversation
7de0c87 to
00a14ef
Compare
cc29ebc to
da5a4ac
Compare
Contributor
Author
|
This will remain untouched until #312 gets merged so that no duplicated work/conflicts increase. |
This was referenced Mar 14, 2022
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
Contributor
Author
|
@ed255 it's ready for the final review! :) |
han0110
reviewed
Mar 28, 2022
Contributor
han0110
left a comment
There was a problem hiding this comment.
LGTM! The builder pattern makes everything easier to understand! Only got some nitpicks.
ed255
reviewed
Mar 29, 2022
Contributor
ed255
left a comment
There was a problem hiding this comment.
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.
4c5b1e5 to
7f47aeb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-genericsand we need to specify:NACC(Number of accounts) andNTX(Number of transactions).TODO:
EXTCODEHASHtestcases that are not passing. https://github.com/appliedzkp/zkevm-circuits/blob/5d8166ddfa5060b7c3d515ae2a74bd8cb7024bc7/bus-mapping/src/evm/opcodes/extcodehash.rs#L145-L154Resolves: #348