diff --git a/include/xrpl/basics/Number.h b/include/xrpl/basics/Number.h index b5a11d2ab6..3aeb4b5bcd 100644 --- a/include/xrpl/basics/Number.h +++ b/include/xrpl/basics/Number.h @@ -123,7 +123,7 @@ private: default: // If called in a constexpr context, this throw assures that the build fails if an // invalid scale is used. - throw std::runtime_error("Unknown mantissa scale"); //LCOV_EXCL_LINE + throw std::runtime_error("Unknown mantissa scale"); // LCOV_EXCL_LINE } } @@ -140,7 +140,7 @@ private: default: // If called in a constexpr context, this throw assures that the build fails if an // invalid scale is used. - throw std::runtime_error("Unknown mantissa scale"); //LCOV_EXCL_LINE + throw std::runtime_error("Unknown mantissa scale"); // LCOV_EXCL_LINE } } diff --git a/src/libxrpl/protocol/Rules.cpp b/src/libxrpl/protocol/Rules.cpp index 7f8978778a..08a95145eb 100644 --- a/src/libxrpl/protocol/Rules.cpp +++ b/src/libxrpl/protocol/Rules.cpp @@ -40,31 +40,23 @@ setCurrentTransactionRules(std::optional r) // Push the appropriate setting, instead of having the class pull every time // the value is needed. That could get expensive fast. - // The improved accuracy that will come from enabling large - // mantissas is a goal separate from SAV and LP. It was originally - // only tied to those two amendments to avoid needing a new - // amendment of its own, and because they require that behavior. - // Because fixCleanup3_2_0 fixes a separate bug related to the large - // mantissas, that can take precedence and activate the large - // mantissas even in the absence of the other two amendments. - // // If any new conditions with new amendments are added, those amendments must also be added to // useRulesGuards. + bool const enableVaultNumbers = + !r || (r->enabled(featureSingleAssetVault) || r->enabled(featureLendingProtocol)); bool const enableCuspRoundingFix = !r || r->enabled(fixCleanup3_2_0); - bool const enableVaultNumbers = enableCuspRoundingFix || - (r->enabled(featureSingleAssetVault) || r->enabled(featureLendingProtocol)); XRPL_ASSERT( !r || useRulesGuards(*r) == (enableCuspRoundingFix || enableVaultNumbers), "setCurrentTransactionRules : rule decisions match"); // Declare the range this way to keep clang-tidy from complaining auto const range = [enableCuspRoundingFix, enableVaultNumbers]() { - if (enableCuspRoundingFix) - { - return MantissaRange::MantissaScale::Large; - } if (enableVaultNumbers) { + if (enableCuspRoundingFix) + { + return MantissaRange::MantissaScale::Large; + } return MantissaRange::MantissaScale::LargeLegacy; } return MantissaRange::MantissaScale::Small; diff --git a/src/test/app/AMMClawbackMPT_test.cpp b/src/test/app/AMMClawbackMPT_test.cpp index f80b68530f..6facafde4a 100644 --- a/src/test/app/AMMClawbackMPT_test.cpp +++ b/src/test/app/AMMClawbackMPT_test.cpp @@ -1829,7 +1829,7 @@ class AMMClawbackMPT_test : public beast::unit_test::Suite testLastHolderLPTokenBalance(all - fixAMMv1_3 - fixAMMClawbackRounding); testLastHolderLPTokenBalance( all - fixAMMv1_3 - fixAMMClawbackRounding - featureSingleAssetVault - - featureLendingProtocol - fixCleanup3_2_0); + featureLendingProtocol); testLastHolderLPTokenBalance(all - fixAMMClawbackRounding); testClawAssetCheck(all); } diff --git a/src/test/app/AMMClawback_test.cpp b/src/test/app/AMMClawback_test.cpp index 500fd84ebe..9683e8ac17 100644 --- a/src/test/app/AMMClawback_test.cpp +++ b/src/test/app/AMMClawback_test.cpp @@ -2506,8 +2506,8 @@ class AMMClawback_test : public beast::unit_test::Suite { // For now, just disable SAV entirely, which locks in the small Number // mantissas - FeatureBitset const all = jtx::testableAmendments() - featureSingleAssetVault - - featureLendingProtocol - fixCleanup3_2_0; + FeatureBitset const all = + jtx::testableAmendments() - featureSingleAssetVault - featureLendingProtocol; testInvalidRequest(all); testInvalidRequest(all - featureMPTokensV2); diff --git a/src/test/app/AMMExtended_test.cpp b/src/test/app/AMMExtended_test.cpp index d67382600d..a0a7d0fb15 100644 --- a/src/test/app/AMMExtended_test.cpp +++ b/src/test/app/AMMExtended_test.cpp @@ -73,7 +73,7 @@ class AMMExtended_test : public jtx::AMMTest // For now, just disable SAV entirely, which locks in the small Number // mantissas FeatureBitset const all_{ - testableAmendments() - featureSingleAssetVault - featureLendingProtocol - fixCleanup3_2_0}; + testableAmendments() - featureSingleAssetVault - featureLendingProtocol}; private: void diff --git a/src/test/app/AMM_test.cpp b/src/test/app/AMM_test.cpp index 9aa67309e4..2c63ff6d61 100644 --- a/src/test/app/AMM_test.cpp +++ b/src/test/app/AMM_test.cpp @@ -82,8 +82,7 @@ private: { // For now, just disable SAV entirely, which locks in the small Number // mantissas - return jtx::testableAmendments() - featureSingleAssetVault - featureLendingProtocol - - fixCleanup3_2_0; + return jtx::testableAmendments() - featureSingleAssetVault - featureLendingProtocol; } void diff --git a/src/test/app/EscrowToken_test.cpp b/src/test/app/EscrowToken_test.cpp index 38f86ee5b4..bac2f798ad 100644 --- a/src/test/app/EscrowToken_test.cpp +++ b/src/test/app/EscrowToken_test.cpp @@ -573,7 +573,8 @@ struct EscrowToken_test : public beast::unit_test::Suite env(pay(gw, bob, usd(1))); env.close(); - bool const largeMantissa = useRulesGuards(env.current()->rules()); + bool const largeMantissa = + features[featureSingleAssetVault] || features[featureLendingProtocol]; // alice cannot create escrow for 1/10 iou - precision loss env(escrow::create(alice, bob, usd(1)), @@ -2200,7 +2201,8 @@ struct EscrowToken_test : public beast::unit_test::Suite env(pay(gw, bob, usd(1))); env.close(); - bool const largeMantissa = useRulesGuards(env.current()->rules()); + bool const largeMantissa = + features[featureSingleAssetVault] || features[featureLendingProtocol]; // alice cannot create escrow for 1/10 iou - precision loss env(escrow::create(alice, bob, usd(1)),