pub type TransactionPoolHandle<Block, Client> = TransactionPoolWrapper<Block, Client>;
Expand description
The public type alias for the actual type providing the implementation of
FullClientTransactionPool
with the given Client
and Block
types.
This handle abstracts away the specific type of the transaction pool. Should be used externally to keep reference to transaction pool.
Aliased Type§
struct TransactionPoolHandle<Block, Client>(pub Box<dyn FullClientTransactionPool<Block, Client, Block = Block, InPoolTransaction = Transaction<<<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Hash, Arc<<<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Extrinsic>>, Block = Block, Hash = <<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Hash, Error = <FullChainApi<Client, Block> as ChainApi>::Error, Hash = <<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Hash, Error = <FullChainApi<Client, Block> as ChainApi>::Error>>);
Fields§
§0: Box<dyn FullClientTransactionPool<Block, Client, Block = Block, InPoolTransaction = Transaction<<<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Hash, Arc<<<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Extrinsic>>, Block = Block, Hash = <<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Hash, Error = <FullChainApi<Client, Block> as ChainApi>::Error, Hash = <<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Hash, Error = <FullChainApi<Client, Block> as ChainApi>::Error>>
Trait Implementations
Source§impl<Block, Client> LocalTransactionPool for TransactionPoolWrapper<Block, Client>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + BlockIdTo<Block> + HeaderMetadata<Block, Error = Error> + 'static,
Client::Api: TaggedTransactionQueue<Block>,
impl<Block, Client> LocalTransactionPool for TransactionPoolWrapper<Block, Client>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + BlockIdTo<Block> + HeaderMetadata<Block, Error = Error> + 'static,
Client::Api: TaggedTransactionQueue<Block>,
Source§type Hash = <<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Hash
type Hash = <<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Hash
Transaction hash type.
Source§fn submit_local(
&self,
at: <Self::Block as BlockT>::Hash,
xt: LocalTransactionFor<Self>,
) -> Result<Self::Hash, Self::Error>
fn submit_local( &self, at: <Self::Block as BlockT>::Hash, xt: LocalTransactionFor<Self>, ) -> Result<Self::Hash, Self::Error>
Submits the given local unverified transaction to the pool blocking the
current thread for any necessary pre-verification.
NOTE: It MUST NOT be used for transactions that originate from the
network or RPC, since the validation is performed with
TransactionSource::Local
.Source§impl<Block, Client> MaintainedTransactionPool for TransactionPoolWrapper<Block, Client>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + BlockIdTo<Block> + HeaderMetadata<Block, Error = Error> + 'static,
Client::Api: TaggedTransactionQueue<Block>,
impl<Block, Client> MaintainedTransactionPool for TransactionPoolWrapper<Block, Client>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + BlockIdTo<Block> + HeaderMetadata<Block, Error = Error> + 'static,
Client::Api: TaggedTransactionQueue<Block>,
Source§impl<Block, Client> TransactionPool for TransactionPoolWrapper<Block, Client>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + BlockIdTo<Block> + HeaderMetadata<Block, Error = Error> + 'static,
Client::Api: TaggedTransactionQueue<Block>,
impl<Block, Client> TransactionPool for TransactionPoolWrapper<Block, Client>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + BlockIdTo<Block> + HeaderMetadata<Block, Error = Error> + 'static,
Client::Api: TaggedTransactionQueue<Block>,
Source§type Hash = <<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Hash
type Hash = <<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Hash
Transaction hash type.
Source§type InPoolTransaction = Transaction<<<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Hash, Arc<<<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Extrinsic>>
type InPoolTransaction = Transaction<<<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Hash, Arc<<<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Extrinsic>>
In-pool transaction type.
Source§fn submit_at<'life0, 'async_trait>(
&'life0 self,
at: <Self::Block as BlockT>::Hash,
source: TransactionSource,
xts: Vec<TransactionFor<Self>>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Result<TxHash<Self>, Self::Error>>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_at<'life0, 'async_trait>(
&'life0 self,
at: <Self::Block as BlockT>::Hash,
source: TransactionSource,
xts: Vec<TransactionFor<Self>>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Result<TxHash<Self>, Self::Error>>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Asynchronously imports a bunch of unverified transactions to the pool.
Source§fn submit_one<'life0, 'async_trait>(
&'life0 self,
at: <Self::Block as BlockT>::Hash,
source: TransactionSource,
xt: TransactionFor<Self>,
) -> Pin<Box<dyn Future<Output = Result<TxHash<Self>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_one<'life0, 'async_trait>(
&'life0 self,
at: <Self::Block as BlockT>::Hash,
source: TransactionSource,
xt: TransactionFor<Self>,
) -> Pin<Box<dyn Future<Output = Result<TxHash<Self>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Asynchronously imports one unverified transaction to the pool.
Source§fn submit_and_watch<'life0, 'async_trait>(
&'life0 self,
at: <Self::Block as BlockT>::Hash,
source: TransactionSource,
xt: TransactionFor<Self>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<TransactionStatusStreamFor<Self>>>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn submit_and_watch<'life0, 'async_trait>(
&'life0 self,
at: <Self::Block as BlockT>::Hash,
source: TransactionSource,
xt: TransactionFor<Self>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<TransactionStatusStreamFor<Self>>>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Asynchronously imports a single transaction and starts to watch their progress in the
pool.
Source§fn ready_at<'life0, 'async_trait>(
&'life0 self,
at: <Self::Block as BlockT>::Hash,
) -> Pin<Box<dyn Future<Output = Box<dyn ReadyTransactions<Item = Arc<Transaction<<<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Hash, Arc<<<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Extrinsic>>>> + Send>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ready_at<'life0, 'async_trait>(
&'life0 self,
at: <Self::Block as BlockT>::Hash,
) -> Pin<Box<dyn Future<Output = Box<dyn ReadyTransactions<Item = Arc<Transaction<<<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Hash, Arc<<<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Extrinsic>>>> + Send>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get an iterator for ready transactions ordered by priority. Read more
Source§fn ready(
&self,
) -> Box<dyn ReadyTransactions<Item = Arc<Self::InPoolTransaction>> + Send>
fn ready( &self, ) -> Box<dyn ReadyTransactions<Item = Arc<Self::InPoolTransaction>> + Send>
Get an iterator for ready transactions ordered by priority.
Source§fn report_invalid<'life0, 'async_trait>(
&'life0 self,
at: Option<<Self::Block as BlockT>::Hash>,
invalid_tx_errors: TxInvalidityReportMap<TxHash<Self>>,
) -> Pin<Box<dyn Future<Output = Vec<Arc<Self::InPoolTransaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn report_invalid<'life0, 'async_trait>(
&'life0 self,
at: Option<<Self::Block as BlockT>::Hash>,
invalid_tx_errors: TxInvalidityReportMap<TxHash<Self>>,
) -> Pin<Box<dyn Future<Output = Vec<Arc<Self::InPoolTransaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reports invalid transactions to the transaction pool. Read more
Source§fn import_notification_stream(&self) -> ImportNotificationStream<TxHash<Self>>
fn import_notification_stream(&self) -> ImportNotificationStream<TxHash<Self>>
Return an event stream of transactions imported to the pool.
Source§fn on_broadcasted(&self, propagations: HashMap<TxHash<Self>, Vec<String>>)
fn on_broadcasted(&self, propagations: HashMap<TxHash<Self>, Vec<String>>)
Notify the pool about transactions broadcast.
Source§fn ready_transaction(
&self,
hash: &TxHash<Self>,
) -> Option<Arc<Self::InPoolTransaction>>
fn ready_transaction( &self, hash: &TxHash<Self>, ) -> Option<Arc<Self::InPoolTransaction>>
Return specific ready transaction by hash, if there is one.
Source§fn ready_at_with_timeout<'life0, 'async_trait>(
&'life0 self,
at: <Self::Block as BlockT>::Hash,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Box<dyn ReadyTransactions<Item = Arc<Transaction<<<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Hash, Arc<<<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Extrinsic>>>> + Send>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ready_at_with_timeout<'life0, 'async_trait>(
&'life0 self,
at: <Self::Block as BlockT>::Hash,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Box<dyn ReadyTransactions<Item = Arc<Transaction<<<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Hash, Arc<<<FullChainApi<Client, Block> as ChainApi>::Block as Block>::Extrinsic>>>> + Send>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Asynchronously returns a set of ready transaction at given block within given timeout. Read more