rippled
Loading...
Searching...
No Matches
TxFormats.cpp
1#include <xrpl/protocol/SField.h>
2#include <xrpl/protocol/SOTemplate.h>
3#include <xrpl/protocol/TxFormats.h>
4#include <xrpl/protocol/jss.h>
5
6#include <initializer_list>
7
8namespace ripple {
9
11{
12 // Fields shared by all txFormats:
13 static std::initializer_list<SOElement> const commonFields{
14 {sfTransactionType, soeREQUIRED},
15 {sfFlags, soeOPTIONAL},
16 {sfSourceTag, soeOPTIONAL},
17 {sfAccount, soeREQUIRED},
18 {sfSequence, soeREQUIRED},
19 {sfPreviousTxnID, soeOPTIONAL}, // emulate027
20 {sfLastLedgerSequence, soeOPTIONAL},
21 {sfAccountTxnID, soeOPTIONAL},
22 {sfFee, soeREQUIRED},
23 {sfOperationLimit, soeOPTIONAL},
24 {sfMemos, soeOPTIONAL},
25 {sfSigningPubKey, soeREQUIRED},
26 {sfTicketSequence, soeOPTIONAL},
27 {sfTxnSignature, soeOPTIONAL},
28 {sfSigners, soeOPTIONAL}, // submit_multisigned
29 {sfNetworkID, soeOPTIONAL},
30 {sfDelegate, soeOPTIONAL},
31 };
32
33#pragma push_macro("UNWRAP")
34#undef UNWRAP
35#pragma push_macro("TRANSACTION")
36#undef TRANSACTION
37
38#define UNWRAP(...) __VA_ARGS__
39#define TRANSACTION( \
40 tag, value, name, delegatable, amendment, privileges, fields) \
41 add(jss::name, tag, UNWRAP fields, commonFields);
42
43#include <xrpl/protocol/detail/transactions.macro>
44
45#undef TRANSACTION
46#pragma pop_macro("TRANSACTION")
47#undef UNWRAP
48#pragma pop_macro("UNWRAP")
49}
50
51TxFormats const&
53{
54 static TxFormats const instance;
55 return instance;
56}
57
58} // namespace ripple
Manages the list of known transaction formats.
Definition TxFormats.h:67
static TxFormats const & getInstance()
Definition TxFormats.cpp:52
TxFormats()
Create the object.
Definition TxFormats.cpp:10
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
@ soeOPTIONAL
Definition SOTemplate.h:17
@ soeREQUIRED
Definition SOTemplate.h:16