Combine fixInnerObjTemplate Amendments (#524)

This commit is contained in:
tequ
2025-06-30 18:14:04 +09:00
committed by GitHub
parent 51aae2ce36
commit d4fd40c471
4 changed files with 6 additions and 10 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 = 109;
static constexpr std::size_t numFeatures = 108;
/** Amendments that this server supports and the default voting behavior.
Whether they are enabled depends on the Rules defined in the validated

View File

@@ -41,7 +41,6 @@ XRPL_FEATURE(MPTokensV1, Supported::yes, VoteBehavior::DefaultNo
// invariants expected to be included under it are complete.
XRPL_FEATURE(InvariantsV1_1, Supported::no, VoteBehavior::DefaultNo)
XRPL_FIX (NFTokenPageLinks, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (InnerObjTemplate2, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (EnforceNFTokenTrustline, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FIX (ReducedOffersV2, Supported::yes, VoteBehavior::DefaultNo)
XRPL_FEATURE(NFTokenMintOffer, Supported::yes, VoteBehavior::DefaultNo)

View File

@@ -69,12 +69,9 @@ STObject::makeInnerObject(SField const& name)
// The if is complicated because inner object templates were added in
// two phases:
// 1. If there are no available Rules, then always apply the template.
// 2. fixInnerObjTemplate added templates to two AMM inner objects.
// 3. fixInnerObjTemplate2 added templates to all remaining inner objects.
// 2. fixInnerObjTemplate added templates to all inner objects.
std::optional<Rules> const& rules = getCurrentTransactionRules();
bool const isAMMObj = name == sfAuctionSlot || name == sfVoteEntry;
if (!rules || (rules->enabled(fixInnerObjTemplate) && isAMMObj) ||
(rules->enabled(fixInnerObjTemplate2) && !isAMMObj))
if (!rules || rules->enabled(fixInnerObjTemplate))
{
if (SOTemplate const* elements =
InnerObjectFormats::getInstance().findSOTemplateBySField(name))

View File

@@ -304,10 +304,10 @@ public:
// Put a bunch of different LedgerEntryTypes into a ledger
using namespace test::jtx;
// Make sure fixInnerObjTemplate2 doesn't break amendments.
// Make sure fixInnerObjTemplate doesn't break amendments.
for (FeatureBitset const& features :
{supported_amendments() - fixInnerObjTemplate2,
supported_amendments() | fixInnerObjTemplate2})
{supported_amendments() - fixInnerObjTemplate,
supported_amendments() | fixInnerObjTemplate})
{
using namespace std::chrono;