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

ENG-3857 fix(portal): use bigint in max math #819

Conversation

Vitalsine85
Copy link
Member

@Vitalsine85 Vitalsine85 commented Aug 31, 2024

Affected Packages

Apps

  • portal

Packages

  • 1ui
  • api
  • protocol
  • sdk

Tools

  • tools

Overview

Updates max calculation to do the math with BigInts and not decimals to further reduce the chance of rounding errors.

Screen Captures

If applicable, add screenshots or screen captures of your changes.

Declaration

  • I hereby declare that I have abided by the rules and regulations as outlined in the CONTRIBUTING.md

PR Summary by Typo

Summary

This pull request refactors StakeActions component in stake-actions.tsx, introducing a custom formatDecimal function and updating maxEth calculation with BigInt and formatUnits.

Key Points

  1. Replaces toLocaleString with formatDecimal.
  2. Calculates maxEth using BigInt and formatUnits.
To turn off PR summary, please visit Notification settings.

Copy link

linear bot commented Aug 31, 2024

ENG-3857 [URGENT p0] Can not redeem from identities nor triples

"insufficient funds" when hitting "max" withdraw on a triple deposit or atom deposit.

Screenshot 2024-08-31 at 9.26.03 AM.png

@Vitalsine85 Vitalsine85 enabled auto-merge (squash) August 31, 2024 14:38
@Vitalsine85 Vitalsine85 changed the title Vital/eng 3857 urgent p0 can not redeem from identities nor triples ENG-3857 fix(portal): use bigint in max math Aug 31, 2024
@github-actions github-actions bot added the fix Fix label Aug 31, 2024
@Vitalsine85 Vitalsine85 merged commit abc6973 into main Aug 31, 2024
3 checks passed
@Vitalsine85 Vitalsine85 deleted the vital/eng-3857-urgent-p0-can-not-redeem-from-identities-nor-triples branch August 31, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants