rippled
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
ripple::Transaction Class Reference
Inheritance diagram for ripple::Transaction:
Inheritance graph
[legend]
Collaboration diagram for ripple::Transaction:
Collaboration graph
[legend]

Classes

struct  CurrentLedgerState
 
struct  Locator
 
struct  SubmitResult
 

Public Types

using pointer = std::shared_ptr< Transaction >
 
using ref = const pointer &
 

Public Member Functions

 Transaction (std::shared_ptr< STTx const > const &, std::string &, Application &) noexcept
 
std::shared_ptr< STTx const > const & getSTransaction ()
 
uint256 const & getID () const
 
LedgerIndex getLedger () const
 
bool isValidated () const
 
TransStatus getStatus () const
 
TER getResult ()
 
void setResult (TER terResult)
 
void setStatus (TransStatus status, std::uint32_t ledgerSeq)
 
void setStatus (TransStatus status)
 
void setLedger (LedgerIndex ledger)
 
void setApplying ()
 Set this flag once added to a batch. More...
 
bool getApplying ()
 Detect if transaction is being batched. More...
 
void clearApplying ()
 Indicate that transaction application has been attempted. More...
 
SubmitResult getSubmitResult () const
 getSubmitResult Return submit result More...
 
void clearSubmitResult ()
 clearSubmitResult Clear all flags in SubmitResult More...
 
void setApplied ()
 setApplied Set this flag once was applied to open ledger More...
 
void setQueued ()
 setQueued Set this flag once was put into heldtxns queue More...
 
void setBroadcast ()
 setBroadcast Set this flag once was broadcasted via network More...
 
void setKept ()
 setKept Set this flag once was put to localtxns queue More...
 
std::optional< CurrentLedgerStategetCurrentLedgerState () const
 getCurrentLedgerState Get current ledger state of transaction More...
 
void setCurrentLedgerState (LedgerIndex validatedLedger, XRPAmount fee, std::uint32_t accountSeq, std::uint32_t availableSeq)
 setCurrentLedgerState Set current ledger state of transaction More...
 
Json::Value getJson (JsonOptions options, bool binary=false) const
 
shared_from_this (T... args)
 
weak_from_this (T... args)
 

Static Public Member Functions

static Transaction::pointer transactionFromSQL (boost::optional< std::uint64_t > const &ledgerSeq, boost::optional< std::string > const &status, Blob const &rawTxn, Application &app)
 
static TransStatus sqlTransactionStatus (boost::optional< std::string > const &status)
 
static Locator locate (uint256 const &id, Application &app)
 
static std::variant< std::pair< std::shared_ptr< Transaction >, std::shared_ptr< TxMeta > >, TxSearchedload (uint256 const &id, Application &app, error_code_i &ec)
 
static std::variant< std::pair< std::shared_ptr< Transaction >, std::shared_ptr< TxMeta > >, TxSearchedload (uint256 const &id, Application &app, ClosedInterval< uint32_t > const &range, error_code_i &ec)
 

Static Private Member Functions

static std::variant< std::pair< std::shared_ptr< Transaction >, std::shared_ptr< TxMeta > >, TxSearchedload (uint256 const &id, Application &app, std::optional< ClosedInterval< uint32_t >> const &range, error_code_i &ec)
 
static auto & getCounter () noexcept
 

Private Attributes

uint256 mTransactionID
 
LedgerIndex mInLedger = 0
 
TransStatus mStatus = INVALID
 
TER mResult = temUNCERTAIN
 
bool mApplying = false
 
SubmitResult submitResult_
 different ways for transaction to be accepted More...
 
std::optional< CurrentLedgerStatecurrentLedgerState_
 
std::shared_ptr< STTx const > mTransaction
 
ApplicationmApp
 
beast::Journal j_
 

Detailed Description

Definition at line 61 of file Transaction.h.

Member Typedef Documentation

◆ pointer

Definition at line 65 of file Transaction.h.

◆ ref

Definition at line 66 of file Transaction.h.

Constructor & Destructor Documentation

◆ Transaction()

ripple::Transaction::Transaction ( std::shared_ptr< STTx const > const &  stx,
std::string reason,
Application app 
)
noexcept

Definition at line 38 of file Transaction.cpp.

Member Function Documentation

◆ transactionFromSQL()

Transaction::pointer ripple::Transaction::transactionFromSQL ( boost::optional< std::uint64_t > const &  ledgerSeq,
boost::optional< std::string > const &  status,
Blob const &  rawTxn,
Application app 
)
static

Definition at line 92 of file Transaction.cpp.

◆ sqlTransactionStatus()

TransStatus ripple::Transaction::sqlTransactionStatus ( boost::optional< std::string > const &  status)
static

Definition at line 69 of file Transaction.cpp.

◆ getSTransaction()

std::shared_ptr<STTx const> const& ripple::Transaction::getSTransaction ( )

Definition at line 88 of file Transaction.h.

◆ getID()

uint256 const& ripple::Transaction::getID ( ) const

Definition at line 94 of file Transaction.h.

◆ getLedger()

LedgerIndex ripple::Transaction::getLedger ( ) const

Definition at line 100 of file Transaction.h.

◆ isValidated()

bool ripple::Transaction::isValidated ( ) const

Definition at line 106 of file Transaction.h.

◆ getStatus()

TransStatus ripple::Transaction::getStatus ( ) const

Definition at line 112 of file Transaction.h.

◆ getResult()

TER ripple::Transaction::getResult ( )

Definition at line 118 of file Transaction.h.

◆ setResult()

void ripple::Transaction::setResult ( TER  terResult)

Definition at line 124 of file Transaction.h.

◆ setStatus() [1/2]

