Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate definitions of fields, objects, transactions, and features #5122

Merged
merged 20 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 14 additions & 64 deletions include/xrpl/protocol/Feature.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,70 +308,20 @@ foreachFeature(FeatureBitset bs, F&& f)
f(bitsetIndexToFeature(i));
}

extern uint256 const featureOwnerPaysFee;
extern uint256 const featureFlow;
extern uint256 const featureFlowCross;
extern uint256 const featureCryptoConditionsSuite;
extern uint256 const fix1513;
extern uint256 const featureDepositAuth;
extern uint256 const featureChecks;
extern uint256 const fix1571;
extern uint256 const fix1543;
extern uint256 const fix1623;
extern uint256 const featureDepositPreauth;
extern uint256 const fix1515;
extern uint256 const fix1578;
extern uint256 const featureMultiSignReserve;
extern uint256 const fixTakerDryOfferRemoval;
extern uint256 const fixMasterKeyAsRegularKey;
extern uint256 const fixCheckThreading;
extern uint256 const fixPayChanRecipientOwnerDir;
extern uint256 const featureDeletableAccounts;
extern uint256 const fixQualityUpperBound;
extern uint256 const featureRequireFullyCanonicalSig;
extern uint256 const fix1781;
extern uint256 const featureHardenedValidations;
extern uint256 const fixAmendmentMajorityCalc;
extern uint256 const featureNegativeUNL;
extern uint256 const featureTicketBatch;
extern uint256 const featureFlowSortStrands;
extern uint256 const fixSTAmountCanonicalize;
extern uint256 const fixRmSmallIncreasedQOffers;
extern uint256 const featureCheckCashMakesTrustLine;
extern uint256 const featureNonFungibleTokensV1;
extern uint256 const featureExpandedSignerList;
extern uint256 const fixNFTokenDirV1;
extern uint256 const fixNFTokenNegOffer;
extern uint256 const featureNonFungibleTokensV1_1;
extern uint256 const fixTrustLinesToSelf;
extern uint256 const fixRemoveNFTokenAutoTrustLine;
extern uint256 const featureImmediateOfferKilled;
extern uint256 const featureDisallowIncoming;
extern uint256 const featureXRPFees;
extern uint256 const featureAMM;
extern uint256 const fixUniversalNumber;
extern uint256 const fixNonFungibleTokensV1_2;
extern uint256 const fixNFTokenRemint;
extern uint256 const fixReducedOffersV1;
extern uint256 const featureClawback;
extern uint256 const featureXChainBridge;
extern uint256 const fixDisallowIncomingV1;
extern uint256 const featureDID;
extern uint256 const fixFillOrKill;
extern uint256 const fixNFTokenReserve;
extern uint256 const fixInnerObjTemplate;
extern uint256 const fixAMMOverflowOffer;
extern uint256 const featurePriceOracle;
extern uint256 const fixEmptyDID;
extern uint256 const fixXChainRewardRounding;
extern uint256 const fixPreviousTxnID;
extern uint256 const fixAMMv1_1;
extern uint256 const featureNFTokenMintOffer;
extern uint256 const fixReducedOffersV2;
extern uint256 const fixEnforceNFTokenTrustline;
extern uint256 const fixInnerObjTemplate2;
extern uint256 const featureInvariantsV1_1;
extern uint256 const fixNFTokenPageLinks;
#pragma push_macro("XRPL_FEATURE")
#undef XRPL_FEATURE
#pragma push_macro("XRPL_FIX")
#undef XRPL_FIX

#define XRPL_FEATURE(name, supported, vote) extern uint256 const feature##name;
#define XRPL_FIX(name, supported, vote) extern uint256 const fix##name;

#include <xrpl/protocol/detail/features.h>

#undef XRPL_FIX
#pragma pop_macro("XRPL_FIX")
#undef XRPL_FEATURE
#pragma pop_macro("XRPL_FEATURE")

} // namespace ripple

