Closed ckeshava closed 2 months ago
@seelabs can you please review this PR? I'm not able to add reviewers through the Github UI
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 76.97%. Comparing base (
c88166e
) to head (1e2cb43
).:exclamation: Current head 1e2cb43 differs from pull request most recent head 8b6382b. Consider uploading reports for the commit 8b6382b to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I think I'd separate these tests out as a separate test case - I'm not sure they belong in "basic" tests. Maybe call it "extreme values test" or somesuch. I'd also tests every combination of the following amounts. The amounts should be used for both AMM pool balances and for transaction amounts (deposit/withdrawal/payments)
I'd expect that you'd want to create these combinations programmatically.
@seelabs what would be the appropriate values for minimum and maximum allowed IOUs? STAmount
represents numbers with a mantissa
and an exponent
. I believe these numbers can have 16 significant digits. So the max and min values would be 1e16
and 1e-16
?
FYI: When using IOUs with AMMDeposit, Payment and AMMWithdraw transactions, it is not feasible to use less than 1e-3
values. The individual transactions have differing limits, but this is the common denominator. 1e-3
appears to be the minimum value of IOUs
High Level Overview of Change
This PR introduces new unit tests to test small AMM Pool creation and tiny Payment transactions against AMMs. AMM pool sizes are in order of
1e-6
and payment transactions are in order of1e-7
. Please let me know if I should test smaller ranges.The behavior of the code matches our understanding for both XRP/IOU and IOU/IOU AMM pools. Many thanks to @gregtatcam for helping with these tests.
Context of Change
Type of Change
.gitignore
, formatting, dropping support for older tooling)API Impact
libxrpl
change (any change that may affectlibxrpl
or dependents oflibxrpl
)No impact on performance. No changes to Public APIs either.