From dd6e21c38b2fb323acbfd8d8dc0fc26eaa674ddd Mon Sep 17 00:00:00 2001 From: Richard Holland Date: Sun, 24 Sep 2023 19:51:04 +0000 Subject: [PATCH] more unit test fixes --- src/ripple/app/tx/impl/Import.cpp | 2 +- src/ripple/app/tx/impl/Payment.cpp | 2 +- src/test/jtx/Env_test.cpp | 17 +++++++++-------- src/test/rpc/LedgerRPC_test.cpp | 6 ++++-- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/ripple/app/tx/impl/Import.cpp b/src/ripple/app/tx/impl/Import.cpp index 8475d215c..683be29a6 100644 --- a/src/ripple/app/tx/impl/Import.cpp +++ b/src/ripple/app/tx/impl/Import.cpp @@ -1231,7 +1231,7 @@ Import::doApply() sle->setFieldU32(sfSequence, seqno); sle->setFieldU32(sfOwnerCount, 0); - if (sleFees) + if (sleFees && view().rules().enabled(featureXahauGenesis)) { uint64_t accIdx = sleFees->isFieldPresent(sfAccountCount) ? sleFees->getFieldU64(sfAccountCount) : 0; sle->setFieldU64(sfAccountIndex, accIdx); diff --git a/src/ripple/app/tx/impl/Payment.cpp b/src/ripple/app/tx/impl/Payment.cpp index 3de724149..c1ee5d702 100644 --- a/src/ripple/app/tx/impl/Payment.cpp +++ b/src/ripple/app/tx/impl/Payment.cpp @@ -344,7 +344,7 @@ Payment::doApply() sleDst->setFieldU32(sfSequence, seqno); auto sleFees = view().peek(keylet::fees()); - if (sleFees) + if (sleFees && view().rules().enabled(featureXahauGenesis)) { auto actIdx = sleFees->isFieldPresent(sfAccountCount) ? sleFees->getFieldU64(sfAccountCount) : 0; sleDst->setFieldU64(sfAccountIndex, actIdx); diff --git a/src/test/jtx/Env_test.cpp b/src/test/jtx/Env_test.cpp index 6f09f49ed..c983abfe0 100644 --- a/src/test/jtx/Env_test.cpp +++ b/src/test/jtx/Env_test.cpp @@ -156,6 +156,7 @@ public: // unfunded { Env env(*this); + env.memoize(alice); env(pay("alice", "bob", XRP(1000)), seq(1), fee(10), @@ -610,16 +611,16 @@ public: using namespace jtx; Env env(*this); env.fund(XRP(10000), "alice"); - env(noop("alice"), memodata("data")); - env(noop("alice"), memoformat("format")); - env(noop("alice"), memotype("type")); - env(noop("alice"), memondata("format", "type")); - env(noop("alice"), memonformat("data", "type")); - env(noop("alice"), memontype("data", "format")); - env(noop("alice"), memo("data", "format", "type")); + env(noop("alice"), memodata("data"), fee(1000)); + env(noop("alice"), memoformat("format"), fee(1000)); + env(noop("alice"), memotype("type"), fee(1000)); + env(noop("alice"), memondata("format", "type"), fee(1000)); + env(noop("alice"), memonformat("data", "type"), fee(1000)); + env(noop("alice"), memontype("data", "format"), fee(1000)); + env(noop("alice"), memo("data", "format", "type"), fee(1000)); env(noop("alice"), memo("data1", "format1", "type1"), - memo("data2", "format2", "type2")); + memo("data2", "format2", "type2"), fee(10000)); } void diff --git a/src/test/rpc/LedgerRPC_test.cpp b/src/test/rpc/LedgerRPC_test.cpp index bd8536248..92377d9e0 100644 --- a/src/test/rpc/LedgerRPC_test.cpp +++ b/src/test/rpc/LedgerRPC_test.cpp @@ -290,7 +290,7 @@ public: { testcase("ledger_entry Request AccountRoot"); using namespace test::jtx; - Env env{*this}; + Env env{*this, supported_amendments() - featureXahauGenesis}; Account const alice{"alice"}; env.fund(XRP(10000), alice); env.close(); @@ -322,6 +322,7 @@ public: "73A995B477E92EC229F99CED5B62BF4D2ACE4DC42719103AE2F6240000002" "540BE4008114AE123A8556F3CF91154711376AFB0F894F832B3D"}; + // Request alice's account root, but with binary == true; Json::Value jvParams; jvParams[jss::account_root] = alice.human(); @@ -1631,6 +1632,7 @@ public: using namespace test::jtx; Env env{*this, FeatureBitset{}}; // hashes requested below assume // no amendments + env.fund(XRP(10000), "alice"); env.close(); env.fund(XRP(10000), "bob"); @@ -1847,7 +1849,7 @@ public: section.set("minimum_txn_in_ledger_standalone", "3"); section.set("normal_consensus_increase_percent", "0"); return cfg; - })}; + }), supported_amendments() - featureXahauGenesis}; Json::Value jv; jv[jss::ledger_index] = "current";