Format first-party source according to .clang-format

This commit is contained in:
Pretty Printer
2020-04-17 09:56:34 -05:00
committed by manojsdoshi
parent 65dfc5d19e
commit 50760c6935
1076 changed files with 86161 additions and 77449 deletions

View File

@@ -22,221 +22,242 @@
namespace ripple {
TxFormats::TxFormats ()
TxFormats::TxFormats()
{
// Fields shared by all txFormats:
static const std::initializer_list<SOElement> commonFields
{
{ 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
static const std::initializer_list<SOElement> commonFields{
{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
};
add (jss::AccountSet, ttACCOUNT_SET,
add(jss::AccountSet,
ttACCOUNT_SET,
{
{ sfEmailHash, soeOPTIONAL },
{ sfWalletLocator, soeOPTIONAL },
{ sfWalletSize, soeOPTIONAL },
{ sfMessageKey, soeOPTIONAL },
{ sfDomain, soeOPTIONAL },
{ sfTransferRate, soeOPTIONAL },
{ sfSetFlag, soeOPTIONAL },
{ sfClearFlag, soeOPTIONAL },
{ sfTickSize, soeOPTIONAL },
{sfEmailHash, soeOPTIONAL},
{sfWalletLocator, soeOPTIONAL},
{sfWalletSize, soeOPTIONAL},
{sfMessageKey, soeOPTIONAL},
{sfDomain, soeOPTIONAL},
{sfTransferRate, soeOPTIONAL},
{sfSetFlag, soeOPTIONAL},
{sfClearFlag, soeOPTIONAL},
{sfTickSize, soeOPTIONAL},
},
commonFields);
add (jss::TrustSet, ttTRUST_SET,
add(jss::TrustSet,
ttTRUST_SET,
{
{ sfLimitAmount, soeOPTIONAL },
{ sfQualityIn, soeOPTIONAL },
{ sfQualityOut, soeOPTIONAL },
{sfLimitAmount, soeOPTIONAL},
{sfQualityIn, soeOPTIONAL},
{sfQualityOut, soeOPTIONAL},
},
commonFields);
add (jss::OfferCreate, ttOFFER_CREATE,
add(jss::OfferCreate,
ttOFFER_CREATE,
{
{ sfTakerPays, soeREQUIRED },
{ sfTakerGets, soeREQUIRED },
{ sfExpiration, soeOPTIONAL },
{ sfOfferSequence, soeOPTIONAL },
{sfTakerPays, soeREQUIRED},
{sfTakerGets, soeREQUIRED},
{sfExpiration, soeOPTIONAL},
{sfOfferSequence, soeOPTIONAL},
},
commonFields);
add (jss::OfferCancel, ttOFFER_CANCEL,
add(jss::OfferCancel,
ttOFFER_CANCEL,
{
{ sfOfferSequence, soeREQUIRED },
{sfOfferSequence, soeREQUIRED},
},
commonFields);
add (jss::SetRegularKey, ttREGULAR_KEY_SET,
add(jss::SetRegularKey,
ttREGULAR_KEY_SET,
{
{ sfRegularKey, soeOPTIONAL },
{sfRegularKey, soeOPTIONAL},
},
commonFields);
add (jss::Payment, ttPAYMENT,
add(jss::Payment,
ttPAYMENT,
{
{ sfDestination, soeREQUIRED },
{ sfAmount, soeREQUIRED },
{ sfSendMax, soeOPTIONAL },
{ sfPaths, soeDEFAULT },
{ sfInvoiceID, soeOPTIONAL },
{ sfDestinationTag, soeOPTIONAL },
{ sfDeliverMin, soeOPTIONAL },
{sfDestination, soeREQUIRED},
{sfAmount, soeREQUIRED},
{sfSendMax, soeOPTIONAL},
{sfPaths, soeDEFAULT},
{sfInvoiceID, soeOPTIONAL},
{sfDestinationTag, soeOPTIONAL},
{sfDeliverMin, soeOPTIONAL},
},
commonFields);
add (jss::EscrowCreate, ttESCROW_CREATE,
add(jss::EscrowCreate,
ttESCROW_CREATE,
{
{ sfDestination, soeREQUIRED },
{ sfAmount, soeREQUIRED },
{ sfCondition, soeOPTIONAL },
{ sfCancelAfter, soeOPTIONAL },
{ sfFinishAfter, soeOPTIONAL },
{ sfDestinationTag, soeOPTIONAL },
{sfDestination, soeREQUIRED},
{sfAmount, soeREQUIRED},
{sfCondition, soeOPTIONAL},
{sfCancelAfter, soeOPTIONAL},
{sfFinishAfter, soeOPTIONAL},
{sfDestinationTag, soeOPTIONAL},
},
commonFields);
add (jss::EscrowFinish, ttESCROW_FINISH,
add(jss::EscrowFinish,
ttESCROW_FINISH,
{
{ sfOwner, soeREQUIRED },
{ sfOfferSequence, soeREQUIRED },
{ sfFulfillment, soeOPTIONAL },
{ sfCondition, soeOPTIONAL },
{sfOwner, soeREQUIRED},
{sfOfferSequence, soeREQUIRED},
{sfFulfillment, soeOPTIONAL},
{sfCondition, soeOPTIONAL},
},
commonFields);
add (jss::EscrowCancel, ttESCROW_CANCEL,
add(jss::EscrowCancel,
ttESCROW_CANCEL,
{
{ sfOwner, soeREQUIRED },
{ sfOfferSequence, soeREQUIRED },
{sfOwner, soeREQUIRED},
{sfOfferSequence, soeREQUIRED},
},
commonFields);
add (jss::EnableAmendment, ttAMENDMENT,
add(jss::EnableAmendment,
ttAMENDMENT,
{
{ sfLedgerSequence, soeREQUIRED },
{ sfAmendment, soeREQUIRED },
{sfLedgerSequence, soeREQUIRED},
{sfAmendment, soeREQUIRED},
},
commonFields);
add (jss::SetFee, ttFEE,
add(jss::SetFee,
ttFEE,
{
{ sfLedgerSequence, soeOPTIONAL },
{ sfBaseFee, soeREQUIRED },
{ sfReferenceFeeUnits, soeREQUIRED },
{ sfReserveBase, soeREQUIRED },
{ sfReserveIncrement, soeREQUIRED },
{sfLedgerSequence, soeOPTIONAL},
{sfBaseFee, soeREQUIRED},
{sfReferenceFeeUnits, soeREQUIRED},
{sfReserveBase, soeREQUIRED},
{sfReserveIncrement, soeREQUIRED},
},
commonFields);
add (jss::TicketCreate, ttTICKET_CREATE,
add(jss::TicketCreate,
ttTICKET_CREATE,
{
{ sfTarget, soeOPTIONAL },
{ sfExpiration, soeOPTIONAL },
{sfTarget, soeOPTIONAL},
{sfExpiration, soeOPTIONAL},
},
commonFields);
add (jss::TicketCancel, ttTICKET_CANCEL,
add(jss::TicketCancel,
ttTICKET_CANCEL,
{
{ sfTicketID, soeREQUIRED },
{sfTicketID, soeREQUIRED},
},
commonFields);
// The SignerEntries are optional because a SignerList is deleted by
// setting the SignerQuorum to zero and omitting SignerEntries.
add (jss::SignerListSet, ttSIGNER_LIST_SET,
add(jss::SignerListSet,
ttSIGNER_LIST_SET,
{
{ sfSignerQuorum, soeREQUIRED },
{ sfSignerEntries, soeOPTIONAL },
{sfSignerQuorum, soeREQUIRED},
{sfSignerEntries, soeOPTIONAL},
},
commonFields);
add (jss::PaymentChannelCreate, ttPAYCHAN_CREATE,
add(jss::PaymentChannelCreate,
ttPAYCHAN_CREATE,
{
{ sfDestination, soeREQUIRED },
{ sfAmount, soeREQUIRED },
{ sfSettleDelay, soeREQUIRED },
{ sfPublicKey, soeREQUIRED },
{ sfCancelAfter, soeOPTIONAL },
{ sfDestinationTag, soeOPTIONAL },
{sfDestination, soeREQUIRED},
{sfAmount, soeREQUIRED},
{sfSettleDelay, soeREQUIRED},
{sfPublicKey, soeREQUIRED},
{sfCancelAfter, soeOPTIONAL},
{sfDestinationTag, soeOPTIONAL},
},
commonFields);
add (jss::PaymentChannelFund, ttPAYCHAN_FUND,
add(jss::PaymentChannelFund,
ttPAYCHAN_FUND,
{
{ sfPayChannel, soeREQUIRED },
{ sfAmount, soeREQUIRED },
{ sfExpiration, soeOPTIONAL },
{sfPayChannel, soeREQUIRED},
{sfAmount, soeREQUIRED},
{sfExpiration, soeOPTIONAL},
},
commonFields);
add (jss::PaymentChannelClaim, ttPAYCHAN_CLAIM,
add(jss::PaymentChannelClaim,
ttPAYCHAN_CLAIM,
{
{ sfPayChannel, soeREQUIRED },
{ sfAmount, soeOPTIONAL },
{ sfBalance, soeOPTIONAL },
{ sfSignature, soeOPTIONAL },
{ sfPublicKey, soeOPTIONAL },
{sfPayChannel, soeREQUIRED},
{sfAmount, soeOPTIONAL},
{sfBalance, soeOPTIONAL},
{sfSignature, soeOPTIONAL},
{sfPublicKey, soeOPTIONAL},
},
commonFields);
add (jss::CheckCreate, ttCHECK_CREATE,
add(jss::CheckCreate,
ttCHECK_CREATE,
{
{ sfDestination, soeREQUIRED },
{ sfSendMax, soeREQUIRED },
{ sfExpiration, soeOPTIONAL },
{ sfDestinationTag, soeOPTIONAL },
{ sfInvoiceID, soeOPTIONAL },
{sfDestination, soeREQUIRED},
{sfSendMax, soeREQUIRED},
{sfExpiration, soeOPTIONAL},
{sfDestinationTag, soeOPTIONAL},
{sfInvoiceID, soeOPTIONAL},
},
commonFields);
add (jss::CheckCash, ttCHECK_CASH,
add(jss::CheckCash,
ttCHECK_CASH,
{
{ sfCheckID, soeREQUIRED },
{ sfAmount, soeOPTIONAL },
{ sfDeliverMin, soeOPTIONAL },
{sfCheckID, soeREQUIRED},
{sfAmount, soeOPTIONAL},
{sfDeliverMin, soeOPTIONAL},
},
commonFields);
add (jss::CheckCancel, ttCHECK_CANCEL,
add(jss::CheckCancel,
ttCHECK_CANCEL,
{
{ sfCheckID, soeREQUIRED },
{sfCheckID, soeREQUIRED},
},
commonFields);
add (jss::AccountDelete, ttACCOUNT_DELETE,
add(jss::AccountDelete,
ttACCOUNT_DELETE,
{
{ sfDestination, soeREQUIRED },
{ sfDestinationTag, soeOPTIONAL },
{sfDestination, soeREQUIRED},
{sfDestinationTag, soeOPTIONAL},
},
commonFields);
add (jss::DepositPreauth, ttDEPOSIT_PREAUTH,
add(jss::DepositPreauth,
ttDEPOSIT_PREAUTH,
{
{ sfAuthorize, soeOPTIONAL },
{ sfUnauthorize, soeOPTIONAL },
{sfAuthorize, soeOPTIONAL},
{sfUnauthorize, soeOPTIONAL},
},
commonFields);
}
TxFormats const&
TxFormats::getInstance ()
TxFormats::getInstance()
{
static TxFormats const instance;
return instance;
}
} // ripple
} // namespace ripple