forked from scroll-tech/zkevm-circuits
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modularize mock crate for easier and more customizable testing setup …
…generation (scroll-tech#349) * mock: Add ethbloom to deps * mock: Add MockBlock and builder methods * mock: Add MockTransaction and builder methods * mock: Add MockAccount and builder methods * mock: Add build functions for mock structs * mock: Remove BlockData from bus-mapping * mock: Update TestContext builder sig params * eth-types: Change `GethExecTrace` visibility to `pub` * mock: Add const generics for ACC specification in TestContext * Update default values for MockBlock * mock: Accept multiple Tx's in TraceContext builder pattern * mock: Update tests to generate Traces using TraceContext * mock: Remove unused code in mock and refactor EndTx/BeginTx * mock: Fix and comment BeginTx strange testscases * mock: Fix rebase conflicts * bus-mapping: Fix lib.rs docs * mock: Change FACC trait to avoid returning &mut MockBlock * mock: Add helpers for TextContext simple constructions Adds helper functions to make the builder pattern less verbose when there's a simple and frequent rutine being used. Co-authored-by: ed255 <[email protected]> * mock: Change from Bytecode to Bytes in MockAccount 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. * mock: Fix EXTCODEHASH errors introduced in the refactor * mock: Add documentation & usage examples for TestContext * bus-mapping: Shorten bolerprate with TestContext helpers * fix docs * Fix documentation for bus-mapping * Fix ETH test value to point_one for BeginTx * Fix according to review suggestions from @ed255 and @han0110 * eth_types: Add docs for GethExecTrace * mock: Update MockTransaction `to` field to be Option * bus-mapping: Fix CircuitInputBuilder rebased tests * mock: Make all MOCK statics pub * zkevm_circuits: Update end_tx testcase with correct idx and nonce * Update TestContext to use consecutive TxId & nonce as default 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. * zkevm-circuits: Fix reduce random gas_price range Co-authored-by: ed255 <[email protected]>
- Loading branch information
Showing
31 changed files
with
1,934 additions
and
566 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.