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 {sfSponsor, SoeOptional},
34 {sfSponsorFlags, SoeOptional},
35 {sfSponsorSignature, SoeOptional},
36 };
37 return kCommonFields;
38}
39
41{
42#pragma push_macro("UNWRAP")
43#undef UNWRAP
44#pragma push_macro("TRANSACTION")
45#undef TRANSACTION
46
47#define UNWRAP(...) __VA_ARGS__
48#define TRANSACTION(tag, value, name, delegable, amendment, privileges, fields) \
49 add(jss::name, tag, UNWRAP fields, getCommonFields());
50
51#include <xrpl/protocol/detail/transactions.macro>
52
53#undef TRANSACTION
54#pragma pop_macro("TRANSACTION")
55#undef UNWRAP
56#pragma pop_macro("UNWRAP")
57}
58
59TxFormats const&
61{
62 static TxFormats const kInstance;
63 return kInstance;
64}
65
66} // namespace xrpl
Manages the list of known transaction formats.
Definition TxFormats.h:83
TxFormats()
Create the object.
Definition TxFormats.cpp:40
static std::vector< SOElement > const & getCommonFields()
Definition TxFormats.cpp:13
static TxFormats const & getInstance()
Definition TxFormats.cpp:60
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
@ SoeOptional
Definition SOTemplate.h:23
@ SoeRequired
Definition SOTemplate.h:22