rippled
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | List of all members
xrpl::EscrowCreate Class Reference

#include <EscrowCreate.h>

Inheritance diagram for xrpl::EscrowCreate:
Inheritance graph
[legend]
Collaboration diagram for xrpl::EscrowCreate:
Collaboration graph
[legend]

Public Types

enum  ConsequencesFactoryType { Normal , Blocker , Custom }
 

Public Member Functions

 EscrowCreate (ApplyContext &ctx)
 
TER doApply () override
 
ApplyResult operator() ()
 Process the transaction.
 
ApplyViewview ()
 
ApplyView const & view () const
 

Static Public Member Functions

static TxConsequences makeTxConsequences (PreflightContext const &ctx)
 
static NotTEC preflight (PreflightContext const &ctx)
 
static TER preclaim (PreclaimContext const &ctx)
 
static NotTEC checkSeqProxy (ReadView const &view, STTx const &tx, beast::Journal j)
 
static NotTEC checkPriorTxAndLastLedger (PreclaimContext const &ctx)
 
static TER checkFee (PreclaimContext const &ctx, XRPAmount baseFee)
 
static NotTEC checkSign (PreclaimContext const &ctx)
 
static NotTEC checkBatchSign (PreclaimContext const &ctx)
 
static XRPAmount calculateBaseFee (ReadView const &view, STTx const &tx)
 
template<class T >
static NotTEC invokePreflight (PreflightContext const &ctx)
 
template<>
NotTEC invokePreflight (PreflightContext const &ctx)
 
template<>
NotTEC invokePreflight (PreflightContext const &ctx)
 
static NotTEC checkPermission (ReadView const &view, STTx const &tx)
 
static TER ticketDelete (ApplyView &view, AccountID const &account, uint256 const &ticketIndex, beast::Journal j)
 

Static Public Attributes

static constexpr ConsequencesFactoryType ConsequencesFactory {Custom}
 

Protected Member Functions

TER apply ()
 
virtual void preCompute ()
 

Static Protected Member Functions

static NotTEC checkSign (ReadView const &view, ApplyFlags flags, std::optional< uint256 const > const &parentBatchId, AccountID const &idAccount, STObject const &sigObject, beast::Journal const j)
 
static XRPAmount minimumFee (ServiceRegistry &registry, XRPAmount baseFee, Fees const &fees, ApplyFlags flags)
 Compute the minimum fee required to process a transaction with a given baseFee based on the current server load.
 
static XRPAmount calculateOwnerReserveFee (ReadView const &view, STTx const &tx)
 
static bool checkExtraFeatures (PreflightContext const &ctx)
 
static std::uint32_t getFlagsMask (PreflightContext const &ctx)
 
static NotTEC preflightSigValidated (PreflightContext const &ctx)
 
static bool validDataLength (std::optional< Slice > const &slice, std::size_t maxLength)
 
template<class T >
static bool validNumericRange (std::optional< T > value, T max, T min=T{})
 
template<class T , class Unit >
static bool validNumericRange (std::optional< T > value, unit::ValueUnit< Unit, T > max, unit::ValueUnit< Unit, T > min=unit::ValueUnit< Unit, T >{})
 
template<class T >
static bool validNumericMinimum (std::optional< T > value, T min=T{})
 Minimum will usually be zero.
 
template<class T , class Unit >
static bool validNumericMinimum (std::optional< T > value, unit::ValueUnit< Unit, T > min=unit::ValueUnit< Unit, T >{})
 Minimum will usually be zero.
 

Protected Attributes

ApplyContextctx_
 
beast::WrappedSink sink_
 
beast::Journal const j_
 
AccountID const account_
 
XRPAmount preFeeBalance_ {}
 

Private Member Functions

std::pair< TER, XRPAmountreset (XRPAmount fee)
 Reset the context, discarding any changes made and adjust the fee.
 
TER consumeSeqProxy (SLE::pointer const &sleAccount)
 
TER payFee ()
 
void trapTransaction (uint256) const
 

Static Private Member Functions

static NotTEC checkSingleSign (ReadView const &view, AccountID const &idSigner, AccountID const &idAccount, std::shared_ptr< SLE const > sleAccount, beast::Journal const j)
 
static NotTEC checkMultiSign (ReadView const &view, ApplyFlags flags, AccountID const &id, STObject const &sigObject, beast::Journal const j)
 
static NotTEC preflight1 (PreflightContext const &ctx, std::uint32_t flagMask)
 Performs early sanity checks on the account and fee fields.
 
static NotTEC preflight2 (PreflightContext const &ctx)
 Checks whether the signature appears valid.
 

Detailed Description

Definition at line 7 of file tx/transactors/escrow/EscrowCreate.h.

Member Enumeration Documentation

◆ ConsequencesFactoryType

Enumerator
Normal 
Blocker 
Custom 

Definition at line 126 of file Transactor.h.

Constructor & Destructor Documentation

◆ EscrowCreate()

xrpl::EscrowCreate::EscrowCreate ( ApplyContext ctx)
explicit

Definition at line 12 of file tx/transactors/escrow/EscrowCreate.h.

Member Function Documentation

