Skip to main content

TransactionPool

Trait TransactionPool 

Source
pub trait TransactionPool<H, B>: Send + Sync
where H: ExHashT, B: Block,
{ // Required methods fn transactions(&self) -> Vec<(H, Arc<<B as Block>::Extrinsic>)>; fn hash_of(&self, transaction: &<B as Block>::Extrinsic) -> H; fn import( &self, transaction: <B as Block>::Extrinsic, ) -> Pin<Box<dyn Future<Output = TransactionImport> + Send>>; fn on_broadcasted(&self, propagations: HashMap<H, Vec<String>>); fn transaction(&self, hash: &H) -> Option<Arc<<B as Block>::Extrinsic>>; }
Expand description

Transaction pool interface

Required Methods§

Source

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

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

Source

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

Get hash of transaction.

Source

fn import( &self, transaction: <B as Block>::Extrinsic, ) -> Pin<Box<dyn Future<Output = TransactionImport> + Send>>

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<Arc<<B as Block>::Extrinsic>>

Get transaction by hash.

Implementors§

Source§

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: Block, H: Hash + Eq + Member + MaybeSerialize, E: 'static + IntoPoolError + From<Error>,

Source§

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