Trait sc_transaction_pool_api::TransactionPool[][src]

pub trait TransactionPool: Send + Sync {
    type Block: BlockT;
    type Hash: Hash + Eq + Member + Serialize;
    type InPoolTransaction: InPoolTransaction<Transaction = TransactionFor<Self>, Hash = TxHash<Self>>;
    type Error: From<Error> + IntoPoolError;
    fn submit_at(
        at: &BlockId<Self::Block>,
        source: TransactionSource,
        xts: Vec<TransactionFor<Self>>
    ) -> PoolFuture<Vec<Result<TxHash<Self>, Self::Error>>, Self::Error>;
fn submit_one(
        at: &BlockId<Self::Block>,
        source: TransactionSource,
        xt: TransactionFor<Self>
    ) -> PoolFuture<TxHash<Self>, Self::Error>;
fn submit_and_watch(
        at: &BlockId<Self::Block>,
        source: TransactionSource,
        xt: TransactionFor<Self>
    ) -> PoolFuture<Pin<Box<TransactionStatusStreamFor<Self>>>, Self::Error>;
fn ready_at(
        at: NumberFor<Self::Block>
    ) -> Pin<Box<dyn Future<Output = Box<dyn ReadyTransactions<Item = Arc<Self::InPoolTransaction>> + Send>> + Send>>;
fn ready(
    ) -> Box<dyn ReadyTransactions<Item = Arc<Self::InPoolTransaction>> + Send>
Notable traits for Box<R, Global>
impl<R> Read for Box<R, Global> where
    R: Read + ?Sized
impl<W> Write for Box<W, Global> where
    W: Write + ?Sized
impl<F, A> Future for Box<F, A> where
    F: Future + Unpin + ?Sized,
    A: Allocator + 'static, 
type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
    I: Iterator + ?Sized,
    A: Allocator
type Item = <I as Iterator>::Item;
fn remove_invalid(
        hashes: &[TxHash<Self>]
    ) -> Vec<Arc<Self::InPoolTransaction>>
Notable traits for Vec<u8, A>
impl<A> Write for Vec<u8, A> where
    A: Allocator
fn status(&self) -> PoolStatus;
fn import_notification_stream(
    ) -> ImportNotificationStream<TxHash<Self>>;
fn on_broadcasted(&self, propagations: HashMap<TxHash<Self>, Vec<String>>);
fn hash_of(&self, xt: &TransactionFor<Self>) -> TxHash<Self>;
fn ready_transaction(
        hash: &TxHash<Self>
    ) -> Option<Arc<Self::InPoolTransaction>>; }
Expand description

Transaction pool interface.

Associated Types

Block type.

Transaction hash type.

In-pool transaction type.

Error type.

Required methods

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

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

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

Get an iterator for ready transactions ordered by priority.

Guarantees to return only when transaction pool got updated at at block. Guarantees to return immediately when None is passed.

Get an iterator for ready transactions ordered by priority.

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

Returns pool status.

Return an event stream of transactions imported to the pool.

Notify the pool about transactions broadcast.

Returns transaction hash

Return specific ready transaction by hash, if there is one.