This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 683
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow balance, code, nonce, and state overrides in
eth_call
(#…
…2565) * feat: Allow contract code and balance overrides Support overriding the contract code, account balances and nonces for simulations with eth_call. This is an extension also supported by geth. * reorg eth_call override type. add state/stateDiff * support state/stateDiff in eth_call override * fix eth_call code override. reorg a bit * add override structure to eth_call jsdocs * add override to eth_call example in jsdoc * prevent use of state & stateDiff on override * remove unused import on test * add encodeValue/deployContract helpers * reorg previous test to make room for new * add tests for eth_call override * rename eth_call override type * change keccak import to be from @ganache/utils * await async function * change `Object.entries` to more perfomant `for ... in` * rename confusing key name * change `Object.entries` to more performang `for ... in` * move comment * data validation for state/Diff override * add junk data test for eth_call overrides * remove unused file * correctly throw on both state && stateDiff * fix broken test * remove unused throw * change return to continue like a smart person * make state/stateDiff looping more efficient * fix test name * abstract override generation in test * fix override balance test expected value * fix override code test * fix override state/stateDiff test data * fix override stateDiff expected values * fix override state expected values * add todo comment * add bad slot values for state/Diff test * add junk value test for nonce * add data validation method for state/Diff override * validate data for state/Diff override * fix some default data to match geth * Move eth_call overrides setting to helper file * Apply suggestions from code review Co-authored-by: David Murdoch <[email protected]> * extract types to run-call helper * check length directly rather than removing prefix * use copied trie for eth_call * fix copy/paste error * fix copy/paste error * beef up test a bit * remove unused libraries * add tests to confirm eth_call changes are ephemeral * set multiple slots in test * make tests more scrict Co-authored-by: Jacob Evans <[email protected]> Co-authored-by: MicaiahReid <[email protected]> Co-authored-by: David Murdoch <[email protected]>
- Loading branch information
1 parent
81219d7
commit 037e156
Showing
5 changed files
with
1,168 additions
and
169 deletions.
There are no files selected for viewing
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.