From 72221500959c0c7ba8b1fe68b7d835ac7c2059f9 Mon Sep 17 00:00:00 2001 From: Vito Tumas <5780819+Tapanito@users.noreply.github.com> Date: Mon, 16 Mar 2026 09:26:57 +0100 Subject: [PATCH] refactor: Rename fixLendingProtocolV1_1 to featureLendingProtocolV1_1 (#6527) Use XRPL_FEATURE macro instead of XRPL_FIX since LendingProtocolV1_1 is a feature amendment, not a fix. Update all references in VaultDelete and related tests. --- include/xrpl/protocol/detail/features.macro | 2 +- src/libxrpl/tx/transactors/vault/VaultDelete.cpp | 2 +- src/test/app/LoanBroker_test.cpp | 8 ++++---- src/test/app/Vault_test.cpp | 14 +++++++------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/xrpl/protocol/detail/features.macro b/include/xrpl/protocol/detail/features.macro index 5c7bd1bd4f..b806dc2fd0 100644 --- a/include/xrpl/protocol/detail/features.macro +++ b/include/xrpl/protocol/detail/features.macro @@ -16,7 +16,7 @@ // Add new amendments to the top of this list. // Keep it sorted in reverse chronological order. -XRPL_FIX (LendingProtocolV1_1, Supported::yes, VoteBehavior::DefaultNo) +XRPL_FEATURE(LendingProtocolV1_1, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (PermissionedDomainInvariant, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (ExpiredNFTokenOfferRemoval, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (BatchInnerSigs, Supported::no, VoteBehavior::DefaultNo) diff --git a/src/libxrpl/tx/transactors/vault/VaultDelete.cpp b/src/libxrpl/tx/transactors/vault/VaultDelete.cpp index d7cf9e8c60..88f91cd1bc 100644 --- a/src/libxrpl/tx/transactors/vault/VaultDelete.cpp +++ b/src/libxrpl/tx/transactors/vault/VaultDelete.cpp @@ -18,7 +18,7 @@ VaultDelete::preflight(PreflightContext const& ctx) return temMALFORMED; } - if (ctx.tx.isFieldPresent(sfMemoData) && !ctx.rules.enabled(fixLendingProtocolV1_1)) + if (ctx.tx.isFieldPresent(sfMemoData) && !ctx.rules.enabled(featureLendingProtocolV1_1)) return temDISABLED; // The sfMemoData field is an optional field used to record the deletion reason. diff --git a/src/test/app/LoanBroker_test.cpp b/src/test/app/LoanBroker_test.cpp index 4c108d9007..a2e7d4c84b 100644 --- a/src/test/app/LoanBroker_test.cpp +++ b/src/test/app/LoanBroker_test.cpp @@ -1788,20 +1788,20 @@ class LoanBroker_test : public beast::unit_test::suite } void - testFixAmendmentEnabled() + testFeatureLendingProtocolV1_1enabled() { using namespace jtx; - testcase("testFixAmendmentEnabled"); + testcase("featureLendingProtocolV1_1 enabled"); Env env{*this}; - BEAST_EXPECT(env.enabled(fixLendingProtocolV1_1)); + BEAST_EXPECT(env.enabled(featureLendingProtocolV1_1)); } public: void run() override { - testFixAmendmentEnabled(); + testFeatureLendingProtocolV1_1enabled(); testLoanBrokerSetDebtMaximum(); testLoanBrokerCoverDepositNullVault(); diff --git a/src/test/app/Vault_test.cpp b/src/test/app/Vault_test.cpp index fef16cad71..6e1ede00fb 100644 --- a/src/test/app/Vault_test.cpp +++ b/src/test/app/Vault_test.cpp @@ -5374,20 +5374,20 @@ class Vault_test : public beast::unit_test::suite auto const keylet = keylet::vault(owner.id(), 1); auto delTx = vault.del({.owner = owner, .id = keylet.key}); - // Test VaultDelete with fixLendingProtocolV1_1 disabled + // Test VaultDelete with featureLendingProtocolV1_1 disabled // Transaction fails if the data field is provided { - testcase("VaultDelete data fixLendingProtocolV1_1 disabled"); - env.disableFeature(fixLendingProtocolV1_1); + testcase("VaultDelete data featureLendingProtocolV1_1 disabled"); + env.disableFeature(featureLendingProtocolV1_1); delTx[sfMemoData] = strHex(std::string(maxDataPayloadLength, 'A')); env(delTx, ter(temDISABLED), THISLINE); env.close(); - env.enableFeature(fixLendingProtocolV1_1); + env.enableFeature(featureLendingProtocolV1_1); } // Transaction fails if the data field is too large { - testcase("VaultDelete data fixLendingProtocolV1_1 enabled data too large"); + testcase("VaultDelete data featureLendingProtocolV1_1 enabled data too large"); delTx[sfMemoData] = strHex(std::string(maxDataPayloadLength + 1, 'A')); env(delTx, ter(temMALFORMED), THISLINE); env.close(); @@ -5395,14 +5395,14 @@ class Vault_test : public beast::unit_test::suite // Transaction fails if the data field is set, but is empty { - testcase("VaultDelete data fixLendingProtocolV1_1 enabled data empty"); + testcase("VaultDelete data featureLendingProtocolV1_1 enabled data empty"); delTx[sfMemoData] = strHex(std::string(0, 'A')); env(delTx, ter(temMALFORMED), THISLINE); env.close(); } { - testcase("VaultDelete data fixLendingProtocolV1_1 enabled data valid"); + testcase("VaultDelete data featureLendingProtocolV1_1 enabled data valid"); PrettyAsset const xrpAsset = xrpIssue(); auto [tx, keylet] = vault.create({.owner = owner, .asset = xrpAsset}); env(tx, ter(tesSUCCESS), THISLINE);