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/CancelTicket.h>
25 #include <ripple/app/tx/impl/CashCheck.h>
26 #include <ripple/app/tx/impl/Change.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/PayChan.h>
34 #include <ripple/app/tx/impl/Payment.h>
35 #include <ripple/app/tx/impl/SetAccount.h>
36 #include <ripple/app/tx/impl/SetRegularKey.h>
37 #include <ripple/app/tx/impl/SetSignerList.h>
38 #include <ripple/app/tx/impl/SetTrust.h>
109 if (
id != beast::zero)
111 TER result = T::checkSeq(ctx);
121 result = T::checkSign(ctx);
127 return T::preclaim(ctx);
133 switch (ctx.tx.getTxnType())
136 return invoke_preclaim<SetAccount>(ctx);
138 return invoke_preclaim<CancelCheck>(ctx);
140 return invoke_preclaim<CashCheck>(ctx);
142 return invoke_preclaim<CreateCheck>(ctx);
144 return invoke_preclaim<DepositPreauth>(ctx);
146 return invoke_preclaim<CancelOffer>(ctx);
148 return invoke_preclaim<CreateOffer>(ctx);
150 return invoke_preclaim<EscrowCreate>(ctx);
152 return invoke_preclaim<EscrowFinish>(ctx);
154 return invoke_preclaim<EscrowCancel>(ctx);
156 return invoke_preclaim<PayChanClaim>(ctx);
158 return invoke_preclaim<PayChanCreate>(ctx);
160 return invoke_preclaim<PayChanFund>(ctx);
162 return invoke_preclaim<Payment>(ctx);
164 return invoke_preclaim<SetRegularKey>(ctx);
166 return invoke_preclaim<SetSignerList>(ctx);
168 return invoke_preclaim<CancelTicket>(ctx);
170 return invoke_preclaim<CreateTicket>(ctx);
172 return invoke_preclaim<SetTrust>(ctx);
174 return invoke_preclaim<DeleteAccount>(ctx);
178 return invoke_preclaim<Change>(ctx);
241 static TxConsequences
244 auto const category = T::affectsSubsequentTransactionAuth(tx)
247 auto const feePaid = T::calculateFeePaid(tx);
248 auto const maxSpend = T::calculateMaxSpend(tx);
250 return {category, feePaid, maxSpend};
253 static TxConsequences
256 switch (tx.getTxnType())
259 return invoke_calculateConsequences<SetAccount>(tx);
261 return invoke_calculateConsequences<CancelCheck>(tx);
263 return invoke_calculateConsequences<CashCheck>(tx);
265 return invoke_calculateConsequences<CreateCheck>(tx);
267 return invoke_calculateConsequences<DepositPreauth>(tx);
269 return invoke_calculateConsequences<CancelOffer>(tx);
271 return invoke_calculateConsequences<CreateOffer>(tx);
273 return invoke_calculateConsequences<EscrowCreate>(tx);
275 return invoke_calculateConsequences<EscrowFinish>(tx);
277 return invoke_calculateConsequences<EscrowCancel>(tx);
279 return invoke_calculateConsequences<PayChanClaim>(tx);
281 return invoke_calculateConsequences<PayChanCreate>(tx);
283 return invoke_calculateConsequences<PayChanFund>(tx);
285 return invoke_calculateConsequences<Payment>(tx);
287 return invoke_calculateConsequences<SetRegularKey>(tx);
289 return invoke_calculateConsequences<SetSignerList>(tx);
291 return invoke_calculateConsequences<CancelTicket>(tx);
293 return invoke_calculateConsequences<CreateTicket>(tx);
295 return invoke_calculateConsequences<SetTrust>(tx);
297 return invoke_calculateConsequences<DeleteAccount>(tx);
423 JLOG(j.
fatal()) <<
"apply: " << e.
what();
434 boost::optional<PreclaimContext const> ctx;
441 preflightResult.
flags,
458 preflightResult.
flags,
464 return {*ctx, ctx->preflightResult};
469 JLOG(ctx->j.fatal()) <<
"apply: " << e.
what();
504 return {preclaimResult.
ter,
false};
511 preclaimResult.
flags,
517 JLOG(preclaimResult.
j.
fatal()) <<
"apply: " << e.
what();
TxType getTxnType() const
static NotTEC preflight(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.
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)
static NotTEC preflight(PreflightContext const &ctx)
static NotTEC invoke_preflight(PreflightContext const &ctx)
Writable ledger view that accumulates state and tx changes.
static NotTEC preflight(PreflightContext const &ctx)
const SF_Account sfAccount(access, STI_ACCOUNT, 1, "Account")
static FeeUnit64 invoke_calculateBaseFee(ReadView const &view, STTx const &tx)
@ normal
Moves currency around, creates offers, etc.
static NotTEC preflight(PreflightContext const &ctx)
static NotTEC preflight(PreflightContext const &ctx)
STTx const & tx
From the input - the transaction.
static NotTEC preflight(PreflightContext const &ctx)
Enforce constraints beyond those of the Transactor base class.
PreflightResult preflight(Application &app, Rules const &rules, STTx const &tx, ApplyFlags flags, beast::Journal j)
Gate a transaction based on static information.
static NotTEC preflight(PreflightContext const &ctx)
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.
const Rules rules
From the input - the rules.
AccountID getAccountID(SField const &field) const
const NotTEC ter
Intermediate transaction result.
TERSubset< CanCvtToTER > TER
static FeeUnit64 calculateBaseFee(ReadView const &view, STTx const &tx)
State information when applying a tx.
static NotTEC preflight(PreflightContext const &ctx)
A generic endpoint for log messages.
Transactor specialized for creating offers in the ledger.
static TxConsequences invoke_calculateConsequences(STTx const &tx)
static NotTEC preflight(PreflightContext const &ctx)
static NotTEC preflight(PreflightContext const &ctx)
static std::pair< TER, bool > invoke_apply(ApplyContext &ctx)
State information when determining if a tx is likely to claim a fee.
PreclaimResult preclaim(PreflightResult const &preflightResult, Application &app, OpenView const &view)
Gate a transaction based on static ledger information.
static NotTEC preflight(PreflightContext const &ctx)
static NotTEC preflight(PreflightContext const &ctx)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
static TER invoke_preclaim(PreclaimContext const &ctx)
static NotTEC preflight(PreflightContext const &ctx)
TxConsequences calculateConsequences(PreflightResult const &preflightResult)
Determine the XRP balance consequences if a transaction consumes the maximum XRP allowed.
static NotTEC preflight(PreflightContext const &ctx)
LedgerIndex seq() const
Returns the sequence number of the base ledger.
FeeUnit< std::uint64_t > FeeUnit64
static NotTEC preflight(PreflightContext const &ctx)
static FeeUnit64 calculateBaseFee(ReadView const &view, STTx const &tx)
Describes the results of the preclaim check.
Rules controlling protocol behavior.
static NotTEC preflight(PreflightContext const &ctx)
const ApplyFlags flags
From the input - the flags.
const ApplyFlags flags
From the input - the flags.
static NotTEC preflight(PreflightContext const &ctx)
State information when preflighting a tx.
static XRPAmount calculateFeePaid(STTx const &tx)
static NotTEC preflight(PreflightContext const &ctx)
static NotTEC preflight(PreflightContext const &ctx)
@ blocker
Affects the ability of subsequent transactions to claim a fee.
Rules const & rules() const override
Returns the tx processing rules.
static NotTEC preflight(PreflightContext const &ctx)
static NotTEC preflight(PreflightContext const &ctx)
STTx const & tx
From the input - the transaction.
const beast::Journal j
From the input - the journal.
TERSubset< CanCvtToNotTEC > NotTEC