Skip to content
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 functions for round trip decoding of transaction payloads #64

Merged
merged 3 commits into from
May 10, 2024

Conversation

peterbroadhurst
Copy link
Contributor

We provide functions for serializing transactions in legacy-original, legacy-EIP155, and EIP-1559 flavors.

However, we don't currently provide the "recover" step - decoding the binary transaction (from eth_sendRawTransaction) according to the various applicable rules, and letting you recover the signature from it.

This PR adds that feature.

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Copy link
Contributor

@awrichar awrichar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I didn't cross-check all of the decoding steps with the EIPs, but it looks correct to my recollection - and the symmetric encode/decode unit tests seem to be good validation on that.

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
@codecov-commenter
Copy link

codecov-commenter commented May 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.67%. Comparing base (39fe567) to head (3e5403b).

Additional details and impacted files
@@             Coverage Diff             @@
##              main      #64      +/-   ##
===========================================
- Coverage   100.00%   99.67%   -0.33%     
===========================================
  Files           38       38              
  Lines         3317     3420     +103     
===========================================
+ Hits          3317     3409      +92     
- Misses           0       11      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@peterbroadhurst peterbroadhurst merged commit a85f6e1 into main May 10, 2024
2 checks passed
@peterbroadhurst peterbroadhurst deleted the tx-recover branch May 10, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants