xrpld
Loading...
Searching...
No Matches
TxFormats.cpp
1#include <xrpl/protocol/TxFormats.h>
2
3#include <xrpl/protocol/Feature.h> // IWYU pragma: keep
4#include <xrpl/protocol/SField.h>
5#include <xrpl/protocol/SOTemplate.h>
6#include <xrpl/protocol/jss.h> // IWYU pragma: keep
7
8#include <vector>
9
10namespace xrpl {
11
12std::vector<SOElement> const&
14{
15 static auto const kCommonFields = std::vector<SOElement>{
16 {sfTransactionType, SoeRequired},
17 {sfFlags, SoeOptional},
18 {sfSourceTag, SoeOptional},
19 {sfAccount, SoeRequired},
20 {sfSequence, SoeRequired},
21 {sfPreviousTxnID, SoeOptional}, // emulate027
22 {sfLastLedgerSequence, SoeOptional},
23 {sfAccountTxnID, SoeOptional},
24 {sfFee, SoeRequired},
25 {sfOperationLimit, SoeOptional},
26 {sfMemos, SoeOptional},
27 {sfSigningPubKey, SoeRequired},
28 {sfTicketSequence, SoeOptional},
29 {sfTxnSignature, SoeOptional},
30 {sfSigners, SoeOptional}, // submit_multisigned
31 {sfNetworkID, SoeOptional},
32 {sfDelegate, SoeOptional},
33 };
34 return kCommonFields;
35}
36
38{
39#pragma push_macro("UNWRAP")
40#undef UNWRAP
41#pragma push_macro("TRANSACTION")
42#undef TRANSACTION
43
44#define UNWRAP(...) __VA_ARGS__
45#define TRANSACTION(tag, value, name, delegable, amendment, privileges, fields) \
46 add(jss::name, tag, UNWRAP fields, getCommonFields());
47
48#include <xrpl/protocol/detail/transactions.macro>
49
50#undef TRANSACTION
51#pragma pop_macro("TRANSACTION")
52#undef UNWRAP
53#pragma pop_macro("UNWRAP")
54}
55
56TxFormats const&
58{
59 static TxFormats const kInstance;
60 return kInstance;
61}
62
63} // namespace xrpl
Manages the list of known transaction formats.
Definition TxFormats.h:70
TxFormats()
Create the object.
Definition TxFormats.cpp:37
static std::vector< SOElement > const & getCommonFields()
Definition TxFormats.cpp:13
static TxFormats const & getInstance()
Definition TxFormats.cpp:57
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