Skip to content

feat(cast): Add state overrides flags to cast call #10255

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

Merged
merged 25 commits into from
Apr 23, 2025

Conversation

tushar994
Copy link
Contributor

Motivation

Fixes #10189

I need help with figuring out how to test this functionality.

Solution

adds the relevant override flags

  • --override-balance "0xAAAA:1234,0xBBBB:5678"
  • --override-nonce "0xAAAA:5,0xBBBB:10"
  • --override-code "0xAAAA:0xCODEBYTES"
  • --override-state "0xAAAA:0xSLOT:1234,0xBBBB:0xSLOT:5678"
  • --override-state-diff "0xAAAA:0xSLOT:1234,0xBBBB:0xSLOT:5678"

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@tushar994 tushar994 changed the title WIP: Add state overrides flags to cast call Add state overrides flags to cast call Apr 6, 2025
@tushar994
Copy link
Contributor Author

@grandizzy could you please review this PR? cargo fmt --all --check fails right now, But it makes a bunch of changes in unrelated files. that would make it harder to review this PR. once the PR looks good, I can run cargo fmt --all and push the changes.

@grandizzy
Copy link
Collaborator

cargo fmt --all

hey @tushar994 , thanks for PR, will check asap. For checking fmt you should use the nightly as in cargo +nightly fmt --all --check see https://github.com/foundry-rs/foundry/blob/master/CONTRIBUTING.md#resolving-an-issue for ref

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly style nits

@jenpaff jenpaff moved this to Ready For Review in Foundry Apr 15, 2025
Copy link
Collaborator

@grandizzy grandizzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you, left some more comments.

@grandizzy
Copy link
Collaborator

grandizzy commented Apr 17, 2025

thanks @tushar994 I fixed clippy and fmt and made some nits to simplify code a little like using StateOverridesBuilder, please check ad63dbc

@grandizzy grandizzy requested review from mattsse and grandizzy April 17, 2025 09:43
@grandizzy
Copy link
Collaborator

lgtm, waiting for other reviews from team as I've been adding code to it. thanks!

@grandizzy grandizzy added T-feature Type: feature C-cast Command: cast labels Apr 17, 2025
mattsse
mattsse previously approved these changes Apr 22, 2025
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks okay, we can't really make this simpler because these are just a lot of settings

@grandizzy grandizzy enabled auto-merge (squash) April 23, 2025 10:14
@grandizzy grandizzy requested a review from zerosnacks April 23, 2025 10:14
@grandizzy grandizzy changed the title Add state overrides flags to cast call feat(cast): Add state overrides flags to cast call Apr 23, 2025
@grandizzy grandizzy merged commit 55802ba into foundry-rs:master Apr 23, 2025
22 checks passed
@github-project-automation github-project-automation bot moved this from Ready For Review to Done in Foundry Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cast Command: cast T-feature Type: feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add state overrides flags to cast call
4 participants