-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Simulated Backend Client (#10403)
* Update Simulated Backend Client This commit aims to improve the simulated backend client by removing the block limit where only the latest block can be provided to `CallContext` and handling input args more gracefully. - `CallContext` will now only validate the block number passed in args - `CallContext` will NOT restrict calls to current block, but will pass nil to backend - `from` in call args is no longer required and will default to `0x` - `from` and `to` accept `common.Address`, `*big.Int` and `string` types Included is a move to Go standard error handling consistent with v1.20+ and error wrapping. * remove commented code * add comments at top of file and panic on unrecognized value type * updated error handling and comments * address comments
- Loading branch information
1 parent
55be162
commit 3dfb527
Showing
2 changed files
with
102 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* | ||
The simulated backend cannot access old blocks and will return an error if | ||
anything other than `latest`, `nil`, or the latest block are passed to | ||
`CallContract`. | ||
The simulated client avoids the old block error from the simulated backend by | ||
passing `nil` to `CallContract` when calling `CallContext` or `BatchCallContext` | ||
and will not return an error when an old block is used. | ||
*/ | ||
package client |
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