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/Clawback.h>
27 #include <ripple/app/tx/impl/CreateCheck.h>
28 #include <ripple/app/tx/impl/CreateOffer.h>
29 #include <ripple/app/tx/impl/CreateTicket.h>
30 #include <ripple/app/tx/impl/DeleteAccount.h>
31 #include <ripple/app/tx/impl/DepositPreauth.h>
32 #include <ripple/app/tx/impl/Escrow.h>
33 #include <ripple/app/tx/impl/NFTokenAcceptOffer.h>
34 #include <ripple/app/tx/impl/NFTokenBurn.h>
35 #include <ripple/app/tx/impl/NFTokenCancelOffer.h>
36 #include <ripple/app/tx/impl/NFTokenCreateOffer.h>
37 #include <ripple/app/tx/impl/NFTokenMint.h>
38 #include <ripple/app/tx/impl/PayChan.h>
39 #include <ripple/app/tx/impl/Payment.h>
40 #include <ripple/app/tx/impl/SetAccount.h>
41 #include <ripple/app/tx/impl/SetRegularKey.h>
42 #include <ripple/app/tx/impl/SetSignerList.h>
43 #include <ripple/app/tx/impl/SetTrust.h>
81 return T::makeTxConsequences(ctx);
88 auto const tec = T::preflight(ctx);
100 return invoke_preflight_helper<DeleteAccount>(ctx);
102 return invoke_preflight_helper<SetAccount>(ctx);
104 return invoke_preflight_helper<CancelCheck>(ctx);
106 return invoke_preflight_helper<CashCheck>(ctx);
108 return invoke_preflight_helper<CreateCheck>(ctx);
110 return invoke_preflight_helper<DepositPreauth>(ctx);
112 return invoke_preflight_helper<CancelOffer>(ctx);
114 return invoke_preflight_helper<CreateOffer>(ctx);
116 return invoke_preflight_helper<EscrowCreate>(ctx);
118 return invoke_preflight_helper<EscrowFinish>(ctx);
120 return invoke_preflight_helper<EscrowCancel>(ctx);
122 return invoke_preflight_helper<PayChanClaim>(ctx);
124 return invoke_preflight_helper<PayChanCreate>(ctx);
126 return invoke_preflight_helper<PayChanFund>(ctx);
128 return invoke_preflight_helper<Payment>(ctx);
130 return invoke_preflight_helper<SetRegularKey>(ctx);
132 return invoke_preflight_helper<SetSignerList>(ctx);
134 return invoke_preflight_helper<CreateTicket>(ctx);
136 return invoke_preflight_helper<SetTrust>(ctx);
140 return invoke_preflight_helper<Change>(ctx);
142 return invoke_preflight_helper<NFTokenMint>(ctx);
144 return invoke_preflight_helper<NFTokenBurn>(ctx);
146 return invoke_preflight_helper<NFTokenCreateOffer>(ctx);
148 return invoke_preflight_helper<NFTokenCancelOffer>(ctx);
150 return invoke_preflight_helper<NFTokenAcceptOffer>(ctx);
152 return invoke_preflight_helper<Clawback>(ctx);
171 if (
id != beast::zero)
173 TER result = T::checkSeqProxy(ctx.
view, ctx.
tx, ctx.
j);
178 result = T::checkPriorTxAndLastLedger(ctx);
188 result = T::checkSign(ctx);
194 return T::preclaim(ctx);
200 switch (ctx.tx.getTxnType())
203 return invoke_preclaim<DeleteAccount>(ctx);
205 return invoke_preclaim<SetAccount>(ctx);
207 return invoke_preclaim<CancelCheck>(ctx);
209 return invoke_preclaim<CashCheck>(ctx);
211 return invoke_preclaim<CreateCheck>(ctx);
213 return invoke_preclaim<DepositPreauth>(ctx);
215 return invoke_preclaim<CancelOffer>(ctx);
217 return invoke_preclaim<CreateOffer>(ctx);
219 return invoke_preclaim<EscrowCreate>(ctx);
221 return invoke_preclaim<EscrowFinish>(ctx);
223 return invoke_preclaim<EscrowCancel>(ctx);
225 return invoke_preclaim<PayChanClaim>(ctx);
227 return invoke_preclaim<PayChanCreate>(ctx);
229 return invoke_preclaim<PayChanFund>(ctx);
231 return invoke_preclaim<Payment>(ctx);
233 return invoke_preclaim<SetRegularKey>(ctx);
235 return invoke_preclaim<SetSignerList>(ctx);
237 return invoke_preclaim<CreateTicket>(ctx);
239 return invoke_preclaim<SetTrust>(ctx);
243 return invoke_preclaim<Change>(ctx);
245 return invoke_preclaim<NFTokenMint>(ctx);
247 return invoke_preclaim<NFTokenBurn>(ctx);
249 return invoke_preclaim<NFTokenCreateOffer>(ctx);
251 return invoke_preclaim<NFTokenCancelOffer>(ctx);
253 return invoke_preclaim<NFTokenAcceptOffer>(ctx);
255 return invoke_preclaim<Clawback>(ctx);
330 , potentialSpend_(
beast::zero)
332 , sequencesConsumed_(0)
342 , potentialSpend_(
beast::zero)
343 , seqProx_(tx.getSeqProxy())
344 , sequencesConsumed_(tx.getSeqProxy().isSeq() ? 1 : 0)
498 JLOG(j.
fatal()) <<
"apply: " << e.
what();
516 preflightResult.
flags,
533 preflightResult.
flags,
539 return {*ctx, ctx->preflightResult};
544 JLOG(ctx->j.fatal()) <<
"apply: " << e.
what();
573 return {preclaimResult.
ter,
false};
580 preclaimResult.
flags,
586 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".
@ ttCLAWBACK
This transaction claws back issued tokens.
@ 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.