Start fixing the AMMExtended tests

This commit is contained in:
Ed Hennis
2025-11-26 18:10:13 -05:00
parent eaaea43f80
commit ae919ad5b7
3 changed files with 12 additions and 2 deletions

View File

@@ -26,6 +26,9 @@ namespace test {
*/
struct AMMExtended_test : public jtx::AMMTest
{
// Use small Number mantissas for the life of this test.
NumberMantissaScaleGuard const sg_{ripple::MantissaRange::small};
private:
void
testRmFundedOffer(FeatureBitset features)
@@ -42,6 +45,11 @@ private:
// funded and not used for the payment.
using namespace jtx;
// For now, just disable SAV entirely, which locks in the small Number
// mantissas
features =
features - featureSingleAssetVault /* - featureLendingProtocol */;
Env env{*this, features};
fund(

View File

@@ -31,7 +31,7 @@ namespace test {
struct AMM_test : public jtx::AMMTest
{
// Use small Number mantissas for the life of this test.
NumberMantissaScaleGuard sg_{ripple::MantissaRange::small};
NumberMantissaScaleGuard const sg_{ripple::MantissaRange::small};
private:
void

View File

@@ -42,9 +42,11 @@ AMMLiquidity<TIn, TOut>::generateFibSeqOffer(
{
TAmounts<TIn, TOut> cur{};
Number const initialFibSeqPct =
Number{InitialFibSeqPct.mantissa(), InitialFibSeqPct.exponent()};
cur.in = toAmount<TIn>(
getIssue(balances.in),
InitialFibSeqPct * initialBalances_.in,
initialFibSeqPct * initialBalances_.in,
Number::rounding_mode::upward);
cur.out = swapAssetIn(initialBalances_, cur.in, tradingFee_);