pub trait TransactionPool<H, B>: Send + Syncwhere
H: ExHashT,
B: Block,{
fn transactions(&self) -> Vec<(H, <B as Block>::Extrinsic), Global> ⓘ;
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 + 'static, Global>>;
fn on_broadcasted(
&self,
propagations: HashMap<H, Vec<String, Global>, RandomState>
);
fn transaction(&self, hash: &H) -> Option<<B as Block>::Extrinsic>;
}
Expand description
Transaction pool interface
Required Methods§
sourcefn transactions(&self) -> Vec<(H, <B as Block>::Extrinsic), Global> ⓘ
fn transactions(&self) -> Vec<(H, <B as Block>::Extrinsic), Global> ⓘ
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 + 'static, Global>>
fn import(
&self,
transaction: <B as Block>::Extrinsic
) -> Pin<Box<dyn Future<Output = TransactionImport> + Send + 'static, Global>>
Import a transaction into the pool.
This will return future.
sourcefn on_broadcasted(
&self,
propagations: HashMap<H, Vec<String, Global>, RandomState>
)
fn on_broadcasted(
&self,
propagations: HashMap<H, Vec<String, Global>, RandomState>
)
Notify the pool about transactions broadcast.