diff --git a/src/test/app/Batch_test.cpp b/src/test/app/Batch_test.cpp index 40a5d80c1e..72f3677e3b 100644 --- a/src/test/app/Batch_test.cpp +++ b/src/test/app/Batch_test.cpp @@ -2581,6 +2581,11 @@ class Batch_test : public beast::unit_test::suite { testcase("loan"); + bool const lendingBatchEnabled = + !std::any_of(Batch::disabledTxTypes.begin(), Batch::disabledTxTypes.end(), [](auto const& disabled) { + return disabled == ttLOAN_BROKER_SET; + }); + using namespace test::jtx; test::jtx::Env env{*this, features | featureSingleAssetVault | featureLendingProtocol | featureMPTokensV1}; @@ -2640,7 +2645,7 @@ class Batch_test : public beast::unit_test::suite { auto const [txIDs, batchID] = submitBatch( env, - temBAD_SIGNATURE, + lendingBatchEnabled ? temBAD_SIGNATURE : temINVALID_INNER_BATCH, batch::outer(lender, lenderSeq, batchFee, tfAllOrNothing), batch::inner( env.json( @@ -2671,7 +2676,7 @@ class Batch_test : public beast::unit_test::suite { auto const [txIDs, batchID] = submitBatch( env, - temBAD_SIGNER, + lendingBatchEnabled ? temBAD_SIGNER : temINVALID_INNER_BATCH, batch::outer(lender, lenderSeq, batchFee, tfAllOrNothing), batch::inner( env.json( @@ -2691,7 +2696,7 @@ class Batch_test : public beast::unit_test::suite auto const batchFee = batch::calcBatchFee(env, 1, 2); auto const [txIDs, batchID] = submitBatch( env, - TER(tesSUCCESS), + lendingBatchEnabled ? TER(tesSUCCESS) : TER(temINVALID_INNER_BATCH), batch::outer(lender, lenderSeq, batchFee, tfAllOrNothing), batch::inner( env.json( @@ -2723,7 +2728,7 @@ class Batch_test : public beast::unit_test::suite auto const batchFee = batch::calcBatchFee(env, 1, 2); auto const [txIDs, batchID] = submitBatch( env, - TER(tesSUCCESS), + lendingBatchEnabled ? TER(tesSUCCESS) : TER(temINVALID_INNER_BATCH), batch::outer(lender, lenderSeq, batchFee, tfAllOrNothing), batch::inner( env.json( @@ -2738,7 +2743,8 @@ class Batch_test : public beast::unit_test::suite } env.close(); BEAST_EXPECT(env.le(brokerKeylet)); - if (auto const sleLoan = env.le(loanKeylet); BEAST_EXPECT(sleLoan)) + if (auto const sleLoan = env.le(loanKeylet); + lendingBatchEnabled ? BEAST_EXPECT(sleLoan) : !BEAST_EXPECT(!sleLoan)) { BEAST_EXPECT(sleLoan->isFlag(lsfLoanImpaired)); } diff --git a/src/test/app/Invariants_test.cpp b/src/test/app/Invariants_test.cpp index ff82d658b9..ba45bd59f5 100644 --- a/src/test/app/Invariants_test.cpp +++ b/src/test/app/Invariants_test.cpp @@ -2,10 +2,6 @@ #include #include -#include -#include -#include - #include #include #include @@ -18,11 +14,15 @@ #include #include #include +#include +#include +#include #include #include #include +#include namespace xrpl { namespace test { diff --git a/src/test/jtx/impl/vault.cpp b/src/test/jtx/impl/vault.cpp index 7366d95445..90250aece0 100644 --- a/src/test/jtx/impl/vault.cpp +++ b/src/test/jtx/impl/vault.cpp @@ -14,8 +14,7 @@ namespace jtx { std::tuple Vault::create(CreateArgs const& args) { - auto sequence = args.sequence ? *args.sequence : env.seq(args.owner); - auto keylet = keylet::vault(args.owner.id(), sequence); + auto keylet = keylet::vault(args.owner.id(), env.seq(args.owner)); Json::Value jv; jv[jss::TransactionType] = jss::VaultCreate; jv[jss::Account] = args.owner.human(); diff --git a/src/test/jtx/vault.h b/src/test/jtx/vault.h index c2a32792ca..65a5706354 100644 --- a/src/test/jtx/vault.h +++ b/src/test/jtx/vault.h @@ -26,7 +26,6 @@ struct Vault Account owner; Asset asset; std::optional flags{}; - std::optional sequence; }; /** Return a VaultCreate transaction and the Vault's expected keylet. */