diff --git a/src/libxrpl/tx/transactors/system/Batch.cpp b/src/libxrpl/tx/transactors/system/Batch.cpp index 7b2f0d464c..d4cb55bb05 100644 --- a/src/libxrpl/tx/transactors/system/Batch.cpp +++ b/src/libxrpl/tx/transactors/system/Batch.cpp @@ -298,9 +298,9 @@ Batch::preflight(PreflightContext const& ctx) } auto const txType = stx.getFieldU16(sfTransactionType); - // Pre-LendingProtocolV1_1: SAV and Lending transactions cannot be Batch inners. - // Post-LendingProtocolV1_1: they continue through the normal Batch checks. - bool const isDisabledTxType = !ctx.rules.enabled(featureLendingProtocolV1_1) && + // Pre-LendingProtocolV1_2: SAV and Lending transactions cannot be Batch inners. + // Post-LendingProtocolV1_2: they continue through the normal Batch checks. + bool const isDisabledTxType = !ctx.rules.enabled(featureLendingProtocolV1_2) && std::ranges::any_of( kDisabledTxTypes, [txType](auto const& disabled) { return txType == disabled; }); if (isDisabledTxType) diff --git a/src/test/app/Batch_test.cpp b/src/test/app/Batch_test.cpp index d9f1444e3e..2c51072d67 100644 --- a/src/test/app/Batch_test.cpp +++ b/src/test/app/Batch_test.cpp @@ -3138,7 +3138,7 @@ class Batch_test : public beast::unit_test::Suite { testcase("loan"); - bool const lendingBatchEnabled = features[featureLendingProtocolV1_1]; + bool const lendingBatchEnabled = features[featureLendingProtocolV1_2]; using namespace test::jtx; @@ -3325,7 +3325,9 @@ class Batch_test : public beast::unit_test::Suite using namespace test::jtx; - auto const run = [this](FeatureBitset amendments, TER expected, bool expectVault) { + // Before LendingProtocolV1_2 a Vault inner transaction rejects the whole batch. + auto const checkVaultBatch = [this](FeatureBitset amendments) { + bool const lendingBatchEnabled = amendments[featureLendingProtocolV1_2]; Env env{*this, amendments}; Account const payer{"payer"}; @@ -3341,7 +3343,7 @@ class Batch_test : public beast::unit_test::Suite auto const batchFee = batch::calcBatchFee(env, 1, 2); submitBatch( env, - expected, + lendingBatchEnabled ? TER{tesSUCCESS} : TER{temINVALID_INNER_BATCH}, batch::outer(payer, payerSeq, batchFee, tfAllOrNothing), batch::Inner(create, lenderSeq), batch::Inner( @@ -3351,11 +3353,11 @@ class Batch_test : public beast::unit_test::Suite batch::Sig(lender)); env.close(); - BEAST_EXPECT(static_cast(env.le(vaultKeylet)) == expectVault); + BEAST_EXPECT(static_cast(env.le(vaultKeylet)) == lendingBatchEnabled); }; - run(features - featureLendingProtocolV1_1, temINVALID_INNER_BATCH, false); - run(features, tesSUCCESS, true); + checkVaultBatch(features - featureLendingProtocolV1_2); + checkVaultBatch(features); } void diff --git a/src/test/app/lending/LoanLifecycle_test.cpp b/src/test/app/lending/LoanLifecycle_test.cpp index 9ccdcba106..c553a87e5f 100644 --- a/src/test/app/lending/LoanLifecycle_test.cpp +++ b/src/test/app/lending/LoanLifecycle_test.cpp @@ -495,7 +495,7 @@ private: // From FIND-001 testcase << "Batch Bypass Counterparty"; - bool const lendingBatchEnabled = features[featureLendingProtocolV1_1]; + bool const lendingBatchEnabled = features[featureLendingProtocolV1_2]; using namespace jtx; using namespace std::chrono_literals;