test: add currency-precision helper boundary tests (#2092) - #2379
Merged
Baskarayelu merged 1 commit intoJul 28, 2026
Merged
Conversation
Add a dedicated test module that locks in three behaviour buckets for `payments::require_matching_currency_precision`: - **Matching** (must succeed): token contract reports decimals=0, decimals=18 (boundary inclusive), and the SAC default decimals=7. - **Over-precision** (must be rejected with InvalidCurrency): decimals=19 (just-over), decimals=20, and decimals=u32::MAX (saturation). - **Malformed** (must be rejected with InvalidCurrency): unregistered address with no contract behind it, plus a wrong-return-type case that is gated behind a `#[ignore]` because Soroban 25.x aborts cross-contract type-mismatch calls at the host level (TODO note explains how to re-enable once the SDK stops doing that). Two cross-cutting tests confirm that the `InvalidAmount` vs `InvalidCurrency` error buckets are never confused with each other, and that over-precision rejection is amount-independent (both `1` and `i128::MAX` are rejected). The new module uses plain `#[cfg(test)]` with no feature gate so it runs on every CI matrix entry, satisfying the issue's acceptance criteria. Closes QuickLendX#2092
|
@YazarAyobami Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
#Closes #2092
Add a dedicated test module that locks in three behaviour buckets for
payments::require_matching_currency_precision:#[ignore]because Soroban 25.x aborts cross-contract type-mismatch calls at the host level (TODO note explains how to re-enable once the SDK stops doing that).Two cross-cutting tests confirm that the
InvalidAmountvsInvalidCurrencyerror buckets are never confused with each other, and that over-precision rejection is amount-independent (both1andi128::MAXare rejected).The new module uses plain
#[cfg(test)]with no feature gate so it runs on every CI matrix entry, satisfying the issue's acceptance criteria.Closes #2092