xrpld
Loading...
Searching...
No Matches
LedgerFormats.cpp
1#include <xrpl/protocol/LedgerFormats.h>
2
3#include <xrpl/protocol/SField.h>
4#include <xrpl/protocol/SOTemplate.h>
5#include <xrpl/protocol/jss.h> // IWYU pragma: keep
6
7#include <vector>
8
9namespace xrpl {
10
11std::vector<SOElement> const&
13{
14 static auto const kCommonFields = std::vector<SOElement>{
15 {sfLedgerIndex, SoeOptional},
16 {sfLedgerEntryType, SoeRequired},
17 {sfFlags, SoeRequired},
18 };
19 return kCommonFields;
20}
21
23{
24#pragma push_macro("UNWRAP")
25#undef UNWRAP
26#pragma push_macro("LEDGER_ENTRY")
27#undef LEDGER_ENTRY
28
29#define UNWRAP(...) __VA_ARGS__
30#define LEDGER_ENTRY(tag, value, name, rpcName, fields) \
31 add(jss::name, tag, UNWRAP fields, getCommonFields());
32
33#include <xrpl/protocol/detail/ledger_entries.macro>
34
35#undef LEDGER_ENTRY
36#pragma pop_macro("LEDGER_ENTRY")
37#undef UNWRAP
38#pragma pop_macro("UNWRAP")
39}
40
41LedgerFormats const&
43{
44 static LedgerFormats const kInstance;
45 return kInstance;
46}
47
48} // namespace xrpl
Holds the list of known ledger entry formats.
static std::vector< SOElement > const & getCommonFields()
LedgerFormats()
Create the object.
static LedgerFormats const & getInstance()
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
@ SoeOptional
Definition SOTemplate.h:19
@ SoeRequired
Definition SOTemplate.h:18