Skip to content

Commit 63209c2

Browse files
Consolidate definitions of fields, objects, transactions, and features (#5122)
1 parent f0dabd1 commit 63209c2

30 files changed

+1466
-2089
lines changed

include/xrpl/protocol/Feature.h

+14-64
Original file line numberDiff line numberDiff line change
@@ -308,70 +308,20 @@ foreachFeature(FeatureBitset bs, F&& f)
308308
f(bitsetIndexToFeature(i));
309309
}
310310

311-
extern uint256 const featureOwnerPaysFee;
312-
extern uint256 const featureFlow;
313-
extern uint256 const featureFlowCross;
314-
extern uint256 const featureCryptoConditionsSuite;
315-
extern uint256 const fix1513;
316-
extern uint256 const featureDepositAuth;
317-
extern uint256 const featureChecks;
318-
extern uint256 const fix1571;
319-
extern uint256 const fix1543;
320-
extern uint256 const fix1623;
321-
extern uint256 const featureDepositPreauth;
322-
extern uint256 const fix1515;
323-
extern uint256 const fix1578;
324-
extern uint256 const featureMultiSignReserve;
325-
extern uint256 const fixTakerDryOfferRemoval;
326-
extern uint256 const fixMasterKeyAsRegularKey;
327-
extern uint256 const fixCheckThreading;
328-
extern uint256 const fixPayChanRecipientOwnerDir;
329-
extern uint256 const featureDeletableAccounts;
330-
extern uint256 const fixQualityUpperBound;
331-
extern uint256 const featureRequireFullyCanonicalSig;
332-
extern uint256 const fix1781;
333-
extern uint256 const featureHardenedValidations;
334-
extern uint256 const fixAmendmentMajorityCalc;
335-
extern uint256 const featureNegativeUNL;
336-
extern uint256 const featureTicketBatch;
337-
extern uint256 const featureFlowSortStrands;
338-
extern uint256 const fixSTAmountCanonicalize;
339-
extern uint256 const fixRmSmallIncreasedQOffers;
340-
extern uint256 const featureCheckCashMakesTrustLine;
341-
extern uint256 const featureNonFungibleTokensV1;
342-
extern uint256 const featureExpandedSignerList;
343-
extern uint256 const fixNFTokenDirV1;
344-
extern uint256 const fixNFTokenNegOffer;
345-
extern uint256 const featureNonFungibleTokensV1_1;
346-
extern uint256 const fixTrustLinesToSelf;
347-
extern uint256 const fixRemoveNFTokenAutoTrustLine;
348-
extern uint256 const featureImmediateOfferKilled;
349-
extern uint256 const featureDisallowIncoming;
350-
extern uint256 const featureXRPFees;
351-
extern uint256 const featureAMM;
352-
extern uint256 const fixUniversalNumber;
353-
extern uint256 const fixNonFungibleTokensV1_2;
354-
extern uint256 const fixNFTokenRemint;
355-
extern uint256 const fixReducedOffersV1;
356-
extern uint256 const featureClawback;
357-
extern uint256 const featureXChainBridge;
358-
extern uint256 const fixDisallowIncomingV1;
359-
extern uint256 const featureDID;
360-
extern uint256 const fixFillOrKill;
361-
extern uint256 const fixNFTokenReserve;
362-
extern uint256 const fixInnerObjTemplate;
363-
extern uint256 const fixAMMOverflowOffer;
364-
extern uint256 const featurePriceOracle;
365-
extern uint256 const fixEmptyDID;
366-
extern uint256 const fixXChainRewardRounding;
367-
extern uint256 const fixPreviousTxnID;
368-
extern uint256 const fixAMMv1_1;
369-
extern uint256 const featureNFTokenMintOffer;
370-
extern uint256 const fixReducedOffersV2;
371-
extern uint256 const fixEnforceNFTokenTrustline;
372-
extern uint256 const fixInnerObjTemplate2;
373-
extern uint256 const featureInvariantsV1_1;
374-
extern uint256 const fixNFTokenPageLinks;
311+
#pragma push_macro("XRPL_FEATURE")
312+
#undef XRPL_FEATURE
313+
#pragma push_macro("XRPL_FIX")
314+
#undef XRPL_FIX
315+
316+
#define XRPL_FEATURE(name, supported, vote) extern uint256 const feature##name;
317+
#define XRPL_FIX(name, supported, vote) extern uint256 const fix##name;
318+
319+
#include <xrpl/protocol/detail/features.macro>
320+
321+
#undef XRPL_FIX
322+
#pragma pop_macro("XRPL_FIX")
323+
#undef XRPL_FEATURE
324+
#pragma pop_macro("XRPL_FEATURE")
375325

376326
} // namespace ripple
377327

include/xrpl/protocol/LedgerFormats.h