Expand Down
146 changes: 6 additions & 140 deletions include/xrpl/protocol/LedgerFormats.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,150 +52,16 @@ namespace ripple {
// clang-format off
enum LedgerEntryType : std::uint16_t
{
/** A ledger object which describes an account.

\sa keylet::account
*/
ltACCOUNT_ROOT = 0x0061,

/** A ledger object which contains a list of object identifiers.

\sa keylet::page, keylet::quality, keylet::book, keylet::next and
keylet::ownerDir
*/
ltDIR_NODE = 0x0064,

/** A ledger object which describes a bidirectional trust line.

@note Per Vinnie Falco this should be renamed to ltTRUST_LINE

\sa keylet::line
*/
ltRIPPLE_STATE = 0x0072,

/** A ledger object which describes a ticket.

\sa keylet::ticket
*/
ltTICKET = 0x0054,

/** A ledger object which contains a signer list for an account.

\sa keylet::signers
*/
ltSIGNER_LIST = 0x0053,

/** A ledger object which describes an offer on the DEX.

\sa keylet::offer
*/
ltOFFER = 0x006f,


/** The ledger object which lists details about sidechains.

\sa keylet::bridge
*/
ltBRIDGE = 0x0069,

/** A ledger object that contains a list of ledger hashes.

This type is used to store the ledger hashes which the protocol uses
to implement skip lists that allow for efficient backwards (and, in
theory, forward) forward iteration across large ledger ranges.

\sa keylet::skip
*/
ltLEDGER_HASHES = 0x0068,

/** The ledger object which lists details about amendments on the network.

\note This is a singleton: only one such object exists in the ledger.

\sa keylet::amendments
*/
ltAMENDMENTS = 0x0066,

/** A claim id for a cross chain transaction.

\sa keylet::xChainClaimID
*/
ltXCHAIN_OWNED_CLAIM_ID = 0x0071,

/** A claim id for a cross chain create account transaction.
#pragma push_macro("OBJECT")
#undef OBJECT

\sa keylet::xChainCreateAccountClaimID
*/
ltXCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID = 0x0074,

/** The ledger object which lists the network's fee settings.

\note This is a singleton: only one such object exists in the ledger.

\sa keylet::fees
*/
ltFEE_SETTINGS = 0x0073,

/** A ledger object describing a single escrow.

\sa keylet::escrow
*/
ltESCROW = 0x0075,

/** A ledger object describing a single unidirectional XRP payment channel.

\sa keylet::payChan
*/
ltPAYCHAN = 0x0078,

/** A ledger object which describes a check.

\sa keylet::check
*/
ltCHECK = 0x0043,

/** A ledger object which describes a deposit preauthorization.

\sa keylet::depositPreauth
*/
ltDEPOSIT_PREAUTH = 0x0070,
#define OBJECT(tag, value, name, fields) tag = value,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, please follow the same style as in Feature.h (vertical spacing)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would LEDGER_ENTRY be a more specific name for the macro? OBJECT seems very general and suggests it can be used elsewhere.


/** The ledger object which tracks the current negative UNL state.
#include <xrpl/protocol/detail/objects.h>

\note This is a singleton: only one such object exists in the ledger.

\sa keylet::negativeUNL
*/
ltNEGATIVE_UNL = 0x004e,

/** A ledger object which contains a list of NFTs

\sa keylet::nftpage_min, keylet::nftpage_max, keylet::nftpage
*/
ltNFTOKEN_PAGE = 0x0050,

/** A ledger object which identifies an offer to buy or sell an NFT.

\sa keylet::nftoffer
*/
ltNFTOKEN_OFFER = 0x0037,

/** The ledger object which tracks the AMM.

\sa keylet::amm
*/
ltAMM = 0x0079,

/** The ledger object which tracks the DID.

\sa keylet::did
*/
ltDID = 0x0049,

/** A ledger object which tracks Oracle
\sa keylet::oracle
*/
ltORACLE = 0x0080,
#undef OBJECT
#pragma pop_macro("OBJECT")

//---------------------------------------------------------------------------
/** A special type, matching any ledger entry type.
Expand Down
Loading
Loading