Gate the changes with the amendment

Signed-off-by: JCW <a1q123456@users.noreply.github.com>
This commit is contained in:
JCW
2026-02-24 14:31:10 +00:00
parent bebf21e1aa
commit 23445d7eb8
4 changed files with 34 additions and 11 deletions

View File

@@ -32,6 +32,24 @@ public:
TER
doApply() override;
static constexpr auto disabledTxTypes = std::to_array<TxType>({
ttVAULT_CREATE,
ttVAULT_SET,
ttVAULT_DELETE,
ttVAULT_DEPOSIT,
ttVAULT_WITHDRAW,
ttVAULT_CLAWBACK,
ttLOAN_BROKER_SET,
ttLOAN_BROKER_DELETE,
ttLOAN_BROKER_COVER_DEPOSIT,
ttLOAN_BROKER_COVER_WITHDRAW,
ttLOAN_BROKER_COVER_CLAWBACK,
ttLOAN_SET,
ttLOAN_DELETE,
ttLOAN_MANAGE,
ttLOAN_PAY,
});
};
} // namespace xrpl

View File

@@ -258,7 +258,8 @@ Batch::preflight(PreflightContext const& ctx)
return temINVALID;
}
if (std::any_of(
if (!ctx.rules.enabled(fixLendingProtocolV1_1) &&
std::any_of(
disabledTxTypes.begin(), disabledTxTypes.end(), [txType](auto const& disabled) {
return txType == disabled;
}))

View File

@@ -2600,16 +2600,18 @@ 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};
bool const lendingBatchEnabled =
!std::any_of(
Batch::disabledTxTypes.begin(),
Batch::disabledTxTypes.end(),
[](auto const& disabled) { return disabled == ttLOAN_BROKER_SET; }) ||
env.enabled(fixLendingProtocolV1_1);
Account const issuer{"issuer"};
// For simplicity, lender will be the sole actor for the vault &
// brokers.

View File

@@ -2174,15 +2174,17 @@ protected:
// From FIND-001
testcase << "Batch Bypass Counterparty";
bool const lendingBatchEnabled = !std::any_of(
Batch::disabledTxTypes.begin(), Batch::disabledTxTypes.end(), [](auto const& disabled) {
return disabled == ttLOAN_BROKER_SET;
});
using namespace jtx;
using namespace std::chrono_literals;
Env env(*this, all);
bool const lendingBatchEnabled =
!std::any_of(
Batch::disabledTxTypes.begin(),
Batch::disabledTxTypes.end(),
[](auto const& disabled) { return disabled == ttLOAN_BROKER_SET; }) ||
env.enabled(fixLendingProtocolV1_1);
Account const lender{"lender"};
Account const borrower{"borrower"};