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 buggy calculation of transferable amount for security deposit #632

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ebma
Copy link
Member

@ebma ebma commented Jan 9, 2025

The problem occurs only for accounts with a large balance of PEN tokens. The useAccountBalance hook returned the values with pretty formatting. This means that large amounts were depicted with commas, e.g. 10,000.00. The consumer of this balance could wrongly interpret the number as 10 PEN (if the comma is expected to denote the decimals) which is exactly what happened when transforming the transferable balance for calculating the security deposit.

This PR changes the return type of useAccountBalance to return numbers instead.

@ebma ebma linked an issue Jan 9, 2025 that may be closed by this pull request
@ebma ebma requested a review from a team January 9, 2025 18:40
Copy link

netlify bot commented Jan 9, 2025

Deploy Preview for rococo-souffle-a625f5 ready!

Name Link
🔨 Latest commit 89ff864
🔍 Latest deploy log https://app.netlify.com/sites/rococo-souffle-a625f5/deploys/678018299333920008da8ac4
😎 Deploy Preview https://deploy-preview-632--rococo-souffle-a625f5.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@vadaynujra
Copy link

Not getting shown the error anymore, but the security deposit calculation isn't being shown anymore @ebma
image

@ebma
Copy link
Member Author

ebma commented Jan 9, 2025

Prices are only available on the production deployment due to CORS restrictions. So you can't test it on the deploy preview.

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: Fix calculation of security deposit for EURC bridging
2 participants