mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-29 23:15:49 +00:00
Combine fixInnerObjTemplate Amendments (#524)
This commit is contained in:
@@ -80,7 +80,7 @@ namespace detail {
|
|||||||
// Feature.cpp. Because it's only used to reserve storage, and determine how
|
// 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
|
// 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.
|
// 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.
|
/** Amendments that this server supports and the default voting behavior.
|
||||||
Whether they are enabled depends on the Rules defined in the validated
|
Whether they are enabled depends on the Rules defined in the validated
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ XRPL_FEATURE(MPTokensV1, Supported::yes, VoteBehavior::DefaultNo
|
|||||||
// invariants expected to be included under it are complete.
|
// invariants expected to be included under it are complete.
|
||||||
XRPL_FEATURE(InvariantsV1_1, Supported::no, VoteBehavior::DefaultNo)
|
XRPL_FEATURE(InvariantsV1_1, Supported::no, VoteBehavior::DefaultNo)
|
||||||
XRPL_FIX (NFTokenPageLinks, Supported::yes, 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 (EnforceNFTokenTrustline, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FIX (ReducedOffersV2, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FIX (ReducedOffersV2, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
XRPL_FEATURE(NFTokenMintOffer, Supported::yes, VoteBehavior::DefaultNo)
|
XRPL_FEATURE(NFTokenMintOffer, Supported::yes, VoteBehavior::DefaultNo)
|
||||||
|
|||||||
@@ -69,12 +69,9 @@ STObject::makeInnerObject(SField const& name)
|
|||||||
// The if is complicated because inner object templates were added in
|
// The if is complicated because inner object templates were added in
|
||||||
// two phases:
|
// two phases:
|
||||||
// 1. If there are no available Rules, then always apply the template.
|
// 1. If there are no available Rules, then always apply the template.
|
||||||
// 2. fixInnerObjTemplate added templates to two AMM inner objects.
|
// 2. fixInnerObjTemplate added templates to all inner objects.
|
||||||
// 3. fixInnerObjTemplate2 added templates to all remaining inner objects.
|
|
||||||
std::optional<Rules> const& rules = getCurrentTransactionRules();
|
std::optional<Rules> const& rules = getCurrentTransactionRules();
|
||||||
bool const isAMMObj = name == sfAuctionSlot || name == sfVoteEntry;
|
if (!rules || rules->enabled(fixInnerObjTemplate))
|
||||||
if (!rules || (rules->enabled(fixInnerObjTemplate) && isAMMObj) ||
|
|
||||||
(rules->enabled(fixInnerObjTemplate2) && !isAMMObj))
|
|
||||||
{
|
{
|
||||||
if (SOTemplate const* elements =
|
if (SOTemplate const* elements =
|
||||||
InnerObjectFormats::getInstance().findSOTemplateBySField(name))
|
InnerObjectFormats::getInstance().findSOTemplateBySField(name))
|
||||||
|
|||||||
@@ -304,10 +304,10 @@ public:
|
|||||||
// Put a bunch of different LedgerEntryTypes into a ledger
|
// Put a bunch of different LedgerEntryTypes into a ledger
|
||||||
using namespace test::jtx;
|
using namespace test::jtx;
|
||||||
|
|
||||||
// Make sure fixInnerObjTemplate2 doesn't break amendments.
|
// Make sure fixInnerObjTemplate doesn't break amendments.
|
||||||
for (FeatureBitset const& features :
|
for (FeatureBitset const& features :
|
||||||
{supported_amendments() - fixInnerObjTemplate2,
|
{supported_amendments() - fixInnerObjTemplate,
|
||||||
supported_amendments() | fixInnerObjTemplate2})
|
supported_amendments() | fixInnerObjTemplate})
|
||||||
{
|
{
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user