fix(sdk-coin-vet): preserve precision for large value transactions#7597
Merged
kamleshmugdiya merged 1 commit intomasterfrom Nov 22, 2025
Merged
fix(sdk-coin-vet): preserve precision for large value transactions#7597kamleshmugdiya merged 1 commit intomasterfrom
kamleshmugdiya merged 1 commit intomasterfrom
Conversation
234ef47 to
a5cd30b
Compare
Vijay-Jagannathan
approved these changes
Nov 22, 2025
Contributor
Vijay-Jagannathan
left a comment
There was a problem hiding this comment.
good catch, we should never be using Number for amount
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket: COIN-0000
This PR fixes a critical issue in VET transaction processing where large numeric values lost precision due to JavaScript's Number type limitations.
When handling transactions with values exceeding ~15-17 significant digits, the values were converted to scientific notation (e.g.,
2.332734928448876e+22instead of23327349284488761096413).The issue was in Transaction.fromDeserializedSignedTransaction() which used Number(clause.value).toString(), converting large values to scientific notation. This caused transaction output parsing to fail when comparing the expected amount with the actual amount.
The fix:
Number(clause.value).toString()withnew BigNumber(clause.value).toFixed().This change ensures accurate value representation in VET transactions, particularly important for exchanges and applications handling large value transfers.