+6-140
Original file line numberDiff line numberDiff line change
@@ -52,150 +52,16 @@ namespace ripple {
5252
// clang-format off
5353
enum LedgerEntryType : std::uint16_t
5454
{
55-
/** A ledger object which describes an account.
5655

57-
\sa keylet::account
58-
*/
59-
ltACCOUNT_ROOT = 0x0061,
60-
61-
/** A ledger object which contains a list of object identifiers.
62-
63-
\sa keylet::page, keylet::quality, keylet::book, keylet::next and
64-
keylet::ownerDir
65-
*/
66-
ltDIR_NODE = 0x0064,
67-
68-
/** A ledger object which describes a bidirectional trust line.
69-
70-
@note Per Vinnie Falco this should be renamed to ltTRUST_LINE
71-
72-
\sa keylet::line
73-
*/
74-
ltRIPPLE_STATE = 0x0072,
75-
76-
/** A ledger object which describes a ticket.
77-
78-
\sa keylet::ticket
79-
*/
80-
ltTICKET = 0x0054,
81-
82-
/** A ledger object which contains a signer list for an account.
83-
84-
\sa keylet::signers
85-
*/
86-
ltSIGNER_LIST = 0x0053,
87-
88-
/** A ledger object which describes an offer on the DEX.
89-
90-
\sa keylet::offer
91-
*/
92-
ltOFFER = 0x006f,
93-
94-
95-
/** The ledger object which lists details about sidechains.
96-
97-
\sa keylet::bridge
98-
*/
99-
ltBRIDGE = 0x0069,
100-
101-
/** A ledger object that contains a list of ledger hashes.
102-
103-
This type is used to store the ledger hashes which the protocol uses
104-
to implement skip lists that allow for efficient backwards (and, in
105-
theory, forward) forward iteration across large ledger ranges.
106-
107-
\sa keylet::skip
108-
*/
109-
ltLEDGER_HASHES = 0x0068,
110-
111-
/** The ledger object which lists details about amendments on the network.
112-
113-
\note This is a singleton: only one such object exists in the ledger.
114-
115-
\sa keylet::amendments
116-
*/
117-
ltAMENDMENTS = 0x0066,
118-
119-
/** A claim id for a cross chain transaction.
120-
121-
\sa keylet::xChainClaimID
122-
*/
123-
ltXCHAIN_OWNED_CLAIM_ID = 0x0071,
124-
125-
/** A claim id for a cross chain create account transaction.
56+
#pragma push_macro("LEDGER_ENTRY")
57+
#undef LEDGER_ENTRY
12658

127-
\sa keylet::xChainCreateAccountClaimID
128-
*/
129-
ltXCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID = 0x0074,
130-
131-
/** The ledger object which lists the network's fee settings.
132-
133-
\note This is a singleton: only one such object exists in the ledger.
134-
135-
\sa keylet::fees
136-
*/
137-
ltFEE_SETTINGS = 0x0073,
138-
139-
/** A ledger object describing a single escrow.
140-
141-
\sa keylet::escrow
142-
*/
143-
ltESCROW = 0x0075,
144-
145-
/** A ledger object describing a single unidirectional XRP payment channel.
146-
147-
\sa keylet::payChan
148-
*/
149-
ltPAYCHAN = 0x0078,
150-
151-
/** A ledger object which describes a check.
152-
153-
\sa keylet::check
154-
*/
155-
ltCHECK = 0x0043,
156-
157-
/** A ledger object which describes a deposit preauthorization.
158-
159-
\sa keylet::depositPreauth
160-
*/
161-
ltDEPOSIT_PREAUTH = 0x0070,
59+
#define LEDGER_ENTRY(tag, value, name, fields) tag = value,
16260

163-
/** The ledger object which tracks the current negative UNL state.
61+
#include <xrpl/protocol/detail/ledger_entries.macro>
16462

165-
\note This is a singleton: only one such object exists in the ledger.
166-
167-
\sa keylet::negativeUNL
168-
*/
169-
ltNEGATIVE_UNL = 0x004e,
170-
171-
/** A ledger object which contains a list of NFTs
172-
173-
\sa keylet::nftpage_min, keylet::nftpage_max, keylet::nftpage
174-
*/
175-
ltNFTOKEN_PAGE = 0x0050,
176-
177-
/** A ledger object which identifies an offer to buy or sell an NFT.
178-
179-
\sa keylet::nftoffer
180-
*/
181-
ltNFTOKEN_OFFER = 0x0037,
182-
183-
/** The ledger object which tracks the AMM.
184-
185-
\sa keylet::amm
186-
*/
187-
ltAMM = 0x0079,
188-
189-
/** The ledger object which tracks the DID.
190-
191-
\sa keylet::did
192-
*/
193-
ltDID = 0x0049,
194-
195-
/** A ledger object which tracks Oracle
196-
\sa keylet::oracle
197-
*/
198-
ltORACLE = 0x0080,
63+
#undef LEDGER_ENTRY
64+
#pragma pop_macro("LEDGER_ENTRY")
19965

20066
//---------------------------------------------------------------------------
20167
/** A special type, matching any ledger entry type.

0 commit comments

Comments
 (0)