6 #ifndef KAGOME_TRANSACTION_POOL_HPP 7 #define KAGOME_TRANSACTION_POOL_HPP 17 using primitives::Transaction;
30 std::shared_ptr<Transaction>>
54 virtual outcome::result<void>
submitOne(Transaction &&tx) = 0;
61 virtual outcome::result<Transaction>
removeOne(
62 const Transaction::Hash &txHash) = 0;
67 virtual std::map<Transaction::Hash, std::shared_ptr<Transaction>>
78 virtual outcome::result<std::vector<Transaction>>
removeStale(
94 static constexpr
size_t kDefaultMaxReadyNum = 128;
95 static constexpr
size_t kDefaultCapacity = 512;
97 size_t max_ready_num = kDefaultMaxReadyNum;
98 size_t capacity = kDefaultCapacity;
103 #endif // KAGOME_TRANSACTION_POOL_HPP virtual outcome::result< Transaction::Hash > submitExtrinsic(primitives::TransactionSource source, primitives::Extrinsic extrinsic)=0
virtual Status getStatus() const =0
virtual outcome::result< void > submitOne(Transaction &&tx)=0
virtual outcome::result< std::vector< Transaction > > removeStale(const primitives::BlockId &at)=0
virtual std::map< Transaction::Hash, std::shared_ptr< Transaction > > getReadyTransactions() const =0
virtual ~TransactionPool()=default
virtual outcome::result< Transaction > removeOne(const Transaction::Hash &txHash)=0
virtual const std::unordered_map< Transaction::Hash, std::shared_ptr< Transaction > > & getPendingTransactions() const =0
boost::variant< BlockHash, BlockNumber > BlockId
Block id is the variant over BlockHash and BlockNumber.
Extrinsic class represents extrinsic.
virtual outcome::result< primitives::Transaction > constructTransaction(primitives::TransactionSource source, primitives::Extrinsic extrinsic) const =0