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: parseUnits bug with 0 units #3320

Merged
merged 3 commits into from
Oct 13, 2024
Merged

fix: parseUnits bug with 0 units #3320

merged 3 commits into from
Oct 13, 2024

Conversation

Dhaiwat10
Copy link
Member

@Dhaiwat10 Dhaiwat10 commented Oct 13, 2024

Release notes

In this release, we:

  • Fixed a bug where bn.parseUnits wouldn't work as expected with units = 0

Summary

This PR fixes a bug in bn.parseUnits, as a follow-up of #3300.

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

Copy link

vercel bot commented Oct 13, 2024

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

Name Status Preview Comments Updated (UTC)
fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 13, 2024 6:26pm
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 13, 2024 6:26pm

@github-actions github-actions bot added the bug Issue is a bug label Oct 13, 2024
Copy link

codspeed-hq bot commented Oct 13, 2024

CodSpeed Performance Report

Merging #3320 will improve performances by 17.21%

Comparing dp/fix-parse-units (ee759d7) with master (85072f7)

Summary

⚡ 3 improvements
✅ 15 untouched benchmarks

Benchmarks breakdown

Benchmark master dp/fix-parse-units Change
should successfully get transaction cost estimate for a batch transfer (x10 times) 26.8 ms 24.3 ms +10.1%
should successfully get transaction cost estimate for a single contract call (x10 times) 27.7 ms 25 ms +10.74%
should successfully get transaction cost estimate for a single transfer (x10 times) 21.2 ms 18.1 ms +17.21%

Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
76.07%(+0.01%) 69.98%(-0.01%) 75.05%(+0%) 76.2%(+0.01%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/account/src/providers/transaction-request/transaction-request.ts 88.57%
(+0%)
76.71%
(-1.37%)
84%
(+0%)
88.81%
(+0%)
🔴 packages/math/src/bn.ts 88.57%
(+0.34%)
87.83%
(+0.33%)
80%
(+0%)
88.57%
(+0.34%)

@arboleya arboleya enabled auto-merge (squash) October 13, 2024 18:39
@arboleya arboleya merged commit bdfd009 into master Oct 13, 2024
24 checks passed
@arboleya arboleya deleted the dp/fix-parse-units branch October 13, 2024 18:41
Dhaiwat10 added a commit that referenced this pull request Nov 19, 2024
* fix: `parseUnits` bug with 0 units

* add more test cases

---------

Co-authored-by: Anderson Arboleya <anderson@arboleya.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bn library bugs parsing when you're using units / precision zero
4 participants