1#ifndef XRPL_APP_TX_TRANSACTOR_H_INCLUDED
2#define XRPL_APP_TX_TRANSACTOR_H_INCLUDED
4#include <xrpld/app/tx/applySteps.h>
5#include <xrpld/app/tx/detail/ApplyContext.h>
7#include <xrpl/beast/utility/Journal.h>
8#include <xrpl/beast/utility/WrappedSink.h>
9#include <xrpl/protocol/Permissions.h>
10#include <xrpl/protocol/XRPAmount.h>
52 (flags_ &
tapBATCH) == 0,
"Batch apply flag should not be set");
89 "Parent Batch ID should be set if batch apply flag is set");
109 (flags_ &
tapBATCH) == 0,
"Batch apply flag should not be set");
292 template <
class T,
class Unit>
301 reset(XRPAmount fee);
309 ReadView
const&
view,
316 ReadView
const&
view,
319 STObject
const& sigObject,
390 if (!T::checkExtraFeatures(ctx))
393 if (
auto const ret =
preflight1(ctx, T::getFlagsMask(ctx)))
396 if (
auto const ret = T::preflight(ctx))
402 return T::preflightSigValidated(ctx);
411 return value >= min && value <= max;
414template <
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
TER consumeSeqProxy(SLE::pointer const &sleAccount)
ApplyResult operator()()
Process the transaction.
static NotTEC preflightSigValidated(PreflightContext const &ctx)
Transactor & operator=(Transactor const &)=delete
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 TER checkFee(PreclaimContext const &ctx, XRPAmount baseFee)
static XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
static NotTEC checkSeqProxy(ReadView const &view, STTx const &tx, beast::Journal j)
static NotTEC checkSign(PreclaimContext const &ctx)
void trapTransaction(uint256) const
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...
virtual ~Transactor()=default
static bool checkExtraFeatures(PreflightContext const &ctx)
static NotTEC preflight1(PreflightContext const &ctx, std::uint32_t flagMask)
Performs early sanity checks on the account and fee fields.
static NotTEC checkSingleSign(ReadView const &view, AccountID const &idSigner, AccountID const &idAccount, std::shared_ptr< SLE const > sleAccount, beast::Journal const j)
static NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
static TER preclaim(PreclaimContext const &ctx)
static NotTEC checkBatchSign(PreclaimContext const &ctx)
static XRPAmount calculateOwnerReserveFee(ReadView const &view, STTx const &tx)
static bool validNumericRange(std::optional< T > value, T max, T min={})
virtual void preCompute()
static TER ticketDelete(ApplyView &view, AccountID const &account, uint256 const &ticketIndex, beast::Journal j)
static std::uint32_t getFlagsMask(PreflightContext const &ctx)
static bool validDataLength(std::optional< Slice > const &slice, std::size_t maxLength)
std::pair< TER, XRPAmount > reset(XRPAmount fee)
Reset the context, discarding any changes made and adjust the fee.
Transactor(Transactor const &)=delete
static NotTEC checkPermission(ReadView const &view, STTx const &tx)
ApplyView const & view() const
static NotTEC invokePreflight(PreflightContext const &ctx)
Class describing the consequences to the account of applying a transaction if the transaction consume...
std::optional< NotTEC > preflightCheckSimulateKeys(ApplyFlags flags, STObject const &sigObject, beast::Journal j)
Checks the special signing key state needed for simulation.
NotTEC preflightCheckSigningKey(STObject const &sigObject, beast::Journal j)
Checks the validity of the transactor signing key.
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 & operator=(PreclaimContext const &)=delete
PreclaimContext(Application &app_, ReadView const &view_, TER preflightResult_, STTx const &tx_, ApplyFlags flags_, beast::Journal j_=beast::Journal{beast::Journal::getNullSink()})
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()})
std::optional< uint256 const > parentBatchId
PreflightContext(Application &app_, STTx const &tx_, Rules const &rules_, ApplyFlags flags_, beast::Journal j_=beast::Journal{beast::Journal::getNullSink()})
PreflightContext & operator=(PreflightContext const &)=delete
Describes the results of the preflight check.