-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(cast): add tx command #260
Conversation
This commit ports the `seth tx` command to `cast`. It follows the implementation of `cast block` and includes the feature to print a specific field in the transaction as well as printing the result in JSON. ``` $ cast tx --rpc-url <url> <tx-hash> [field] ``` The flag `-j`/`--json` is used to print the result as JSON.
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.
lgtm
.get(field) | ||
.cloned() |
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.
there should be Value::take(field)
which removes the value, so we could get rid of the clone here
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.
eh in this case i guess the clone is not that expensive, one-time call expected anyway
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.
LGTM - lints unrelated to the pr
.get(field) | ||
.cloned() |
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.
eh in this case i guess the clone is not that expensive, one-time call expected anyway
This commit ports the
seth tx
command tocast
.It follows the implementation of
cast block
and includesthe feature to print a specific field in the transaction
as well as printing the result in JSON.
The flag
-j
/--json
is used to print the resultas JSON.
A whitespace is in a docstring is removed (autoformatted on save) and
the
cast
README
is updated to indicate that thetx
command wasimplemented. Also check off the
code
command as it was previouslyimplemented.
Open to any stylistic feedback as I'm gaining experience writing Rust :)
The added doctest passes when I run it locally.