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

fix: legacy transaction address recovery #2195

Merged
merged 5 commits into from Apr 28, 2024
Merged

fix: legacy transaction address recovery #2195

merged 5 commits into from Apr 28, 2024

Conversation

jxom
Copy link
Member

@jxom jxom commented Apr 28, 2024

Resolves #2191.

Added support for legacy transaction address recovery + support legacy signature format in signatureToHex.


PR-Codex overview

This PR fixes legacy transaction address recovery by updating the yParity value in various transaction-related files.

Detailed summary

  • Added yParity value calculation based on v in parseTransaction.ts
  • Updated yParity values in serializeTransaction.test.ts and parseTransaction.test.ts
  • Modified yParity handling in signatureToHex.ts and related tests

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

changeset-bot bot commented Apr 28, 2024

🦋 Changeset detected

Latest commit: 62f140c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Apr 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
viem ✅ Ready (Inspect) Visit Preview Apr 28, 2024 3:40am

Copy link

codecov bot commented Apr 28, 2024

Codecov Report

Attention: Patch coverage is 92.85714% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 99.72%. Comparing base (5fe7494) to head (62f140c).
Report is 2 commits behind head on main.

Files Patch % Lines
src/utils/signature/signatureToHex.ts 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2195      +/-   ##
==========================================
+ Coverage   97.69%   99.72%   +2.03%     
==========================================
  Files         623      629       +6     
  Lines       55446    56198     +752     
  Branches     2445     2681     +236     
==========================================
+ Hits        54166    56046    +1880     
+ Misses       1260      139    -1121     
+ Partials       20       13       -7     

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

Copy link
Contributor

github-actions bot commented Apr 28, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
viem (esm) 56.22 KB (+0.17% 🔺) 1.2 s (+0.17% 🔺) 1.9 s (+65.45% 🔺) 3.1 s
viem (cjs) 67.55 KB (+0.05% 🔺) 1.4 s (+0.05% 🔺) 3.3 s (+102.07% 🔺) 4.6 s
viem (minimal surface - tree-shaking) 3.31 KB (0%) 67 ms (0%) 75 ms (+221.35% 🔺) 141 ms
viem/accounts 74.02 KB (+0.33% 🔺) 1.5 s (+0.33% 🔺) 1.8 s (+77.83% 🔺) 3.3 s
viem/accounts (tree-shaking) 19.12 KB (+0.13% 🔺) 383 ms (+0.13% 🔺) 489 ms (+316.77% 🔺) 871 ms
viem/actions 41.62 KB (0%) 833 ms (0%) 794 ms (+11.53% 🔺) 1.7 s
viem/actions (tree-shaking) 303 B (0%) 10 ms (0%) 12 ms (+83.23% 🔺) 22 ms
viem/chains 27.04 KB (0%) 541 ms (0%) 894 ms (-16.94% 🔽) 1.5 s
viem/chains (tree-shaking) 324 B (0%) 10 ms (0%) 9 ms (-43.41% 🔽) 19 ms
viem/chains/utils 1.02 KB (0%) 21 ms (0%) 12 ms (-60.49% 🔽) 33 ms
viem/ens 41.62 KB (0%) 833 ms (0%) 773 ms (-28.22% 🔽) 1.7 s
viem/ens (tree-shaking) 18.33 KB (0%) 367 ms (0%) 472 ms (-22.03% 🔽) 839 ms

@jxom jxom merged commit 79ec577 into main Apr 28, 2024
28 of 29 checks passed
@jxom jxom deleted the jxom/2191 branch April 28, 2024 04:01
@github-actions github-actions bot mentioned this pull request Apr 28, 2024
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.

bug: recoverTransactionAddress doesn't fully support legacy transactions
1 participant