rippled
Loading...
Searching...
No Matches
LedgerFormats.cpp
1#include <xrpl/protocol/LedgerFormats.h>
2#include <xrpl/protocol/SField.h>
3#include <xrpl/protocol/SOTemplate.h>
4#include <xrpl/protocol/jss.h>
5
6#include <vector>
7
8namespace xrpl {
9
12{
13 static auto const commonFields = std::vector<SOElement>{
14 {sfLedgerIndex, soeOPTIONAL},
15 {sfLedgerEntryType, soeREQUIRED},
16 {sfFlags, soeREQUIRED},
17 };
18 return commonFields;
19}
20
22{
23#pragma push_macro("UNWRAP")
24#undef UNWRAP
25#pragma push_macro("LEDGER_ENTRY")
26#undef LEDGER_ENTRY
27
28#define UNWRAP(...) __VA_ARGS__
29#define LEDGER_ENTRY(tag, value, name, rpcName, fields) \
30 add(jss::name, tag, UNWRAP fields, getCommonFields());
31
32#include <xrpl/protocol/detail/ledger_entries.macro>
33
34#undef LEDGER_ENTRY
35#pragma pop_macro("LEDGER_ENTRY")
36#undef UNWRAP
37#pragma pop_macro("UNWRAP")
38}
39
40LedgerFormats const&
42{
43 static LedgerFormats const instance;
44 return instance;
45}
46
47} // 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:17
@ soeREQUIRED
Definition SOTemplate.h:16