From 692dbfdb761516c63a84aa60fbf5b50073544fbc Mon Sep 17 00:00:00 2001 From: Richard Holland Date: Fri, 15 Mar 2024 02:26:06 +0000 Subject: [PATCH 1/3] ZeroB2M amendment --- src/ripple/app/tx/impl/Import.cpp | 8 +++++++- src/ripple/protocol/Feature.h | 3 ++- src/ripple/protocol/impl/Feature.cpp | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ripple/app/tx/impl/Import.cpp b/src/ripple/app/tx/impl/Import.cpp index d136c7d67..14af32963 100644 --- a/src/ripple/app/tx/impl/Import.cpp +++ b/src/ripple/app/tx/impl/Import.cpp @@ -1224,7 +1224,13 @@ Import::doApply() create ? STAmount(bonusAmount) : STAmount(mSourceBalance); uint64_t creditDrops = burn.xrp().drops(); - if (elapsed < 2'000'000) + + if (view().rules().enabled(featureZeroB2M)) + { + // B2M xrp is disabled by amendment + creditDrops = 0; + } + else if (elapsed < 2'000'000) { // first 2MM ledgers // the ratio is 1:1 diff --git a/src/ripple/protocol/Feature.h b/src/ripple/protocol/Feature.h index d6e3c3eea..74ea0ae1c 100644 --- a/src/ripple/protocol/Feature.h +++ b/src/ripple/protocol/Feature.h @@ -74,7 +74,7 @@ namespace detail { // Feature.cpp. Because it's only used to reserve storage, and determine how // large to make the FeatureBitset, it MAY be larger. It MUST NOT be less than // the actual number of amendments. A LogicError on startup will verify this. -static constexpr std::size_t numFeatures = 68; +static constexpr std::size_t numFeatures = 69; /** Amendments that this server supports and the default voting behavior. Whether they are enabled depends on the Rules defined in the validated @@ -356,6 +356,7 @@ extern uint256 const featureHooksUpdate1; extern uint256 const fixXahauV1; extern uint256 const fixXahauV2; extern uint256 const featureRemit; +extern uint256 const featureZeroB2M; } // namespace ripple diff --git a/src/ripple/protocol/impl/Feature.cpp b/src/ripple/protocol/impl/Feature.cpp index 565aa0eab..bd23d3e58 100644 --- a/src/ripple/protocol/impl/Feature.cpp +++ b/src/ripple/protocol/impl/Feature.cpp @@ -462,6 +462,7 @@ REGISTER_FEATURE(HooksUpdate1, Supported::yes, VoteBehavior::De REGISTER_FIX (fixXahauV1, Supported::yes, VoteBehavior::DefaultNo); REGISTER_FIX (fixXahauV2, Supported::yes, VoteBehavior::DefaultNo); REGISTER_FEATURE(Remit, Supported::yes, VoteBehavior::DefaultNo); +REGISTER_FEATURE(ZeroB2M, Supported::yes, VoteBehavior::DefaultNo); // The following amendments are obsolete, but must remain supported // because they could potentially get enabled. From 0b3f2a1b5e9efe10f1945cecae96e4af419e00f5 Mon Sep 17 00:00:00 2001 From: Denis Angell Date: Mon, 18 Mar 2024 11:50:38 +0100 Subject: [PATCH 2/3] fix import tests --- src/test/app/Import_test.cpp | 111 +++++++++++++++++++++++------------ 1 file changed, 74 insertions(+), 37 deletions(-) diff --git a/src/test/app/Import_test.cpp b/src/test/app/Import_test.cpp index 3c73ade2c..0d5262021 100644 --- a/src/test/app/Import_test.cpp +++ b/src/test/app/Import_test.cpp @@ -3000,7 +3000,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - feeDrops - auto const totalBurn = XRP(1000) + XRP(2); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = XRP(zeroBurn ? 0 : 1000) + XRP(2); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -3111,7 +3112,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - feeDrops - auto const totalBurn = XRP(1000) + XRP(2); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = XRP(zeroBurn ? 0 : 1000) + XRP(2); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -3178,7 +3180,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - feeDrops - auto const totalBurn = drops(48) + XRP(2); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = drops(zeroBurn ? 0 : 48) + XRP(2); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -3242,7 +3245,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - feeDrops - auto const totalBurn = XRP(1000) - (feeDrops * 10); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = XRP(zeroBurn ? 0 : 1000) - (feeDrops * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -3299,7 +3303,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - feeDrops - auto const totalBurn = XRP(1000) - (feeDrops * 10); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = XRP(zeroBurn ? 0 : 1000) - (feeDrops * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -3363,7 +3368,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - feeDrops - auto const totalBurn = drops(48) - ((3 * feeDrops) * 10); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = drops(zeroBurn ? 0 : 48) - ((3 * feeDrops) * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -3433,7 +3439,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - fee drops - auto const totalBurn = drops(10) - (feeDrops * 10); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = drops(zeroBurn ? 0 : 10) - (feeDrops * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -3500,7 +3507,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + reward amount - auto const totalBurn = drops(12) + XRP(2); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = drops(zeroBurn ? 0 : 12) + XRP(2); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -3560,7 +3568,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - initial value - auto const totalBurn = drops(12) + XRP(2); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = drops(zeroBurn ? 0 : 12) + XRP(2); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -3622,7 +3631,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + reward amount - auto const totalBurn = drops(48) + XRP(2); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = drops(zeroBurn ? 0 : 48) + XRP(2); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -3684,7 +3694,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - feeDrops - auto const totalBurn = drops(12) - (feeDrops * 10); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = drops(zeroBurn ? 0 : 12) - (feeDrops * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -3754,7 +3765,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - fee drops - auto const totalBurn = drops(12) - (feeDrops * 10); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = drops(zeroBurn ? 0 : 12) - (feeDrops * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -3825,7 +3837,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - fee drops - auto const totalBurn = drops(12) - (feeDrops * 10); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = drops(zeroBurn ? 0 : 12) - (feeDrops * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -3897,7 +3910,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - fee drops - auto const totalBurn = drops(48) - ((3 * feeDrops) * 10); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = drops(zeroBurn ? 0 : 48) - ((3 * feeDrops) * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -3971,7 +3985,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - fee drops - auto const totalBurn = drops(12) - (feeDrops * 10); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = drops(zeroBurn ? 0 : 12) - (feeDrops * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -4040,7 +4055,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - fee drops - auto const totalBurn = drops(12) - (feeDrops * 10); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = drops(zeroBurn ? 0 : 12) - (feeDrops * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -4113,7 +4129,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - fee drops - auto const totalBurn = drops(48) - ((3 * feeDrops) * 10); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = drops(zeroBurn ? 0 : 48) - ((3 * feeDrops) * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -4303,7 +4320,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = (burn drops + burn fee drops) - reward - auto const totalBurn = XRP(2) + drops(12) + XRP(2); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = XRP(zeroBurn ? 0 : 2) + drops(zeroBurn ? 0 : 12) + XRP(2); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -4385,7 +4403,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = (burn drops + burn fee drops) - fee drops - auto const totalBurn = XRP(2) + drops(12) + XRP(2); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = XRP(zeroBurn ? 0 : 2) + drops(zeroBurn ? 0 : 12) + XRP(2); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -4543,7 +4562,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = (burn drops + burn fee drops) - fee drops - auto const totalBurn = XRP(2) + drops(12) - (feeDrops * 10); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = XRP(zeroBurn ? 0 : 2) + drops(zeroBurn ? 0 : 12) - (feeDrops * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -4634,7 +4654,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = (burn drops + burn fee drops) - fee drops - auto const totalBurn = XRP(2) + drops(12) - (feeDrops * 10); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = XRP(zeroBurn ? 0 : 2) + drops(zeroBurn ? 0 : 12) - (feeDrops * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -4713,7 +4734,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = (burn drops + burn fee drops) - fee drops - auto const totalBurn = XRP(2) + drops(12) - (feeDrops * 10); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = XRP(zeroBurn ? 0 : 2) + drops(zeroBurn ? 0 : 12) - (feeDrops * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -4793,7 +4815,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = (burn drops + burn fee drops) - fee drops - auto const totalBurn = XRP(2) + drops(48) - ((3 * feeDrops) * 10); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = XRP(zeroBurn ? 0 : 2) + drops(zeroBurn ? 0 : 48) - ((3 * feeDrops) * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -5055,7 +5078,8 @@ class Import_test : public beast::unit_test::suite env.close(); // fixXahauV2 - auto const mintXAH = fixV2 ? XRP(1000) : XRP(0); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const mintXAH = fixV2 ? XRP(zeroBurn ? 0 : 1000) : XRP(0); // confirm fee was burned mint / no mint auto const postAlice = env.balance(alice); BEAST_EXPECT(postAlice == preAlice - XRP(1) + mintXAH); @@ -5074,7 +5098,7 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn - auto const totalBurn = fixV2 ? XRP(0) : XRP(1000) - (feeDrops * 10); + auto const totalBurn = fixV2 ? XRP(0) : XRP(zeroBurn ? 0 : 1000) - (feeDrops * 10); // confirm fee was minted / not minted auto const postAlice2 = env.balance(alice); @@ -5318,7 +5342,8 @@ class Import_test : public beast::unit_test::suite auto const preAlice = env.balance(alice); BEAST_EXPECT(preAlice == XRP(0)); - STAmount burnFee = XRP(1000) + XRP(2); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + STAmount burnFee = XRP(zeroBurn ? 0 : 1000) + XRP(2); auto const xpopJson = import::loadXpop(ImportTCAccountSet::w_seed); Json::Value tx = import::import(alice, xpopJson); tx[jss::Sequence] = 0; @@ -5356,7 +5381,8 @@ class Import_test : public beast::unit_test::suite auto const preAlice = env.balance(alice); BEAST_EXPECT(preAlice == XRP(0)); - STAmount burnFee = XRP(1000) + XRP(2); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + STAmount burnFee = XRP(zeroBurn ? 0 : 1000) + XRP(2); auto const xpopJson = import::loadXpop(ImportTCAccountSet::w_seed); Json::Value tx = import::import(alice, xpopJson); tx[jss::Sequence] = 0; @@ -5387,7 +5413,8 @@ class Import_test : public beast::unit_test::suite auto const preAlice = env.balance(alice); BEAST_EXPECT(preAlice == XRP(0)); - STAmount burnFee = XRP(1000) + XRP(2); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + STAmount burnFee = XRP(zeroBurn ? 0 : 1000) + XRP(2); auto const xpopJson = import::loadXpop(ImportTCAccountSet::w_seed); Json::Value tx = import::import(alice, xpopJson); tx[jss::Sequence] = 0; @@ -5447,7 +5474,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + reward amount - auto const totalBurn = drops(10) + XRP(2); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = drops(zeroBurn ? 0 : 10) + XRP(2); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -5504,7 +5532,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + reward amount - auto const totalBurn = drops(10) + XRP(20); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = drops(zeroBurn ? 0 : 10) + XRP(20); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -5558,7 +5587,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + reward amount - auto const totalBurn = drops(99'999'939'799'000'000) + XRP(2); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = drops(zeroBurn ? 0 : 99'999'939'799'000'000) + XRP(2); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -5615,7 +5645,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + Init Reward - auto const creditDrops = XRP(1'000) + XRP(2); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const creditDrops = XRP(zeroBurn ? 0 : 1'000) + XRP(2); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -5658,7 +5689,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + Init Reward - auto const creditDrops = XRP(1'000) + XRP(2); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const creditDrops = XRP(zeroBurn ? 0 : 1'000) + XRP(2); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -5702,7 +5734,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + Init Reward - auto const creditDrops = drops(999999964) + XRP(2); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const creditDrops = drops(zeroBurn ? 0 : 999999964) + XRP(2); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -5744,7 +5777,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + Init Reward - auto const creditDrops = drops(892857142) + XRP(2); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const creditDrops = drops(zeroBurn ? 0 : 892857142) + XRP(2); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -5786,7 +5820,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + Init Reward - auto const creditDrops = drops(357142857) + XRP(2); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const creditDrops = drops(zeroBurn ? 0 : 357142857) + XRP(2); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -5828,7 +5863,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + Init Reward - auto const creditDrops = drops(35) + XRP(2); + bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + auto const creditDrops = drops(zeroBurn ? 0 : 35) + XRP(2); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -5932,6 +5968,7 @@ class Import_test : public beast::unit_test::suite using namespace test::jtx; FeatureBitset const all{supported_amendments()}; testWithFeats(all - fixXahauV2); + testWithFeats(all - featureZeroB2M); testWithFeats(all); } From 2972f046bfb82457728a700fb0cc7fadfba56405 Mon Sep 17 00:00:00 2001 From: Denis Angell Date: Mon, 18 Mar 2024 16:07:49 +0100 Subject: [PATCH 3/3] clang-format --- src/test/app/Import_test.cpp | 141 +++++++++++++++++++++++------------ 1 file changed, 94 insertions(+), 47 deletions(-) diff --git a/src/test/app/Import_test.cpp b/src/test/app/Import_test.cpp index 0d5262021..d85a0420b 100644 --- a/src/test/app/Import_test.cpp +++ b/src/test/app/Import_test.cpp @@ -3000,7 +3000,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - feeDrops - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const totalBurn = XRP(zeroBurn ? 0 : 1000) + XRP(2); // confirm fee was minted @@ -3112,7 +3113,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - feeDrops - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const totalBurn = XRP(zeroBurn ? 0 : 1000) + XRP(2); // confirm fee was minted @@ -3180,7 +3182,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - feeDrops - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const totalBurn = drops(zeroBurn ? 0 : 48) + XRP(2); // confirm fee was minted @@ -3245,7 +3248,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - feeDrops - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const totalBurn = XRP(zeroBurn ? 0 : 1000) - (feeDrops * 10); // confirm fee was minted @@ -3303,7 +3307,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - feeDrops - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const totalBurn = XRP(zeroBurn ? 0 : 1000) - (feeDrops * 10); // confirm fee was minted @@ -3368,8 +3373,10 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - feeDrops - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); - auto const totalBurn = drops(zeroBurn ? 0 : 48) - ((3 * feeDrops) * 10); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = + drops(zeroBurn ? 0 : 48) - ((3 * feeDrops) * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -3439,7 +3446,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - fee drops - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const totalBurn = drops(zeroBurn ? 0 : 10) - (feeDrops * 10); // confirm fee was minted @@ -3507,7 +3515,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + reward amount - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const totalBurn = drops(zeroBurn ? 0 : 12) + XRP(2); // confirm fee was minted @@ -3568,7 +3577,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - initial value - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const totalBurn = drops(zeroBurn ? 0 : 12) + XRP(2); // confirm fee was minted @@ -3631,7 +3641,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + reward amount - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const totalBurn = drops(zeroBurn ? 0 : 48) + XRP(2); // confirm fee was minted @@ -3694,7 +3705,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - feeDrops - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const totalBurn = drops(zeroBurn ? 0 : 12) - (feeDrops * 10); // confirm fee was minted @@ -3765,7 +3777,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - fee drops - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const totalBurn = drops(zeroBurn ? 0 : 12) - (feeDrops * 10); // confirm fee was minted @@ -3837,7 +3850,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - fee drops - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const totalBurn = drops(zeroBurn ? 0 : 12) - (feeDrops * 10); // confirm fee was minted @@ -3910,8 +3924,10 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - fee drops - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); - auto const totalBurn = drops(zeroBurn ? 0 : 48) - ((3 * feeDrops) * 10); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = + drops(zeroBurn ? 0 : 48) - ((3 * feeDrops) * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -3985,7 +4001,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - fee drops - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const totalBurn = drops(zeroBurn ? 0 : 12) - (feeDrops * 10); // confirm fee was minted @@ -4055,7 +4072,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - fee drops - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const totalBurn = drops(zeroBurn ? 0 : 12) - (feeDrops * 10); // confirm fee was minted @@ -4129,8 +4147,10 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops - fee drops - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); - auto const totalBurn = drops(zeroBurn ? 0 : 48) - ((3 * feeDrops) * 10); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = + drops(zeroBurn ? 0 : 48) - ((3 * feeDrops) * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -4320,8 +4340,10 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = (burn drops + burn fee drops) - reward - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); - auto const totalBurn = XRP(zeroBurn ? 0 : 2) + drops(zeroBurn ? 0 : 12) + XRP(2); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = + XRP(zeroBurn ? 0 : 2) + drops(zeroBurn ? 0 : 12) + XRP(2); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -4403,8 +4425,10 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = (burn drops + burn fee drops) - fee drops - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); - auto const totalBurn = XRP(zeroBurn ? 0 : 2) + drops(zeroBurn ? 0 : 12) + XRP(2); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = + XRP(zeroBurn ? 0 : 2) + drops(zeroBurn ? 0 : 12) + XRP(2); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -4562,8 +4586,10 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = (burn drops + burn fee drops) - fee drops - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); - auto const totalBurn = XRP(zeroBurn ? 0 : 2) + drops(zeroBurn ? 0 : 12) - (feeDrops * 10); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = XRP(zeroBurn ? 0 : 2) + + drops(zeroBurn ? 0 : 12) - (feeDrops * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -4654,8 +4680,10 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = (burn drops + burn fee drops) - fee drops - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); - auto const totalBurn = XRP(zeroBurn ? 0 : 2) + drops(zeroBurn ? 0 : 12) - (feeDrops * 10); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = XRP(zeroBurn ? 0 : 2) + + drops(zeroBurn ? 0 : 12) - (feeDrops * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -4734,8 +4762,10 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = (burn drops + burn fee drops) - fee drops - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); - auto const totalBurn = XRP(zeroBurn ? 0 : 2) + drops(zeroBurn ? 0 : 12) - (feeDrops * 10); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = XRP(zeroBurn ? 0 : 2) + + drops(zeroBurn ? 0 : 12) - (feeDrops * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -4815,8 +4845,10 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = (burn drops + burn fee drops) - fee drops - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); - auto const totalBurn = XRP(zeroBurn ? 0 : 2) + drops(zeroBurn ? 0 : 48) - ((3 * feeDrops) * 10); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = XRP(zeroBurn ? 0 : 2) + + drops(zeroBurn ? 0 : 48) - ((3 * feeDrops) * 10); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -5078,7 +5110,8 @@ class Import_test : public beast::unit_test::suite env.close(); // fixXahauV2 - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const mintXAH = fixV2 ? XRP(zeroBurn ? 0 : 1000) : XRP(0); // confirm fee was burned mint / no mint auto const postAlice = env.balance(alice); @@ -5098,7 +5131,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn - auto const totalBurn = fixV2 ? XRP(0) : XRP(zeroBurn ? 0 : 1000) - (feeDrops * 10); + auto const totalBurn = + fixV2 ? XRP(0) : XRP(zeroBurn ? 0 : 1000) - (feeDrops * 10); // confirm fee was minted / not minted auto const postAlice2 = env.balance(alice); @@ -5342,7 +5376,8 @@ class Import_test : public beast::unit_test::suite auto const preAlice = env.balance(alice); BEAST_EXPECT(preAlice == XRP(0)); - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); STAmount burnFee = XRP(zeroBurn ? 0 : 1000) + XRP(2); auto const xpopJson = import::loadXpop(ImportTCAccountSet::w_seed); Json::Value tx = import::import(alice, xpopJson); @@ -5381,7 +5416,8 @@ class Import_test : public beast::unit_test::suite auto const preAlice = env.balance(alice); BEAST_EXPECT(preAlice == XRP(0)); - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); STAmount burnFee = XRP(zeroBurn ? 0 : 1000) + XRP(2); auto const xpopJson = import::loadXpop(ImportTCAccountSet::w_seed); Json::Value tx = import::import(alice, xpopJson); @@ -5413,7 +5449,8 @@ class Import_test : public beast::unit_test::suite auto const preAlice = env.balance(alice); BEAST_EXPECT(preAlice == XRP(0)); - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); STAmount burnFee = XRP(zeroBurn ? 0 : 1000) + XRP(2); auto const xpopJson = import::loadXpop(ImportTCAccountSet::w_seed); Json::Value tx = import::import(alice, xpopJson); @@ -5474,7 +5511,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + reward amount - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const totalBurn = drops(zeroBurn ? 0 : 10) + XRP(2); // confirm fee was minted @@ -5532,7 +5570,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + reward amount - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const totalBurn = drops(zeroBurn ? 0 : 10) + XRP(20); // confirm fee was minted @@ -5587,8 +5626,10 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + reward amount - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); - auto const totalBurn = drops(zeroBurn ? 0 : 99'999'939'799'000'000) + XRP(2); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); + auto const totalBurn = + drops(zeroBurn ? 0 : 99'999'939'799'000'000) + XRP(2); // confirm fee was minted auto const postAlice = env.balance(alice); @@ -5645,7 +5686,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + Init Reward - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const creditDrops = XRP(zeroBurn ? 0 : 1'000) + XRP(2); // confirm fee was minted @@ -5689,7 +5731,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + Init Reward - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const creditDrops = XRP(zeroBurn ? 0 : 1'000) + XRP(2); // confirm fee was minted @@ -5734,7 +5777,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + Init Reward - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const creditDrops = drops(zeroBurn ? 0 : 999999964) + XRP(2); // confirm fee was minted @@ -5777,7 +5821,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + Init Reward - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const creditDrops = drops(zeroBurn ? 0 : 892857142) + XRP(2); // confirm fee was minted @@ -5820,7 +5865,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + Init Reward - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const creditDrops = drops(zeroBurn ? 0 : 357142857) + XRP(2); // confirm fee was minted @@ -5863,7 +5909,8 @@ class Import_test : public beast::unit_test::suite env.close(); // total burn = burn drops + Init Reward - bool const zeroBurn = env.current()->rules().enabled(featureZeroB2M); + bool const zeroBurn = + env.current()->rules().enabled(featureZeroB2M); auto const creditDrops = drops(zeroBurn ? 0 : 35) + XRP(2); // confirm fee was minted