void ripple::Transaction::setStatus ( TransStatus  status,
std::uint32_t  ledgerSeq 
)

Definition at line 62 of file Transaction.cpp.

◆ setStatus() [2/2]

void ripple::Transaction::setStatus ( TransStatus  status)

Definition at line 133 of file Transaction.h.

◆ setLedger()

void ripple::Transaction::setLedger ( LedgerIndex  ledger)

Definition at line 139 of file Transaction.h.

◆ setApplying()

void ripple::Transaction::setApplying ( )

Set this flag once added to a batch.

Definition at line 148 of file Transaction.h.

◆ getApplying()

bool ripple::Transaction::getApplying ( )

Detect if transaction is being batched.

Returns
Whether transaction is being applied within a batch.

Definition at line 159 of file Transaction.h.

◆ clearApplying()

void ripple::Transaction::clearApplying ( )

Indicate that transaction application has been attempted.

Definition at line 168 of file Transaction.h.

◆ getSubmitResult()

SubmitResult ripple::Transaction::getSubmitResult ( ) const

getSubmitResult Return submit result

Returns
SubmitResult struct

Definition at line 208 of file Transaction.h.

◆ clearSubmitResult()

void ripple::Transaction::clearSubmitResult ( )

clearSubmitResult Clear all flags in SubmitResult

Definition at line 217 of file Transaction.h.

◆ setApplied()

void ripple::Transaction::setApplied ( )

setApplied Set this flag once was applied to open ledger

Definition at line 226 of file Transaction.h.

◆ setQueued()

void ripple::Transaction::setQueued ( )

setQueued Set this flag once was put into heldtxns queue

Definition at line 235 of file Transaction.h.

◆ setBroadcast()

void ripple::Transaction::setBroadcast ( )

setBroadcast Set this flag once was broadcasted via network

Definition at line 244 of file Transaction.h.

◆ setKept()

void ripple::Transaction::setKept ( )

setKept Set this flag once was put to localtxns queue

Definition at line 253 of file Transaction.h.

◆ getCurrentLedgerState()

std::optional<CurrentLedgerState> ripple::Transaction::getCurrentLedgerState ( ) const

getCurrentLedgerState Get current ledger state of transaction

Returns
Current ledger state

Definition at line 285 of file Transaction.h.

◆ setCurrentLedgerState()

void ripple::Transaction::setCurrentLedgerState ( LedgerIndex  validatedLedger,
XRPAmount  fee,
std::uint32_t  accountSeq,
std::uint32_t  availableSeq 
)

setCurrentLedgerState Set current ledger state of transaction

Parameters
validatedLedgerNumber of last validated ledger
feeminimum Fee required for the transaction
accountSeqFirst valid account sequence in current ledger
availableSeqFirst available sequence for the transaction

Definition at line 298 of file Transaction.h.

◆ getJson()

Json::Value ripple::Transaction::getJson ( JsonOptions  options,
bool  binary = false 
) const

Definition at line 168 of file Transaction.cpp.

◆ locate()

Transaction::Locator ripple::Transaction::locate ( uint256 const &  id,
Application app 
)
static

Definition at line 134 of file Transaction.cpp.

◆ load() [1/3]

std::variant< std::pair< std::shared_ptr< Transaction >, std::shared_ptr< TxMeta > >, TxSearched > ripple::Transaction::load ( uint256 const &  id,
Application app,
error_code_i ec 
)
static

Definition at line 114 of file Transaction.cpp.

◆ load() [2/3]

std::variant< std::pair< std::shared_ptr< Transaction >, std::shared_ptr< TxMeta > >, TxSearched > ripple::Transaction::load ( uint256 const &  id,
Application app,
ClosedInterval< uint32_t > const &  range,
error_code_i ec 
)
static

Definition at line 122 of file Transaction.cpp.

◆ load() [3/3]

std::variant< std::pair< std::shared_ptr< Transaction >, std::shared_ptr< TxMeta > >, TxSearched > ripple::Transaction::load ( uint256 const &  id,
Application app,
std::optional< ClosedInterval< uint32_t >> const &  range,
error_code_i ec 
)
staticprivate

Definition at line 150 of file Transaction.cpp.

◆ getCounter()

static auto& ripple::CountedObject< Transaction >::getCounter
staticprivatenoexceptinherited

Definition at line 128 of file CountedObject.h.

Member Data Documentation

◆ mTransactionID

uint256 ripple::Transaction::mTransactionID
private

Definition at line 387 of file Transaction.h.

◆ mInLedger

LedgerIndex ripple::Transaction::mInLedger = 0
private

Definition at line 389 of file Transaction.h.

◆ mStatus

TransStatus ripple::Transaction::mStatus = INVALID
private

Definition at line 390 of file Transaction.h.

◆ mResult

TER ripple::Transaction::mResult = temUNCERTAIN
private

Definition at line 391 of file Transaction.h.

◆ mApplying

bool ripple::Transaction::mApplying = false
private

Definition at line 392 of file Transaction.h.

◆ submitResult_

SubmitResult ripple::Transaction::submitResult_
private

different ways for transaction to be accepted

Definition at line 395 of file Transaction.h.

◆ currentLedgerState_

std::optional<CurrentLedgerState> ripple::Transaction::currentLedgerState_
private

Definition at line 397 of file Transaction.h.

◆ mTransaction

std::shared_ptr<STTx const> ripple::Transaction::mTransaction
private

Definition at line 399 of file Transaction.h.

◆ mApp

Application& ripple::Transaction::mApp
private

Definition at line 400 of file Transaction.h.

◆ j_

beast::Journal ripple::Transaction::j_
private

Definition at line 401 of file Transaction.h.