pub trait TransactionPool<H: ExHashT, B: BlockT>: Send + Sync {
    // Required methods
    fn transactions(&self) -> Vec<(H, B::Extrinsic)>;
    fn hash_of(&self, transaction: &B::Extrinsic) -> H;
    fn import(&self, transaction: B::Extrinsic) -> TransactionImportFuture;
    fn on_broadcasted(&self, propagations: HashMap<H, Vec<String>>);
    fn transaction(&self, hash: &H) -> Option<B::Extrinsic>;
}
Expand description

Transaction pool interface

Required Methods§

source

fn transactions(&self) -> Vec<(H, B::Extrinsic)>

Get transactions from the pool that are ready to be propagated.

source

fn hash_of(&self, transaction: &B::Extrinsic) -> H

Get hash of transaction.

source

fn import(&self, transaction: B::Extrinsic) -> TransactionImportFuture

Import a transaction into the pool.

This will return future.

source

fn on_broadcasted(&self, propagations: HashMap<H, Vec<String>>)

Notify the pool about transactions broadcast.

source

fn transaction(&self, hash: &H) -> Option<B::Extrinsic>

Get transaction by hash.

Implementors§

source§

impl<H: ExHashT + Default, B: BlockT> TransactionPool<H, B> for EmptyTransactionPool

impl<B, H, C, Pool, E> TransactionPool<H, B> for TransactionPoolAdapter<C, Pool>
where C: HeaderBackend<B> + BlockBackend<B> + HeaderMetadata<B, Error = Error> + ProofProvider<B> + Send + Sync + 'static, Pool: 'static + TransactionPool<Block = B, Hash = H, Error = E>, B: BlockT, H: Hash + Eq + Member + MaybeSerialize, E: 'static + IntoPoolError + From<Error>,