-
Notifications
You must be signed in to change notification settings - Fork 71
cli/exec: expose json tracing option #878
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
Conversation
adds a cli option to exec that outputs a geth compatible jsonl trace.
msooseth
left a comment
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 have lately been pretty bad at doing PRs, so I think you need @blishko to review. But I am actually liking it a lot. It is BTW possible to add tests to CLI stuff like this, via clitest.hs, it's something to consider, though it may be a little convoluted with this one.
| $ export ETH_RPC_URL=https://mainnet.infura.io/v3/YOUR_API_KEY_HERE | ||
| $ export TXHASH=0xd2235b9554e51e8ff5b3de62039d5ab6e591164b593d892e42b2ffe0e3e4e426 | ||
| hevm exec --caller $(seth tx $TXHASH from) --address $(seth tx $TXHASH to) \ | ||
| --calldata $(seth tx $TXHASH input) --rpc $ETH_RPC_URL \ | ||
| --block $(($(seth tx $TXHASH blockNumber)-1)) --gas $(seth tx $TXHASH gas) | ||
| hevm exec --caller $(cast tx $TXHASH from) --address $(cast tx $TXHASH to) \ | ||
| --calldata $(cast tx $TXHASH input) --rpc $ETH_RPC_URL \ | ||
| --block $(($(cast tx $TXHASH blockNumber)-1)) --gas $(cast tx $TXHASH gas) |
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.
Oh this is nice!
| { pc :: Int | ||
| , op :: Int | ||
| , gas :: Data.Word.Word64 | ||
| , memSize :: Data.Word.Word64 | ||
| , depth :: Int | ||
| , stack :: [W256] | ||
| , error :: Maybe String |
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.
Thank you, yes :) I think at the time we didn't have the . notation? So it was more useful. Much better this way!
blishko
left a comment
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.
Looks good to me!
Description
adds a cli option to exec that outputs a geth compatible jsonl trace.
Checklist