[][src]Trait sc_service::TransactionPool

pub trait TransactionPool: Send + Sync where
    <Self::InPoolTransaction as InPoolTransaction>::Transaction == <Self::Block as Block>::Extrinsic,
    <Self::InPoolTransaction as InPoolTransaction>::Hash == Self::Hash
{ type Block: Block; type Hash: Eq + Hash + Member + Serialize; type InPoolTransaction: InPoolTransaction; type Error: IntoPoolError + From<Error>; fn submit_at(
        &self,
        at: &BlockId<Self::Block>,
        xts: impl IntoIterator<Item = <Self::Block as Block>::Extrinsic> + 'static
    ) -> Box<dyn Future<Output = Result<Vec<Result<Self::Hash, Self::Error>>, Self::Error>> + 'static + Send + Unpin>;
fn submit_one(
        &self,
        at: &BlockId<Self::Block>,
        xt: <Self::Block as Block>::Extrinsic
    ) -> Box<dyn Future<Output = Result<Self::Hash, Self::Error>> + 'static + Send + Unpin>;
fn submit_and_watch(
        &self,
        at: &BlockId<Self::Block>,
        xt: <Self::Block as Block>::Extrinsic
    ) -> Box<dyn Future<Output = Result<Box<dyn Stream<Item = TransactionStatus<Self::Hash, <Self::Block as Block>::Hash>> + 'static + Send + Unpin>, Self::Error>> + 'static + Send + Unpin>;
fn remove_invalid(
        &self,
        hashes: &[Self::Hash]
    ) -> Vec<Arc<Self::InPoolTransaction>>;
fn status(&self) -> PoolStatus;
fn ready(
        &self
    ) -> Box<dyn Iterator<Item = Arc<Self::InPoolTransaction>> + 'static>;
fn import_notification_stream(&self) -> UnboundedReceiver<()>;
fn hash_of(&self, xt: &<Self::Block as Block>::Extrinsic) -> Self::Hash;
fn on_broadcasted(
        &self,
        propagations: HashMap<Self::Hash, Vec<String>, RandomState>
    ); }

Transaction pool interface.

Associated Types

type Block: Block

Block type.

type Hash: Eq + Hash + Member + Serialize

Transaction hash type.

type InPoolTransaction: InPoolTransaction

In-pool transaction type.

type Error: IntoPoolError + From<Error>

Error type.

Loading content...

Required methods

fn submit_at(
    &self,
    at: &BlockId<Self::Block>,
    xts: impl IntoIterator<Item = <Self::Block as Block>::Extrinsic> + 'static
) -> Box<dyn Future<Output = Result<Vec<Result<Self::Hash, Self::Error>>, Self::Error>> + 'static + Send + Unpin>

Returns a future that imports a bunch of unverified transactions to the pool.

fn submit_one(
    &self,
    at: &BlockId<Self::Block>,
    xt: <Self::Block as Block>::Extrinsic
) -> Box<dyn Future<Output = Result<Self::Hash, Self::Error>> + 'static + Send + Unpin>

Returns a future that imports one unverified transaction to the pool.

fn submit_and_watch(
    &self,
    at: &BlockId<Self::Block>,
    xt: <Self::Block as Block>::Extrinsic
) -> Box<dyn Future<Output = Result<Box<dyn Stream<Item = TransactionStatus<Self::Hash, <Self::Block as Block>::Hash>> + 'static + Send + Unpin>, Self::Error>> + 'static + Send + Unpin>

Returns a future that import a single transaction and starts to watch their progress in the pool.

fn remove_invalid(
    &self,
    hashes: &[Self::Hash]
) -> Vec<Arc<Self::InPoolTransaction>>

Remove transactions identified by given hashes (and dependent transactions) from the pool.

fn status(&self) -> PoolStatus

Returns pool status.

fn ready(
    &self
) -> Box<dyn Iterator<Item = Arc<Self::InPoolTransaction>> + 'static>

Get an iterator for ready transactions ordered by priority

fn import_notification_stream(&self) -> UnboundedReceiver<()>

Return an event stream of transactions imported to the pool.

fn hash_of(&self, xt: &<Self::Block as Block>::Extrinsic) -> Self::Hash

Returns transaction hash

fn on_broadcasted(
    &self,
    propagations: HashMap<Self::Hash, Vec<String>, RandomState>
)

Notify the pool about transactions broadcast.

Loading content...

Implementations on Foreign Types

impl<Pool, Maintainer> TransactionPool for MaintainableTransactionPool<Pool, Maintainer> where
    Maintainer: Send + Sync,
    Pool: TransactionPool
[src]

type Block = <Pool as TransactionPool>::Block

type Hash = <Pool as TransactionPool>::Hash

type InPoolTransaction = <Pool as TransactionPool>::InPoolTransaction

type Error = <Pool as TransactionPool>::Error

impl<PoolApi, Block> TransactionPool for BasicPool<PoolApi, Block> where
    Block: Block,
    PoolApi: 'static + ChainApi<Block = Block, Hash = <Block as Block>::Hash, Error = Error>, 
[src]

type Block = <PoolApi as ChainApi>::Block

type Hash = <PoolApi as ChainApi>::Hash

type InPoolTransaction = Transaction<<BasicPool<PoolApi, Block> as TransactionPool>::Hash, <<BasicPool<PoolApi, Block> as TransactionPool>::Block as Block>::Extrinsic>

type Error = Error

Loading content...

Implementors

Loading content...