3#include <xrpld/app/tx/applySteps.h>
4#include <xrpld/app/tx/detail/ApplyContext.h>
6#include <xrpl/beast/utility/Journal.h>
7#include <xrpl/beast/utility/WrappedSink.h>
8#include <xrpl/protocol/Permissions.h>
9#include <xrpl/protocol/XRPAmount.h>
33 XRPL_ASSERT((flags_ &
tapBATCH) ==
tapBATCH,
"Batch apply flag should be set");
44 XRPL_ASSERT((flags_ &
tapBATCH) == 0,
"Batch apply flag should not be set");
81 "Parent Batch ID should be set if batch apply flag is set");
93 XRPL_ASSERT((flags_ &
tapBATCH) == 0,
"Batch apply flag should not be set");
269 template <
class T,
class Unit>
282 template <
class T,
class Unit>
288 reset(XRPAmount fee);
296 ReadView
const&
view,
303 ReadView
const&
view,
306 STObject
const& sigObject,
373 if (!T::checkExtraFeatures(ctx))
376 if (
auto const ret =
preflight1(ctx, T::getFlagsMask(ctx)))
379 if (
auto const ret = T::preflight(ctx))
385 return T::preflightSigValidated(ctx);
394 return value >= min && value <= max;
397template <
class T,
class Unit>
413template <
class T,
class Unit>
A generic endpoint for log messages.
static Sink & getNullSink()
Returns a Sink which does nothing.
Wraps a Journal::Sink to prefix its output with a string.
State information when applying a tx.
Writeable view to a ledger, for applying a transaction.
std::optional< std::reference_wrapper< uint256 const > > const getTxFeature(TxType txType) const
static Permission const & getInstance()
Rules controlling protocol behavior.
bool enabled(uint256 const &feature) const
Returns true if a feature is enabled.
std::shared_ptr< STLedgerEntry > pointer
TxType getTxnType() const
static NotTEC preflight1(PreflightContext const &ctx, std::uint32_t flagMask)
Performs early sanity checks on the account and fee fields.
static std::uint32_t getFlagsMask(PreflightContext const &ctx)
TER consumeSeqProxy(SLE::pointer const &sleAccount)
void trapTransaction(uint256) const
static TER checkFee(PreclaimContext const &ctx, XRPAmount baseFee)
static NotTEC invokePreflight(PreflightContext const &ctx)
Transactor & operator=(Transactor const &)=delete
static NotTEC checkSign(PreclaimContext const &ctx)
static XRPAmount calculateOwnerReserveFee(ReadView const &view, STTx const &tx)
ApplyResult operator()()
Process the transaction.
static NotTEC checkPermission(ReadView const &view, STTx const &tx)
static XRPAmount minimumFee(Application &app, XRPAmount baseFee, Fees const &fees, ApplyFlags flags)
Compute the minimum fee required to process a transaction with a given baseFee based on the current s...
static bool validNumericMinimum(std::optional< T > value, T min=T{})
Minimum will usually be zero.
static NotTEC preflightSigValidated(PreflightContext const &ctx)
static NotTEC checkBatchSign(PreclaimContext const &ctx)
static NotTEC checkSeqProxy(ReadView const &view, STTx const &tx, beast::Journal j)
static TER preclaim(PreclaimContext const &ctx)
virtual ~Transactor()=default
static NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
static bool checkExtraFeatures(PreflightContext const &ctx)
static NotTEC checkSingleSign(ReadView const &view, AccountID const &idSigner, AccountID const &idAccount, std::shared_ptr< SLE const > sleAccount, beast::Journal const j)
Transactor(Transactor const &)=delete
static XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
static NotTEC checkPriorTxAndLastLedger(PreclaimContext const &ctx)
static NotTEC checkMultiSign(ReadView const &view, ApplyFlags flags, AccountID const &id, STObject const &sigObject, beast::Journal const j)
static bool validDataLength(std::optional< Slice > const &slice, std::size_t maxLength)
virtual void preCompute()
ApplyView const & view() const
std::pair< TER, XRPAmount > reset(XRPAmount fee)
Reset the context, discarding any changes made and adjust the fee.
static bool validNumericRange(std::optional< T > value, T max, T min=T{})
static TER ticketDelete(ApplyView &view, AccountID const &account, uint256 const &ticketIndex, beast::Journal j)
Class describing the consequences to the account of applying a transaction if the transaction consume...
NotTEC preflightCheckSigningKey(STObject const &sigObject, beast::Journal j)
Checks the validity of the transactor signing key.
std::optional< NotTEC > preflightCheckSimulateKeys(ApplyFlags flags, STObject const &sigObject, beast::Journal j)
Checks the special signing key state needed for simulation.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
TERSubset< CanCvtToTER > TER
NotTEC preflight0(PreflightContext const &ctx, std::uint32_t flagMask)
Performs early sanity checks on the txid.
TERSubset< CanCvtToNotTEC > NotTEC
Reflects the fee settings for a particular ledger.
State information when determining if a tx is likely to claim a fee.
PreclaimContext(Application &app_, ReadView const &view_, TER preflightResult_, STTx const &tx_, ApplyFlags flags_, beast::Journal j_=beast::Journal{beast::Journal::getNullSink()})
PreclaimContext & operator=(PreclaimContext const &)=delete
PreclaimContext(Application &app_, ReadView const &view_, TER preflightResult_, STTx const &tx_, ApplyFlags flags_, std::optional< uint256 > parentBatchId_, beast::Journal j_=beast::Journal{beast::Journal::getNullSink()})
std::optional< uint256 const > const parentBatchId
State information when preflighting a tx.
PreflightContext(Application &app_, STTx const &tx_, uint256 parentBatchId_, Rules const &rules_, ApplyFlags flags_, beast::Journal j_=beast::Journal{beast::Journal::getNullSink()})
PreflightContext(Application &app_, STTx const &tx_, Rules const &rules_, ApplyFlags flags_, beast::Journal j_=beast::Journal{beast::Journal::getNullSink()})
PreflightContext & operator=(PreflightContext const &)=delete
std::optional< uint256 const > parentBatchId
Describes the results of the preflight check.