◆ makeTxConsequences()

TxConsequences xrpl::EscrowCreate::makeTxConsequences ( PreflightContext const &  ctx)
static

Definition at line 57 of file EscrowCreate.cpp.

◆ preflight()

NotTEC xrpl::EscrowCreate::preflight ( PreflightContext const &  ctx)
static

Definition at line 96 of file EscrowCreate.cpp.

◆ preclaim()

TER xrpl::EscrowCreate::preclaim ( PreclaimContext const &  ctx)
static

Definition at line 301 of file EscrowCreate.cpp.

◆ doApply()

TER xrpl::EscrowCreate::doApply ( )
overridevirtual

Implements xrpl::Transactor.

Definition at line 382 of file EscrowCreate.cpp.

◆ operator()()

ApplyResult xrpl::Transactor::operator() ( )
inherited

Process the transaction.

Definition at line 1073 of file Transactor.cpp.

◆ view() [1/2]

ApplyView & xrpl::Transactor::view ( )
inherited

Definition at line 132 of file Transactor.h.

◆ view() [2/2]

ApplyView const & xrpl::Transactor::view ( ) const
inherited

Definition at line 138 of file Transactor.h.

◆ checkSeqProxy()

NotTEC xrpl::Transactor::checkSeqProxy ( ReadView const &  view,
STTx const &  tx,
beast::Journal  j 
)
staticinherited

Definition at line 411 of file Transactor.cpp.

◆ checkPriorTxAndLastLedger()

NotTEC xrpl::Transactor::checkPriorTxAndLastLedger ( PreclaimContext const &  ctx)
staticinherited

Definition at line 476 of file Transactor.cpp.

◆ checkFee()

TER xrpl::Transactor::checkFee ( PreclaimContext const &  ctx,
XRPAmount  baseFee 
)
staticinherited

Definition at line 324 of file Transactor.cpp.

◆ checkSign() [1/2]

NotTEC xrpl::Transactor::checkSign ( PreclaimContext const &  ctx)
staticinherited

Definition at line 695 of file Transactor.cpp.

◆ checkSign() [2/2]

NotTEC xrpl::Transactor::checkSign ( ReadView const &  view,
ApplyFlags  flags,
std::optional< uint256 const > const &  parentBatchId,
AccountID const &  idAccount,
STObject const &  sigObject,
beast::Journal const  j 
)
staticprotectedinherited

Definition at line 629 of file Transactor.cpp.

◆ checkBatchSign()

NotTEC xrpl::Transactor::checkBatchSign ( PreclaimContext const &  ctx)
staticinherited

Definition at line 703 of file Transactor.cpp.

◆ calculateBaseFee()

XRPAmount xrpl::Transactor::calculateBaseFee ( ReadView const &  view,
STTx const &  tx 
)
staticinherited

Definition at line 275 of file Transactor.cpp.

◆ invokePreflight() [1/3]

template<class T >
NotTEC xrpl::Transactor::invokePreflight ( PreflightContext const &  ctx)
staticinherited

Definition at line 374 of file Transactor.h.

◆ invokePreflight() [2/3]

template<>
NotTEC xrpl::Transactor::invokePreflight ( PreflightContext const &  ctx)
staticinherited

◆ invokePreflight() [3/3]

template<>
NotTEC xrpl::Transactor::invokePreflight ( PreflightContext const &  ctx)
staticinherited

Definition at line 15 of file Change.cpp.

◆ checkPermission()

NotTEC xrpl::Transactor::checkPermission ( ReadView const &  view,
STTx const &  tx 
)
staticinherited

Definition at line 259 of file Transactor.cpp.

◆ ticketDelete()

TER xrpl::Transactor::ticketDelete ( ApplyView view,
AccountID const &  account,
uint256 const &  ticketIndex,
beast::Journal  j 
)
staticinherited

Definition at line 521 of file Transactor.cpp.

◆ apply()

TER xrpl::Transactor::apply ( )
protectedinherited

Definition at line 593 of file Transactor.cpp.

◆ preCompute()

void xrpl::Transactor::preCompute ( )
protectedvirtualinherited

Reimplemented in xrpl::SignerListSet, and xrpl::Change.

Definition at line 587 of file Transactor.cpp.

◆ minimumFee()

XRPAmount xrpl::Transactor::minimumFee ( ServiceRegistry registry,
XRPAmount  baseFee,
Fees const &  fees,
ApplyFlags  flags 
)
staticprotectedinherited

Compute the minimum fee required to process a transaction with a given baseFee based on the current server load.

Parameters
registryThe service registry.
baseFeeThe base fee of a candidate transaction
See also
xrpl::calculateBaseFee
Parameters
feesFee settings from the current ledger
flagsTransaction processing fees

Definition at line 314 of file Transactor.cpp.

◆ calculateOwnerReserveFee()

XRPAmount xrpl::Transactor::calculateOwnerReserveFee ( ReadView const &  view,
STTx const &  tx 
)
staticprotectedinherited

Definition at line 294 of file Transactor.cpp.

◆ checkExtraFeatures()

bool xrpl::Transactor::checkExtraFeatures ( PreflightContext const &  ctx)
staticprotectedinherited

