pub trait TransactionPool<H: ExHashT, B: BlockT>: Send + Sync {
// Required methods
fn transactions(&self) -> Vec<(H, Arc<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<Arc<B::Extrinsic>>;
}
Expand description
Transaction pool interface
Required Methods§
Sourcefn transactions(&self) -> Vec<(H, Arc<B::Extrinsic>)>
fn transactions(&self) -> Vec<(H, Arc<B::Extrinsic>)>
Get transactions from the pool that are ready to be propagated.
Sourcefn import(&self, transaction: B::Extrinsic) -> TransactionImportFuture
fn import(&self, transaction: B::Extrinsic) -> TransactionImportFuture
Import a transaction into the pool.
This will return future.
Sourcefn on_broadcasted(&self, propagations: HashMap<H, Vec<String>>)
fn on_broadcasted(&self, propagations: HashMap<H, Vec<String>>)
Notify the pool about transactions broadcast.
Sourcefn transaction(&self, hash: &H) -> Option<Arc<B::Extrinsic>>
fn transaction(&self, hash: &H) -> Option<Arc<B::Extrinsic>>
Get transaction by hash.