-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 options for state changes output and json output in cast run command #9013
base: master
Are you sure you want to change the base?
Add options for state changes output and json output in cast run command #9013
Conversation
…output-storage-change-and-json-output-for-cast-run
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.
Thanks for your PR, generally in favor of adding this
/// Prints the state changes, only works with the `json` flag. | ||
#[arg(long)] | ||
with_state_changes: bool, |
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.
--json
should just toggle the output mode
If desired it should also be added to https://github.com/paradigmxyz/revm-inspectors so the regular output mode has optional support for it as well
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.
Totally agree. I'm happy to submit a separate PR to the revm-inspectors
repo to add support for this.
…output-storage-change-and-json-output-for-cast-run
Motivation
The current human-readable output from
cast run
is great for manual interpretation but requires additional parsing to be used programmatically. Additionally, there is a need to inspect storage changes for each call, but currently, these changes are not recorded.Solution
This PR introduces a
-j
option forcast run
to output traces in JSON format, making it easier to consume programmatically. It also adds a--with-state-changes
option that outputs storage changes.Example usage: