pub trait TransactionPool<H, B>: Send + Sync{
// 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§
Sourcefn transactions(&self) -> Vec<(H, Arc<<B as Block>::Extrinsic>)>
fn transactions(&self) -> Vec<(H, Arc<<B as Block>::Extrinsic>)>
Get transactions from the pool that are ready to be propagated.
Sourcefn import(
&self,
transaction: <B as Block>::Extrinsic,
) -> Pin<Box<dyn Future<Output = TransactionImport> + Send>>
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.
Sourcefn on_broadcasted(&self, propagations: HashMap<H, Vec<String>>)
fn on_broadcasted(&self, propagations: HashMap<H, Vec<String>>)
Notify the pool about transactions broadcast.