Definition at line 341 of file Transactor.h.

◆ getFlagsMask()

std::uint32_t xrpl::Transactor::getFlagsMask ( PreflightContext const &  ctx)
staticprotectedinherited

Definition at line 247 of file Transactor.cpp.

◆ preflightSigValidated()

NotTEC xrpl::Transactor::preflightSigValidated ( PreflightContext const &  ctx)
staticprotectedinherited

Definition at line 253 of file Transactor.cpp.

◆ validDataLength()

bool xrpl::Transactor::validDataLength ( std::optional< Slice > const &  slice,
std::size_t  maxLength 
)
staticprotectedinherited

Definition at line 239 of file Transactor.cpp.

◆ validNumericRange() [1/2]

template<class T >
bool xrpl::Transactor::validNumericRange ( std::optional< T >  value,
max,
min = T{} 
)
staticprotectedinherited

Definition at line 400 of file Transactor.h.

◆ validNumericRange() [2/2]

template<class T , class Unit >
bool xrpl::Transactor::validNumericRange ( std::optional< T >  value,
unit::ValueUnit< Unit, T >  max,
unit::ValueUnit< Unit, T >  min = unit::ValueUnit<Unit, T>{} 
)
staticprotectedinherited

Definition at line 409 of file Transactor.h.

◆ validNumericMinimum() [1/2]

template<class T >
bool xrpl::Transactor::validNumericMinimum ( std::optional< T >  value,
min = T{} 
)
staticprotectedinherited

Minimum will usually be zero.

Definition at line 419 of file Transactor.h.

◆ validNumericMinimum() [2/2]

template<class T , class Unit >
bool xrpl::Transactor::validNumericMinimum ( std::optional< T >  value,
unit::ValueUnit< Unit, T >  min = unit::ValueUnit<Unit, T>{} 
)
staticprotectedinherited

Minimum will usually be zero.

Definition at line 428 of file Transactor.h.

◆ reset()

std::pair< TER, XRPAmount > xrpl::Transactor::reset ( XRPAmount  fee)
privateinherited

Reset the context, discarding any changes made and adjust the fee.

Parameters
feeThe transaction fee to be charged.
Returns
A pair containing the transaction result and the actual fee charged.

Definition at line 1015 of file Transactor.cpp.

◆ consumeSeqProxy()

TER xrpl::Transactor::consumeSeqProxy ( SLE::pointer const &  sleAccount)
privateinherited

Definition at line 504 of file Transactor.cpp.

◆ payFee()

TER xrpl::Transactor::payFee ( )
privateinherited

Definition at line 391 of file Transactor.cpp.

◆ checkSingleSign()

NotTEC xrpl::Transactor::checkSingleSign ( ReadView const &  view,
AccountID const &  idSigner,
AccountID const &  idAccount,
std::shared_ptr< SLE const >  sleAccount,
beast::Journal const  j 
)
staticprivateinherited

Definition at line 747 of file Transactor.cpp.

◆ checkMultiSign()

NotTEC xrpl::Transactor::checkMultiSign ( ReadView const &  view,
ApplyFlags  flags,
AccountID const &  id,
STObject const &  sigObject,
beast::Journal const  j 
)
staticprivateinherited

Definition at line 779 of file Transactor.cpp.

◆ trapTransaction()

void xrpl::Transactor::trapTransaction ( uint256  txHash) const
privateinherited

Definition at line 1066 of file Transactor.cpp.

◆ preflight1()

NotTEC xrpl::Transactor::preflight1 ( PreflightContext const &  ctx,
std::uint32_t  flagMask 
)
staticprivateinherited

Performs early sanity checks on the account and fee fields.

(And passes flagMask to preflight0)

Do not try to call preflight1 from preflight() in derived classes. See the description of invokePreflight for details.

Definition at line 139 of file Transactor.cpp.

◆ preflight2()

NotTEC xrpl::Transactor::preflight2 ( PreflightContext const &  ctx)
staticprivateinherited

Checks whether the signature appears valid.

Do not try to call preflight2 from preflight() in derived classes. See the description of invokePreflight for details.

Definition at line 193 of file Transactor.cpp.

Member Data Documentation

◆ ConsequencesFactory

constexpr ConsequencesFactoryType xrpl::EscrowCreate::ConsequencesFactory {Custom}
staticconstexpr

Definition at line 10 of file tx/transactors/escrow/EscrowCreate.h.

◆ ctx_

ApplyContext& xrpl::Transactor::ctx_
protectedinherited

Definition at line 112 of file Transactor.h.

◆ sink_

beast::WrappedSink xrpl::Transactor::sink_
protectedinherited

Definition at line 113 of file Transactor.h.

◆ j_

beast::Journal const xrpl::Transactor::j_
protectedinherited

Definition at line 114 of file Transactor.h.

◆ account_

AccountID const xrpl::Transactor::account_
protectedinherited

Definition at line 116 of file Transactor.h.

◆ preFeeBalance_

XRPAmount xrpl::Transactor::preFeeBalance_ {}
protectedinherited

Definition at line 117 of file Transactor.h.