From 293266519d1706caaa896b210ebf9497fe86eaaf Mon Sep 17 00:00:00 2001 From: tequ Date: Fri, 20 Feb 2026 04:05:21 +0900 Subject: [PATCH] Combine DID Amendments (#522) fixEmptyDID -> featureDID --- include/xrpl/protocol/Feature.h | 2 +- include/xrpl/protocol/detail/features.macro | 1 - src/test/app/DID_test.cpp | 15 ++------------- src/xrpld/app/tx/detail/DID.cpp | 3 +-- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/include/xrpl/protocol/Feature.h b/include/xrpl/protocol/Feature.h index 31dbdaeba..46e4c3556 100644 --- a/include/xrpl/protocol/Feature.h +++ b/include/xrpl/protocol/Feature.h @@ -80,7 +80,7 @@ namespace detail { // Feature.cpp. Because it's only used to reserve storage, and determine how // large to make the FeatureBitset, it MAY be larger. It MUST NOT be less than // the actual number of amendments. A LogicError on startup will verify this. -static constexpr std::size_t numFeatures = 119; +static constexpr std::size_t numFeatures = 118; /** Amendments that this server supports and the default voting behavior. Whether they are enabled depends on the Rules defined in the validated diff --git a/include/xrpl/protocol/detail/features.macro b/include/xrpl/protocol/detail/features.macro index d5581faaa..0c6c227e5 100644 --- a/include/xrpl/protocol/detail/features.macro +++ b/include/xrpl/protocol/detail/features.macro @@ -47,7 +47,6 @@ XRPL_FEATURE(NFTokenMintOffer, Supported::yes, VoteBehavior::DefaultNo XRPL_FIX (AMMv1_1, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (PreviousTxnID, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (XChainRewardRounding, Supported::yes, VoteBehavior::DefaultNo) -XRPL_FIX (EmptyDID, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(PriceOracle, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (AMMOverflowOffer, Supported::yes, VoteBehavior::DefaultYes) XRPL_FIX (InnerObjTemplate, Supported::yes, VoteBehavior::DefaultNo) diff --git a/src/test/app/DID_test.cpp b/src/test/app/DID_test.cpp index 3f9cce1d3..518f54e84 100644 --- a/src/test/app/DID_test.cpp +++ b/src/test/app/DID_test.cpp @@ -168,13 +168,9 @@ struct DID_test : public beast::unit_test::suite BEAST_EXPECT(ownerCount(env, alice) == 0); // some empty fields, some optional fields - // pre-fix amendment - auto const fixEnabled = env.current()->rules().enabled(fixEmptyDID); - env(did::set(alice), - did::uri(""), - fixEnabled ? ter(tecEMPTY_DID) : ter(tesSUCCESS)); + env(did::set(alice), did::uri(""), ter(tecEMPTY_DID)); env.close(); - auto const expectedOwnerReserve = fixEnabled ? 0 : 1; + auto const expectedOwnerReserve = 0; BEAST_EXPECT(ownerCount(env, alice) == expectedOwnerReserve); // Modifying a DID to become empty is checked in testSetModify @@ -391,18 +387,11 @@ struct DID_test : public beast::unit_test::suite { using namespace test::jtx; FeatureBitset const all{supported_amendments()}; - FeatureBitset const emptyDID{fixEmptyDID}; testEnabled(all); testAccountReserve(all); testSetInvalid(all); testDeleteInvalid(all); testSetModify(all); - - testEnabled(all - emptyDID); - testAccountReserve(all - emptyDID); - testSetInvalid(all - emptyDID); - testDeleteInvalid(all - emptyDID); - testSetModify(all - emptyDID); } }; diff --git a/src/xrpld/app/tx/detail/DID.cpp b/src/xrpld/app/tx/detail/DID.cpp index 6e5a3108c..ff3a34d3d 100644 --- a/src/xrpld/app/tx/detail/DID.cpp +++ b/src/xrpld/app/tx/detail/DID.cpp @@ -161,8 +161,7 @@ DIDSet::doApply() set(sfURI); set(sfDIDDocument); set(sfData); - if (ctx_.view().rules().enabled(fixEmptyDID) && - !sleDID->isFieldPresent(sfURI) && + if (!sleDID->isFieldPresent(sfURI) && !sleDID->isFieldPresent(sfDIDDocument) && !sleDID->isFieldPresent(sfData)) {