[][src]Trait sp_transaction_pool::TransactionPool

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;
    pub fn submit_at(
        &self,
        at: &BlockId<Self::Block>,
        source: TransactionSource,
        xts: Vec<TransactionFor<Self>>
    ) -> PoolFuture<Vec<Result<TxHash<Self>, Self::Error>>, Self::Error>;
pub fn submit_one(
        &self,
        at: &BlockId<Self::Block>,
        source: TransactionSource,
        xt: TransactionFor<Self>
    ) -> PoolFuture<TxHash<Self>, Self::Error>;
pub fn submit_and_watch(
        &self,
        at: &BlockId<Self::Block>,
        source: TransactionSource,
        xt: TransactionFor<Self>
    ) -> PoolFuture<Box<TransactionStatusStreamFor<Self>>, Self::Error>;
pub fn ready_at(
        &self,
        at: NumberFor<Self::Block>
    ) -> Pin<Box<dyn Future<Output = Box<dyn Iterator<Item = Arc<Self::InPoolTransaction>> + Send>> + Send>>;
pub fn ready(
        &self
    ) -> Box<dyn Iterator<Item = Arc<Self::InPoolTransaction>> + Send>;
pub fn remove_invalid(
        &self,
        hashes: &[TxHash<Self>]
    ) -> Vec<Arc<Self::InPoolTransaction>>;
pub fn status(&self) -> PoolStatus;
pub fn import_notification_stream(
        &self
    ) -> ImportNotificationStream<TxHash<Self>>;
pub fn on_broadcasted(
        &self,
        propagations: HashMap<TxHash<Self>, Vec<String>>
    );
pub fn hash_of(&self, xt: &TransactionFor<Self>) -> TxHash<Self>;
pub fn ready_transaction(
        &self,
        hash: &TxHash<Self>
    ) -> Option<Arc<Self::InPoolTransaction>>; }

Transaction pool interface.

Associated Types

type Block: BlockT[src]

Block type.

type Hash: Hash + Eq + Member + Serialize[src]

Transaction hash type.

type InPoolTransaction: InPoolTransaction<Transaction = TransactionFor<Self>, Hash = TxHash<Self>>[src]

In-pool transaction type.

type Error: From<Error> + IntoPoolError[src]

Error type.

Loading content...

Required methods

pub fn submit_at(
    &self,
    at: &BlockId<Self::Block>,
    source: TransactionSource,
    xts: Vec<TransactionFor<Self>>
) -> PoolFuture<Vec<Result<TxHash<Self>, Self::Error>>, Self::Error>
[src]

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

pub fn submit_one(
    &self,
    at: &BlockId<Self::Block>,
    source: TransactionSource,
    xt: TransactionFor<Self>
) -> PoolFuture<TxHash<Self>, Self::Error>
[src]

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

pub fn submit_and_watch(
    &self,
    at: &BlockId<Self::Block>,
    source: TransactionSource,
    xt: TransactionFor<Self>
) -> PoolFuture<Box<TransactionStatusStreamFor<Self>>, Self::Error>
[src]

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

pub fn ready_at(
    &self,
    at: NumberFor<Self::Block>
) -> Pin<Box<dyn Future<Output = Box<dyn Iterator<Item = Arc<Self::InPoolTransaction>> + Send>> + Send>>
[src]

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.

pub fn ready(
    &self
) -> Box<dyn Iterator<Item = Arc<Self::InPoolTransaction>> + Send>
[src]

Get an iterator for ready transactions ordered by priority.

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

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

pub fn status(&self) -> PoolStatus[src]

Returns pool status.

pub fn import_notification_stream(
    &self
) -> ImportNotificationStream<TxHash<Self>>
[src]

Return an event stream of transactions imported to the pool.

pub fn on_broadcasted(&self, propagations: HashMap<TxHash<Self>, Vec<String>>)[src]

Notify the pool about transactions broadcast.

pub fn hash_of(&self, xt: &TransactionFor<Self>) -> TxHash<Self>[src]

Returns transaction hash

pub fn ready_transaction(
    &self,
    hash: &TxHash<Self>
) -> Option<Arc<Self::InPoolTransaction>>
[src]

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

Loading content...

Implementors

Loading content...