Combine DID Amendments (#522)

fixEmptyDID -> featureDID
This commit is contained in:
tequ
2026-02-20 04:05:21 +09:00
parent 96e3851c51
commit 293266519d
4 changed files with 4 additions and 17 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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);
}
};

View File

@@ -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))
{