Skip to content

Conversation

@febo
Copy link
Contributor

@febo febo commented Oct 2, 2025

Problem

In practice, mints can have up to u8::MAX precision. Both AmountToUiAmount and UiAmountToAmount use the decimal value as precision to convert an amount to/from a string representation.

Solution

This PR adds tests to specifically check the behaviour when the maximum precision value is used.

Note that this PR depends on anza-xyz/pinocchio#252.

@febo febo requested a review from joncinque October 2, 2025 16:02
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I'll approve once the git deps are removed

@febo febo marked this pull request as ready for review October 3, 2025 17:14
@febo febo requested a review from joncinque October 3, 2025 17:32
@febo
Copy link
Contributor Author

febo commented Oct 3, 2025

@joncinque Added the published crate.

@febo febo merged commit 369b081 into main Oct 4, 2025
17 checks passed
@febo febo deleted the febo/precision-test branch October 4, 2025 00:19
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.

3 participants