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: Precision of BigNumber values of calcTokenAmount and Configure BigNumber to support 36 decimals #13029

Merged
merged 5 commits into from
Jan 16, 2025

Conversation

digiwand
Copy link
Contributor

@digiwand digiwand commented Jan 16, 2025

Description

Fix precision across mobile transaction values. JavaScript Number coerces values into scientific notation which looses precision when rendering full values

Update BigNumber.config to support 36 decimals similarly to MetaMask/metamask-extension#21147

Related issues

Fixes: #12991
Relates to: #12994

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@digiwand digiwand requested a review from a team as a code owner January 16, 2025 12:00
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Jan 16, 2025
@digiwand digiwand changed the title fix: value precision for simulation and other cases using calcTokenAm… fix: Precision of BigNumber values shown in transaction and signature pages Jan 16, 2025
@digiwand digiwand added the Run Smoke E2E Triggers smoke e2e on Bitrise label Jan 16, 2025
Copy link
Contributor

github-actions bot commented Jan 16, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 0d3e517
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/99f09ba7-e2c6-4bb4-b63d-d64a57579c9b

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

matthewwalsh0
matthewwalsh0 previously approved these changes Jan 16, 2025
vinistevam
vinistevam previously approved these changes Jan 16, 2025
@digiwand digiwand dismissed stale reviews from vinistevam and matthewwalsh0 via bedc33c January 16, 2025 16:31
@digiwand
Copy link
Contributor Author

@matthewwalsh0 @vinistevam

Thanks for the reviews! Thanks for the reminder about creating tests @matthewwalsh0! Created a test and found we had an issue supporting the test case supporting 36 decimals. Updated BigNumber configuration to support 36 decimals as we did in the extension here: MetaMask/metamask-extension#21147

@digiwand digiwand changed the title fix: Precision of BigNumber values shown in transaction and signature pages fix: Precision of BigNumber values of calcTokenAmount and Configure BigNumber to support 36 decimals Jan 16, 2025
@digiwand digiwand requested a review from a team as a code owner January 16, 2025 16:53
@digiwand digiwand enabled auto-merge January 16, 2025 17:30
@digiwand digiwand added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Jan 16, 2025
Copy link
Contributor

github-actions bot commented Jan 16, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 31b3faa
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/cfc23dc7-fd85-40f8-8428-572e4a4e8267

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@digiwand digiwand added this pull request to the merge queue Jan 16, 2025
Merged via the queue into main with commit f62e266 Jan 16, 2025
40 of 41 checks passed
@digiwand digiwand deleted the fix-value-precision branch January 16, 2025 18:13
@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2025
@metamaskbot metamaskbot added the release-7.39.0 Issue or pull request that will be included in release 7.39.0 label Jan 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.39.0 Issue or pull request that will be included in release 7.39.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[non-Prod][Bug]: Fix precision for large numbers on Mobile Redesign Signatures
4 participants