Kagome
Polkadot Runtime Engine in C++17
kagome::transaction_pool::TransactionPool Class Referenceabstract

#include <transaction_pool.hpp>

Inheritance diagram for kagome::transaction_pool::TransactionPool:
Collaboration diagram for kagome::transaction_pool::TransactionPool:

Classes

struct  Limits
 
struct  Status
 

Public Member Functions

virtual ~TransactionPool ()=default
 
virtual const std::unordered_map< Transaction::Hash, std::shared_ptr< Transaction > > & getPendingTransactions () const =0
 
virtual outcome::result< Transaction::Hash > submitExtrinsic (primitives::TransactionSource source, primitives::Extrinsic extrinsic)=0
 
virtual outcome::result< void > submitOne (Transaction &&tx)=0
 
virtual outcome::result< Transaction > removeOne (const Transaction::Hash &txHash)=0
 
virtual std::map< Transaction::Hash, std::shared_ptr< Transaction > > getReadyTransactions () const =0
 
virtual outcome::result< std::vector< Transaction > > removeStale (const primitives::BlockId &at)=0
 
virtual Status getStatus () const =0
 
virtual outcome::result< primitives::TransactionconstructTransaction (primitives::TransactionSource source, primitives::Extrinsic extrinsic) const =0
 

Detailed Description

Definition at line 19 of file transaction_pool.hpp.


Class Documentation

struct kagome::transaction_pool::TransactionPool::Status

Definition at line 88 of file transaction_pool.hpp.

Collaboration diagram for kagome::transaction_pool::TransactionPool::Status:
Class Members
size_t ready_num
size_t waiting_num

Constructor & Destructor Documentation

virtual kagome::transaction_pool::TransactionPool::~TransactionPool ( )
virtualdefault

Member Function Documentation

virtual outcome::result<primitives::Transaction> kagome::transaction_pool::TransactionPool::constructTransaction ( primitives::TransactionSource  source,
primitives::Extrinsic  extrinsic 
) const
pure virtual
virtual const std::unordered_map<Transaction::Hash, std::shared_ptr<Transaction> >& kagome::transaction_pool::TransactionPool::getPendingTransactions ( ) const
pure virtual
Returns
pending transactions

Implemented in kagome::transaction_pool::TransactionPoolImpl.

virtual std::map<Transaction::Hash, std::shared_ptr<Transaction> > kagome::transaction_pool::TransactionPool::getReadyTransactions ( ) const
pure virtual
Returns
transactions ready to included in the next block

Implemented in kagome::transaction_pool::TransactionPoolImpl.

virtual Status kagome::transaction_pool::TransactionPool::getStatus ( ) const
pure virtual
virtual outcome::result<Transaction> kagome::transaction_pool::TransactionPool::removeOne ( const Transaction::Hash &  txHash)
pure virtual

Remove transaction from the pool

Parameters
txHash- hash of the removed transaction
Returns
removed transaction or error

Implemented in kagome::transaction_pool::TransactionPoolImpl.

virtual outcome::result<std::vector<Transaction> > kagome::transaction_pool::TransactionPool::removeStale ( const primitives::BlockId at)
pure virtual

Remove from the pool and temporarily ban transactions which longevity is expired

Parameters
ata block that is considered current for removal (transaction t is banned if 'block number when t got to pool' + 't.longevity' <= block number of at)
Returns
removed transactions

Implemented in kagome::transaction_pool::TransactionPoolImpl.

virtual outcome::result<Transaction::Hash> kagome::transaction_pool::TransactionPool::submitExtrinsic ( primitives::TransactionSource  source,
primitives::Extrinsic  extrinsic 
)
pure virtual

Builds and validates transaction for provided extrinsic, and submit result transaction into pool

Parameters
sourcehow extrinsic was received (for example external or submitted through offchain worker)
extrinsicset of bytes representing either transaction or inherent
Returns
hash of successfully submitted transaction or error if state is invalid or unknown

Implemented in kagome::transaction_pool::TransactionPoolImpl.

virtual outcome::result<void> kagome::transaction_pool::TransactionPool::submitOne ( Transaction &&  tx)
pure virtual

Import one verified transaction to the pool. If it has unresolved dependencies (requires tags of transactions that are not in the pool yet), it will wait in the pool until its dependencies are solved, in which case it becomes ready and may be pruned, or it is banned from the pool for some amount of time as its longevity is reached or the pool is overflown

Implemented in kagome::transaction_pool::TransactionPoolImpl.


The documentation for this class was generated from the following file: