-
Notifications
You must be signed in to change notification settings - Fork 127
Fix: Display scaled MPToken balance #1260
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
Conversation
| // MPT balance must be scaled by the appropriate asset_scale exponent. | ||
| // Please refer to this documentation for more details: | ||
| // https://xrpl.org/docs/references/protocol/transactions/types/mptokenissuancecreate#mptokenissuancecreate-fields | ||
| balance: mpToken.mptAmount * 10 ** -(mptIssuance?.assetScale ?? 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- We need to apply this to all MPT amounts. The outstandingAmt field is used in IssuedMPTs.tsx#L62.
- Can we reuse convertScaledPrice to avoid duplicating the scaling logic and related comments in multiple places?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. These concerns have been addressed in this commit: d8471d7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Can you remove the unnecessary comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. 3cab005
…e Account Page refactor: use the convertScaledPrice method to scale the MPT balance values
| // MPT balance must be scaled by the appropriate asset_scale exponent. | ||
| // Please refer to this documentation for more details: | ||
| // https://xrpl.org/docs/references/protocol/transactions/types/mptokenissuancecreate#mptokenissuancecreate-fields | ||
| // balance: mpToken.mptAmount * 10 ** -(mptIssuance?.assetScale ?? 0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove these comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
High Level Overview of Change
The MPToken balances are not scaled appropriately. This commit fixes this issue in the
HeldMPTssection of an AccountPage. Furthermore, some of the legacy jest test matchers have been updated to pass the CI requirements.Type of Change
Codebase Modernization
Test Plan
Existing test has been updated to validate the scaled asset price scenario.