Skip to content

Commit

Permalink
Merge branch 'develop' into fixPayChanV1
Browse files Browse the repository at this point in the history
  • Loading branch information
dangell7 authored Oct 5, 2023
2 parents cb7e575 + 4e84ad6 commit 4db1218
Showing 1 changed file with 19 additions and 35 deletions.
54 changes: 19 additions & 35 deletions src/ripple/protocol/impl/TxFormats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,42 +27,26 @@ namespace ripple {

TxFormats::TxFormats()
{
#pragma push_macro("PSEUDO_TXN_COMMON_FIELDS")

// clang-format off

#define PSEUDO_TXN_COMMON_FIELDS \
{sfTransactionType, soeREQUIRED}, \
{sfFlags, soeOPTIONAL}, \
{sfSourceTag, soeOPTIONAL}, \
{sfAccount, soeREQUIRED}, \
{sfSequence, soeREQUIRED}, \
{sfPreviousTxnID, soeOPTIONAL}, /* emulate027 */ \
{sfLastLedgerSequence, soeOPTIONAL}, \
{sfAccountTxnID, soeOPTIONAL}, \
{sfFee, soeREQUIRED}, \
{sfOperationLimit, soeOPTIONAL}, \
{sfMemos, soeOPTIONAL}, \
{sfSigningPubKey, soeREQUIRED}, \
{sfTxnSignature, soeOPTIONAL}, \
{sfSigners, soeOPTIONAL}, /* submit_multisigned */ \
{sfNetworkID, soeOPTIONAL}

// clang-format on

// Fields shared by all pseudo-transaction txFormats:
static const std::initializer_list<SOElement> pseudoCommonFields{
PSEUDO_TXN_COMMON_FIELDS,
};

// Fields shared by all normal transaction txFormats:
// Fields shared by all txFormats:
static const std::initializer_list<SOElement> commonFields{
PSEUDO_TXN_COMMON_FIELDS,
{sfTransactionType, soeREQUIRED},
{sfFlags, soeOPTIONAL},
{sfSourceTag, soeOPTIONAL},
{sfAccount, soeREQUIRED},
{sfSequence, soeREQUIRED},
{sfPreviousTxnID, soeOPTIONAL}, // emulate027
{sfLastLedgerSequence, soeOPTIONAL},
{sfAccountTxnID, soeOPTIONAL},
{sfFee, soeREQUIRED},
{sfOperationLimit, soeOPTIONAL},
{sfMemos, soeOPTIONAL},
{sfSigningPubKey, soeREQUIRED},
{sfTicketSequence, soeOPTIONAL},
{sfTxnSignature, soeOPTIONAL},
{sfSigners, soeOPTIONAL}, // submit_multisigned
{sfNetworkID, soeOPTIONAL},
};

#pragma pop_macro("PSEUDO_TXN_COMMON_FIELDS")

add(jss::AccountSet,
ttACCOUNT_SET,
{
Expand Down Expand Up @@ -223,7 +207,7 @@ TxFormats::TxFormats()
{sfLedgerSequence, soeREQUIRED},
{sfAmendment, soeREQUIRED},
},
pseudoCommonFields);
commonFields);

add(jss::SetFee,
ttFEE,
Expand All @@ -239,7 +223,7 @@ TxFormats::TxFormats()
{sfReserveBaseDrops, soeOPTIONAL},
{sfReserveIncrementDrops, soeOPTIONAL},
},
pseudoCommonFields);
commonFields);

add(jss::UNLModify,
ttUNL_MODIFY,
Expand All @@ -248,7 +232,7 @@ TxFormats::TxFormats()
{sfLedgerSequence, soeREQUIRED},
{sfUNLModifyValidator, soeREQUIRED},
},
pseudoCommonFields);
commonFields);

add(jss::TicketCreate,
ttTICKET_CREATE,
Expand Down

0 comments on commit 4db1218

Please sign in to comment.