Skip to content

p-token: Add ui amount precision tests - #98

Merged
febo merged 5 commits into
mainfrom
febo/precision-test
Oct 4, 2025
Merged

febo merged 5 commits into
mainfrom
febo/precision-test

Conversation

@febo

@febo febo commented Oct 2, 2025 •

Copy link
Copy Markdown
Contributor

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

@joncinque joncinque left a comment

Copy link
Copy Markdown
Contributor

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

febo commented Oct 3, 2025

Copy link
Copy Markdown
Contributor Author

@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.

2 participants