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 <vector>
7
8namespace xrpl {
9
12{
13 static auto const commonFields = std::vector<SOElement>{
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 return commonFields;
33}
34
36{
37#pragma push_macro("UNWRAP")
38#undef UNWRAP
39#pragma push_macro("TRANSACTION")
40#undef TRANSACTION
41
42#define UNWRAP(...) __VA_ARGS__
43#define TRANSACTION(tag, value, name, delegable, amendment, privileges, fields) \
44 add(jss::name, tag, UNWRAP fields, getCommonFields());
45
46#include <xrpl/protocol/detail/transactions.macro>
47
48#undef TRANSACTION
49#pragma pop_macro("TRANSACTION")
50#undef UNWRAP
51#pragma pop_macro("UNWRAP")
52}
53
54TxFormats const&
56{
57 static TxFormats const instance;
58 return instance;
59}
60
61} // namespace xrpl
Manages the list of known transaction formats.
Definition TxFormats.h:68
TxFormats()
Create the object.
Definition TxFormats.cpp:35
static std::vector< SOElement > const & getCommonFields()
Definition TxFormats.cpp:11
static TxFormats const & getInstance()
Definition TxFormats.cpp:55
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