-
Notifications
You must be signed in to change notification settings - Fork 241
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(network): Add input
method to TransactionResponse
#959
Conversation
input
method to TransactionResponse
input
method to TransactionResponse
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, this is indeed useful
crates/network/src/ethereum/mod.rs
Outdated
@@ -62,4 +63,8 @@ impl TransactionResponse for alloy_rpc_types_eth::Transaction { | |||
fn gas(&self) -> u128 { | |||
self.gas | |||
} | |||
|
|||
fn input(&self) -> Bytes { |
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.
wdyt @DaniPopes Bytes or &[u8] ?
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.
&Bytes would be the best choice 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.
I guess we can reasonably assume that every tx always has an input, so that makes sense
Motivation
It would be nice to have a method to get input data from
TransactionResponse
.During my development, there was a situation in which I wanted to know what method was being called and with what arguments from
TransactionResponse
.Solution
Adds
input
method toTransactionResponse
and implements it toTransactionResponse
type for eachNetwork
PR Checklist