-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: Add tx_type() and encoded_length() on PoolTransaction trait #1500
feat: Add tx_type() and encoded_length() on PoolTransaction trait #1500
Conversation
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
/// Returns the length of the rlp encoded object | ||
fn encoded_length(&self) -> usize { | ||
self.transaction.length() | ||
} |
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.
this is sufficient for now,
perhaps we should think about adding this value to the ValidatedTransaction
instead so we don't have to do this all the time when we send this transaction over p2p
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.
Yeah, I was just writing a comment about this, I wasn't able to access a ValidPoolTransaction
while impl encoded_length()
on PooledTransaction
, so it must be something I don't understand.
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 think I get it. I'll wait this get merged and will do another PR.
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.
Yeah let's use the same pattern as in Transaction ECRECOVER where we don't want to recalculate the signer all the time because it's expensive so we put it in TransactionEcRecovered
or whatever.
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #1500 +/- ##
==========================================
+ Coverage 76.00% 76.11% +0.11%
==========================================
Files 358 358
Lines 42660 42723 +63
==========================================
+ Hits 32423 32519 +96
+ Misses 10237 10204 -33
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Closes #1485