-
-
Notifications
You must be signed in to change notification settings - Fork 740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add State overrides to eth_call #1759
Conversation
🦋 Changeset detectedLatest commit: 99ce411 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@maxencerb is attempting to deploy a commit to the wevm Team on Vercel. A member of the Team first needs to authorize it. |
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.
Seems chill. Just a couple of comments!
I made some changes, added tests for Also added API docs on |
00111e9
to
ba8a9cb
Compare
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 added coverage to these lines on |
What
The goal of this PR is to add state overrides to call and
eth_call
EIP1193 types. These overrides are helpful in many cases. It modifies the state of selected accounts before the transaction. It is a default feature in geth. It allows to modify:Why
I only added the rpc schema and changed the "low-level" call function. But the first case scenario that comes in mind is the approve and swap transaction simulation.
If you know the mapping key for the allowances, you could change the allowance to the max allowance before a
simulateContract
call. This would allow a cheap onchain simulation of the rates you could get.PR-Codex overview
Focus of this PR:
This PR focuses on adding the
stateOverride
property to various functions (call
,simulateContract
,readContract
, andmulticall
) and introducing related types and error classes.Detailed summary:
stateOverride
property tocall
,simulateContract
,readContract
, andmulticall
functions.StateOverride
type defining state overrides foreth_call
method.InvalidBytesLengthErrorType
andInvalidBytesLengthError
classes.RpcStateOverride
andRpcStateMapping
types.StateMapping
andStateOverride
types.AccountStateConflictErrorType
,AccountStateConflictError
,StateAssignmentConflictErrorType
, andStateAssignmentConflictError
classes.