20 #include <ripple/app/tx/applySteps.h>
21 #include <ripple/app/tx/impl/ApplyContext.h>
22 #include <ripple/app/tx/impl/CancelCheck.h>
23 #include <ripple/app/tx/impl/CancelOffer.h>
24 #include <ripple/app/tx/impl/CashCheck.h>
25 #include <ripple/app/tx/impl/Change.h>
26 #include <ripple/app/tx/impl/CreateCheck.h>
27 #include <ripple/app/tx/impl/CreateOffer.h>
28 #include <ripple/app/tx/impl/CreateTicket.h>
29 #include <ripple/app/tx/impl/DeleteAccount.h>
30 #include <ripple/app/tx/impl/DepositPreauth.h>
31 #include <ripple/app/tx/impl/Escrow.h>
32 #include <ripple/app/tx/impl/NFTokenAcceptOffer.h>
33 #include <ripple/app/tx/impl/NFTokenBurn.h>
34 #include <ripple/app/tx/impl/NFTokenCancelOffer.h>
35 #include <ripple/app/tx/impl/NFTokenCreateOffer.h>
36 #include <ripple/app/tx/impl/NFTokenMint.h>
37 #include <ripple/app/tx/impl/PayChan.h>
38 #include <ripple/app/tx/impl/Payment.h>
39 #include <ripple/app/tx/impl/SetAccount.h>
40 #include <ripple/app/tx/impl/SetRegularKey.h>
41 #include <ripple/app/tx/impl/SetSignerList.h>
42 #include <ripple/app/tx/impl/SetTrust.h>
80 return T::makeTxConsequences(ctx);
87 auto const tec = T::preflight(ctx);
99 return invoke_preflight_helper<DeleteAccount>(ctx);
101 return invoke_preflight_helper<SetAccount>(ctx);
103 return invoke_preflight_helper<CancelCheck>(ctx);
105 return invoke_preflight_helper<CashCheck>(ctx);
107 return invoke_preflight_helper<CreateCheck>(ctx);
109 return invoke_preflight_helper<DepositPreauth>(ctx);
111 return invoke_preflight_helper<CancelOffer>(ctx);
113 return invoke_preflight_helper<CreateOffer>(ctx);
115 return invoke_preflight_helper<EscrowCreate>(ctx);
117 return invoke_preflight_helper<EscrowFinish>(ctx);
119 return invoke_preflight_helper<EscrowCancel>(ctx);
121 return invoke_preflight_helper<PayChanClaim>(ctx);
123 return invoke_preflight_helper<PayChanCreate>(ctx);
125 return invoke_preflight_helper<PayChanFund>(ctx);
127 return invoke_preflight_helper<Payment>(ctx);
129 return invoke_preflight_helper<SetRegularKey>(ctx);
131 return invoke_preflight_helper<SetSignerList>(ctx);
133 return invoke_preflight_helper<CreateTicket>(ctx);
135 return invoke_preflight_helper<SetTrust>(ctx);
139 return invoke_preflight_helper<Change>(ctx);
141 return invoke_preflight_helper<NFTokenMint>(ctx);
143 return invoke_preflight_helper<NFTokenBurn>(ctx);
145 return invoke_preflight_helper<NFTokenCreateOffer>(ctx);
147 return invoke_preflight_helper<NFTokenCancelOffer>(ctx);
149 return invoke_preflight_helper<NFTokenAcceptOffer>(ctx);
168 if (
id != beast::zero)
170 TER result = T::checkSeqProxy(ctx.
view, ctx.
tx, ctx.
j);
175 result = T::checkPriorTxAndLastLedger(ctx);
185 result = T::checkSign(ctx);
191 return T::preclaim(ctx);
197 switch (ctx.tx.getTxnType())
200 return invoke_preclaim<DeleteAccount>(ctx);
202 return invoke_preclaim<SetAccount>(ctx);
204 return invoke_preclaim<CancelCheck>(ctx);
206 return invoke_preclaim<CashCheck>(ctx);
208 return invoke_preclaim<CreateCheck>(ctx);
210 return invoke_preclaim<DepositPreauth>(ctx);
212 return invoke_preclaim<CancelOffer>(ctx);
214 return invoke_preclaim<CreateOffer>(ctx);
216 return invoke_preclaim<EscrowCreate>(ctx);
218 return invoke_preclaim<EscrowFinish>(ctx);
220 return invoke_preclaim<EscrowCancel>(ctx);
222 return invoke_preclaim<PayChanClaim>(ctx);
224 return invoke_preclaim<PayChanCreate>(ctx);
226 return invoke_preclaim<PayChanFund>(ctx);
228 return invoke_preclaim<Payment>(ctx);
230 return invoke_preclaim<SetRegularKey>(ctx);
232 return invoke_preclaim<SetSignerList>(ctx);
234 return invoke_preclaim<CreateTicket>(ctx);
236 return invoke_preclaim<SetTrust>(ctx);
240 return invoke_preclaim<Change>(ctx);
242 return invoke_preclaim<NFTokenMint>(ctx);
244 return invoke_preclaim<NFTokenBurn>(ctx);
246 return invoke_preclaim<NFTokenCreateOffer>(ctx);
248 return invoke_preclaim<NFTokenCancelOffer>(ctx);
250 return invoke_preclaim<NFTokenAcceptOffer>(ctx);
323 , potentialSpend_(
beast::zero)
325 , sequencesConsumed_(0)
335 , potentialSpend_(
beast::zero)
336 , seqProx_(tx.getSeqProxy())
337 , sequencesConsumed_(tx.getSeqProxy().isSeq() ? 1 : 0)
487 JLOG(j.
fatal()) <<
"apply: " << e.
what();
505 preflightResult.
flags,
522 preflightResult.
flags,
528 return {*ctx, ctx->preflightResult};
533 JLOG(ctx->j.fatal()) <<
"apply: " << e.
what();
562 return {preclaimResult.
ter,
false};
569 preclaimResult.
flags,
575 JLOG(preclaimResult.
j.
fatal()) <<
"apply: " << e.
what();
TxType getTxnType() const
@ ttNFTOKEN_CREATE_OFFER
This transaction creates a new offer to buy or sell an NFT.
TxConsequences consequences_helper(PreflightContext const &ctx)
ReadView const & view
From the input - the ledger view.
@ ttACCOUNT_DELETE
This transaction type deletes an existing account.
const beast::Journal j
From the input - the journal.
TxConsequences(NotTEC pfresult)
@ ttREGULAR_KEY_SET
This transaction type sets or clears an account's "regular key".
@ ttSIGNER_LIST_SET
This transaction type modifies the signer list associated with an account.
@ ttESCROW_CANCEL
This transaction type cancels an existing escrow.
Writable ledger view that accumulates state and tx changes.
@ ttFEE
This system-generated transaction type is used to update the network's fee settings.
Category
Describes how the transaction affects subsequent transactions.
@ ttOFFER_CANCEL
This transaction type cancels existing offers to trade one asset for another.
@ ttPAYCHAN_CREATE
This transaction type creates a new unidirectional XRP payment channel.
static XRPAmount invoke_calculateBaseFee(ReadView const &view, STTx const &tx)
STTx const & tx
From the input - the transaction.
PreflightResult preflight(Application &app, Rules const &rules, STTx const &tx, ApplyFlags flags, beast::Journal j)
Gate a transaction based on static information.
@ ttNFTOKEN_ACCEPT_OFFER
This transaction accepts an existing offer to buy or sell an existing NFT.
static XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
@ ttAMENDMENT
This system-generated transaction type is used to update the status of the various amendments.
const bool likelyToClaimFee
Success flag - whether the transaction is likely to claim a fee.
const TER ter
Intermediate transaction result.
See the README.md for an overview of the SetSignerList transaction that this class implements.
@ ttCHECK_CANCEL
This transaction type cancels an existing check.
@ ttPAYMENT
This transaction type executes a payment.
static XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
@ ttUNL_MODIFY
This system-generated transaction type is used to update the network's negative UNL.
std::pair< TER, bool > doApply(PreclaimResult const &preclaimResult, Application &app, OpenView &view)
Apply a prechecked transaction to an OpenView.
@ ttCHECK_CREATE
This transaction type creates a new check.
Describes the results of the preflight check.
XRPAmount const & potentialSpend() const
Potential Spend.
const Rules rules
From the input - the rules.
@ ttTRUST_SET
This transaction type modifies a trustline between two accounts.
AccountID getAccountID(SField const &field) const
@ blocker
Affects the ability of subsequent transactions to claim a fee.
const NotTEC ter
Intermediate transaction result.
@ ttNFTOKEN_MINT
This transaction mints a new NFT.
@ ttESCROW_CREATE
This transaction type creates an escrow object.
TERSubset< CanCvtToTER > TER
@ ttESCROW_FINISH
This transaction type completes an existing escrow.
std::pair< NotTEC, TxConsequences > invoke_preflight_helper(PreflightContext const &ctx)
State information when applying a tx.
A generic endpoint for log messages.
Transactor specialized for creating offers in the ledger.
bool isBlocker_
Describes how the transaction affects subsequent transactions.
@ ttNFTOKEN_CANCEL_OFFER
This transaction cancels an existing offer to buy or sell an existing NFT.
@ ttOFFER_CREATE
This transaction type creates an offer to trade one asset for another.
static std::pair< TER, bool > invoke_apply(ApplyContext &ctx)
State information when determining if a tx is likely to claim a fee.
XRPAmount calculateDefaultBaseFee(ReadView const &view, STTx const &tx)
Return the minimum fee that an "ordinary" transaction would pay.
@ ttACCOUNT_SET
This transaction type adjusts various account settings.
PreclaimResult preclaim(PreflightResult const &preflightResult, Application &app, OpenView const &view)
Gate a transaction based on static ledger information.
std::uint32_t sequencesConsumed() const
Sequences consumed.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
static TER invoke_preclaim(PreclaimContext const &ctx)
LedgerIndex seq() const
Returns the sequence number of the base ledger.
@ ttDEPOSIT_PREAUTH
This transaction type grants or revokes authorization to transfer funds.
@ ttCHECK_CASH
This transaction type cashes an existing check.
Describes the results of the preclaim check.
@ ttPAYCHAN_FUND
This transaction type funds an existing unidirectional XRP payment channel.
A type that represents either a sequence value or a ticket value.
XRPAmount potentialSpend_
Does NOT include the fee.
@ ttPAYCHAN_CLAIM
This transaction type submits a claim against an existing unidirectional payment channel.
Rules controlling protocol behavior.
XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
Compute only the expected base fee for a transaction.
@ ttNFTOKEN_BURN
This transaction burns (i.e.
const ApplyFlags flags
From the input - the flags.
const SF_ACCOUNT sfAccount
const ApplyFlags flags
From the input - the flags.
std::uint32_t sequencesConsumed_
Number of sequences consumed.
static XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
State information when preflighting a tx.
Class describing the consequences to the account of applying a transaction if the transaction consume...
static XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
static XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
Rules const & rules() const override
Returns the tx processing rules.
static std::pair< NotTEC, TxConsequences > invoke_preflight(PreflightContext const &ctx)
@ ttTICKET_CREATE
This transaction type creates a new set of tickets.
STTx const & tx
From the input - the transaction.
const beast::Journal j
From the input - the journal.