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/PayChan.h>
33 #include <ripple/app/tx/impl/Payment.h>
34 #include <ripple/app/tx/impl/SetAccount.h>
35 #include <ripple/app/tx/impl/SetRegularKey.h>
36 #include <ripple/app/tx/impl/SetSignerList.h>
37 #include <ripple/app/tx/impl/SetTrust.h>
75 return T::makeTxConsequences(ctx);
82 auto const tec = T::preflight(ctx);
94 return invoke_preflight_helper<DeleteAccount>(ctx);
96 return invoke_preflight_helper<SetAccount>(ctx);
98 return invoke_preflight_helper<CancelCheck>(ctx);
100 return invoke_preflight_helper<CashCheck>(ctx);
102 return invoke_preflight_helper<CreateCheck>(ctx);
104 return invoke_preflight_helper<DepositPreauth>(ctx);
106 return invoke_preflight_helper<CancelOffer>(ctx);
108 return invoke_preflight_helper<CreateOffer>(ctx);
110 return invoke_preflight_helper<EscrowCreate>(ctx);
112 return invoke_preflight_helper<EscrowFinish>(ctx);
114 return invoke_preflight_helper<EscrowCancel>(ctx);
116 return invoke_preflight_helper<PayChanClaim>(ctx);
118 return invoke_preflight_helper<PayChanCreate>(ctx);
120 return invoke_preflight_helper<PayChanFund>(ctx);
122 return invoke_preflight_helper<Payment>(ctx);
124 return invoke_preflight_helper<SetRegularKey>(ctx);
126 return invoke_preflight_helper<SetSignerList>(ctx);
128 return invoke_preflight_helper<CreateTicket>(ctx);
130 return invoke_preflight_helper<SetTrust>(ctx);
134 return invoke_preflight_helper<Change>(ctx);
153 if (
id != beast::zero)
155 TER result = T::checkSeqProxy(ctx.
view, ctx.
tx, ctx.
j);
160 result = T::checkPriorTxAndLastLedger(ctx);
170 result = T::checkSign(ctx);
176 return T::preclaim(ctx);
182 switch (ctx.tx.getTxnType())
185 return invoke_preclaim<DeleteAccount>(ctx);
187 return invoke_preclaim<SetAccount>(ctx);
189 return invoke_preclaim<CancelCheck>(ctx);
191 return invoke_preclaim<CashCheck>(ctx);
193 return invoke_preclaim<CreateCheck>(ctx);
195 return invoke_preclaim<DepositPreauth>(ctx);
197 return invoke_preclaim<CancelOffer>(ctx);
199 return invoke_preclaim<CreateOffer>(ctx);
201 return invoke_preclaim<EscrowCreate>(ctx);
203 return invoke_preclaim<EscrowFinish>(ctx);
205 return invoke_preclaim<EscrowCancel>(ctx);
207 return invoke_preclaim<PayChanClaim>(ctx);
209 return invoke_preclaim<PayChanCreate>(ctx);
211 return invoke_preclaim<PayChanFund>(ctx);
213 return invoke_preclaim<Payment>(ctx);
215 return invoke_preclaim<SetRegularKey>(ctx);
217 return invoke_preclaim<SetSignerList>(ctx);
219 return invoke_preclaim<CreateTicket>(ctx);
221 return invoke_preclaim<SetTrust>(ctx);
225 return invoke_preclaim<Change>(ctx);
288 , potentialSpend_(
beast::zero)
290 , sequencesConsumed_(0)
300 , potentialSpend_(
beast::zero)
301 , seqProx_(tx.getSeqProxy())
302 , sequencesConsumed_(tx.getSeqProxy().isSeq() ? 1 : 0)
432 JLOG(j.
fatal()) <<
"apply: " << e.
what();
443 boost::optional<PreclaimContext const> ctx;
450 preflightResult.
flags,
467 preflightResult.
flags,
473 return {*ctx, ctx->preflightResult};
478 JLOG(ctx->j.fatal()) <<
"apply: " << e.
what();
507 return {preclaimResult.
ter,
false};
514 preclaimResult.
flags,
520 JLOG(preclaimResult.
j.
fatal()) <<
"apply: " << e.
what();
TxType getTxnType() const
TxConsequences consequences_helper(PreflightContext const &ctx)
static FeeUnit64 calculateBaseFee(ReadView const &view, STTx const &tx)
ReadView const & view
From the input - the ledger view.
const beast::Journal j
From the input - the journal.
TxConsequences(NotTEC pfresult)
FeeUnit64 calculateBaseFee(ReadView const &view, STTx const &tx)
Compute only the expected base fee for a transaction.
static FeeUnit64 calculateBaseFee(ReadView const &view, STTx const &tx)
Writable ledger view that accumulates state and tx changes.
virtual Fees const & fees() const =0
Returns the fees for the base ledger.
static FeeUnit64 invoke_calculateBaseFee(ReadView const &view, STTx const &tx)
Category
Describes how the transaction affects subsequent transactions.
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.
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.
static FeeUnit64 calculateBaseFee(ReadView const &view, STTx const &tx)
std::pair< TER, bool > doApply(PreclaimResult const &preclaimResult, Application &app, OpenView &view)
Apply a prechecked transaction to an OpenView.
Describes the results of the preflight check.
XRPAmount const & potentialSpend() const
Potential Spend.
const Rules rules
From the input - the rules.
AccountID getAccountID(SField const &field) const
@ blocker
Affects the ability of subsequent transactions to claim a fee.
const NotTEC ter
Intermediate transaction result.
TERSubset< CanCvtToTER > TER
std::pair< NotTEC, TxConsequences > invoke_preflight_helper(PreflightContext const &ctx)
static FeeUnit64 calculateBaseFee(ReadView const &view, STTx const &tx)
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.
XRPAmount toDrops(FeeUnit64 const &fee) const
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.
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.
FeeUnit< std::uint64_t > FeeUnit64
static FeeUnit64 calculateBaseFee(ReadView const &view, STTx const &tx)
Describes the results of the preclaim check.
A type that represents either a sequence value or a ticket value.
XRPAmount potentialSpend_
Does NOT include the fee.
Rules controlling protocol behavior.
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.
State information when preflighting a tx.
Class describing the consequences to the account of applying a transaction if the transaction consume...
Rules const & rules() const override
Returns the tx processing rules.
static std::pair< NotTEC, TxConsequences > invoke_preflight(PreflightContext const &ctx)
STTx const & tx
From the input - the transaction.
const beast::Journal j
From the input - the journal.