Trait sc_service::TransactionPool [−][src]
Transaction pool interface.
Associated Types
type Block: Block
[src]
Block type.
type Hash: Eq + Hash + Member + Serialize
[src]
Transaction hash type.
type InPoolTransaction: InPoolTransaction
[src]
In-pool transaction type.
type Error: IntoPoolError + From<Error>
[src]
Error type.
Required methods
pub fn submit_at(
&self,
at: &BlockId<Self::Block>,
source: TransactionSource,
xts: Vec<<Self::Block as Block>::Extrinsic, Global>
) -> Pin<Box<dyn Future<Output = Result<Vec<Result<Self::Hash, Self::Error>, Global>, Self::Error>> + 'static + Send, Global>>
[src]
&self,
at: &BlockId<Self::Block>,
source: TransactionSource,
xts: Vec<<Self::Block as Block>::Extrinsic, Global>
) -> Pin<Box<dyn Future<Output = Result<Vec<Result<Self::Hash, Self::Error>, Global>, Self::Error>> + 'static + Send, Global>>
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: <Self::Block as Block>::Extrinsic
) -> Pin<Box<dyn Future<Output = Result<Self::Hash, Self::Error>> + 'static + Send, Global>>
[src]
&self,
at: &BlockId<Self::Block>,
source: TransactionSource,
xt: <Self::Block as Block>::Extrinsic
) -> Pin<Box<dyn Future<Output = Result<Self::Hash, Self::Error>> + 'static + Send, Global>>
Returns a future that imports one unverified transaction to the pool.
pub fn submit_and_watch(
&self,
at: &BlockId<Self::Block>,
source: TransactionSource,
xt: <Self::Block as Block>::Extrinsic
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = TransactionStatus<Self::Hash, <Self::Block as Block>::Hash>> + 'static + Send + Unpin, Global>, Self::Error>> + 'static + Send, Global>>
[src]
&self,
at: &BlockId<Self::Block>,
source: TransactionSource,
xt: <Self::Block as Block>::Extrinsic
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = TransactionStatus<Self::Hash, <Self::Block as Block>::Hash>> + 'static + Send + Unpin, Global>, Self::Error>> + 'static + Send, Global>>
Returns a future that import a single transaction and starts to watch their progress in the pool.
pub fn ready_at(
&self,
at: <<Self::Block as Block>::Header as Header>::Number
) -> Pin<Box<dyn Future<Output = Box<dyn Iterator<Item = Arc<Self::InPoolTransaction>> + 'static + Send, Global>> + 'static + Send, Global>>
[src]
&self,
at: <<Self::Block as Block>::Header as Header>::Number
) -> Pin<Box<dyn Future<Output = Box<dyn Iterator<Item = Arc<Self::InPoolTransaction>> + 'static + Send, Global>> + 'static + Send, Global>>
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>> + 'static + Send, Global>
[src]
&self
) -> Box<dyn Iterator<Item = Arc<Self::InPoolTransaction>> + 'static + Send, Global>
Get an iterator for ready transactions ordered by priority.
pub fn remove_invalid(
&self,
hashes: &[Self::Hash]
) -> Vec<Arc<Self::InPoolTransaction>, Global>
[src]
&self,
hashes: &[Self::Hash]
) -> Vec<Arc<Self::InPoolTransaction>, Global>
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) -> Receiver<Self::Hash>
[src]
Return an event stream of transactions imported to the pool.
pub fn on_broadcasted(
&self,
propagations: HashMap<Self::Hash, Vec<String, Global>, RandomState>
)
[src]
&self,
propagations: HashMap<Self::Hash, Vec<String, Global>, RandomState>
)
Notify the pool about transactions broadcast.
pub fn hash_of(&self, xt: &<Self::Block as Block>::Extrinsic) -> Self::Hash
[src]
Returns transaction hash
pub fn ready_transaction(
&self,
hash: &Self::Hash
) -> Option<Arc<Self::InPoolTransaction>>
[src]
&self,
hash: &Self::Hash
) -> Option<Arc<Self::InPoolTransaction>>
Return specific ready transaction by hash, if there is one.
Implementations on Foreign Types
impl<PoolApi, Block> TransactionPool for BasicPool<PoolApi, Block> where
Block: Block,
PoolApi: 'static + ChainApi<Block = Block>,
[src]
Block: Block,
PoolApi: 'static + ChainApi<Block = Block>,
type Block = <PoolApi as ChainApi>::Block
type Hash = <<PoolApi as ChainApi>::Block as Block>::Hash
type InPoolTransaction = Transaction<<BasicPool<PoolApi, Block> as TransactionPool>::Hash, <<BasicPool<PoolApi, Block> as TransactionPool>::Block as Block>::Extrinsic>
type Error = <PoolApi as ChainApi>::Error
pub fn submit_at(
&self,
at: &BlockId<<BasicPool<PoolApi, Block> as TransactionPool>::Block>,
source: TransactionSource,
xts: Vec<<<BasicPool<PoolApi, Block> as TransactionPool>::Block as Block>::Extrinsic, Global>
) -> Pin<Box<dyn Future<Output = Result<Vec<Result<<BasicPool<PoolApi, Block> as TransactionPool>::Hash, <BasicPool<PoolApi, Block> as TransactionPool>::Error>, Global>, <BasicPool<PoolApi, Block> as TransactionPool>::Error>> + 'static + Send, Global>>
[src]
&self,
at: &BlockId<<BasicPool<PoolApi, Block> as TransactionPool>::Block>,
source: TransactionSource,
xts: Vec<<<BasicPool<PoolApi, Block> as TransactionPool>::Block as Block>::Extrinsic, Global>
) -> Pin<Box<dyn Future<Output = Result<Vec<Result<<BasicPool<PoolApi, Block> as TransactionPool>::Hash, <BasicPool<PoolApi, Block> as TransactionPool>::Error>, Global>, <BasicPool<PoolApi, Block> as TransactionPool>::Error>> + 'static + Send, Global>>
pub fn submit_one(
&self,
at: &BlockId<<BasicPool<PoolApi, Block> as TransactionPool>::Block>,
source: TransactionSource,
xt: <<BasicPool<PoolApi, Block> as TransactionPool>::Block as Block>::Extrinsic
) -> Pin<Box<dyn Future<Output = Result<<BasicPool<PoolApi, Block> as TransactionPool>::Hash, <BasicPool<PoolApi, Block> as TransactionPool>::Error>> + 'static + Send, Global>>
[src]
&self,
at: &BlockId<<BasicPool<PoolApi, Block> as TransactionPool>::Block>,
source: TransactionSource,
xt: <<BasicPool<PoolApi, Block> as TransactionPool>::Block as Block>::Extrinsic
) -> Pin<Box<dyn Future<Output = Result<<BasicPool<PoolApi, Block> as TransactionPool>::Hash, <BasicPool<PoolApi, Block> as TransactionPool>::Error>> + 'static + Send, Global>>
pub fn submit_and_watch(
&self,
at: &BlockId<<BasicPool<PoolApi, Block> as TransactionPool>::Block>,
source: TransactionSource,
xt: <<BasicPool<PoolApi, Block> as TransactionPool>::Block as Block>::Extrinsic
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = TransactionStatus<<BasicPool<PoolApi, Block> as TransactionPool>::Hash, <<BasicPool<PoolApi, Block> as TransactionPool>::Block as Block>::Hash>> + 'static + Send + Unpin, Global>, <BasicPool<PoolApi, Block> as TransactionPool>::Error>> + 'static + Send, Global>>
[src]
&self,
at: &BlockId<<BasicPool<PoolApi, Block> as TransactionPool>::Block>,
source: TransactionSource,
xt: <<BasicPool<PoolApi, Block> as TransactionPool>::Block as Block>::Extrinsic
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = TransactionStatus<<BasicPool<PoolApi, Block> as TransactionPool>::Hash, <<BasicPool<PoolApi, Block> as TransactionPool>::Block as Block>::Hash>> + 'static + Send + Unpin, Global>, <BasicPool<PoolApi, Block> as TransactionPool>::Error>> + 'static + Send, Global>>
pub fn remove_invalid(
&self,
hashes: &[<BasicPool<PoolApi, Block> as TransactionPool>::Hash]
) -> Vec<Arc<<BasicPool<PoolApi, Block> as TransactionPool>::InPoolTransaction>, Global>
[src]
&self,
hashes: &[<BasicPool<PoolApi, Block> as TransactionPool>::Hash]
) -> Vec<Arc<<BasicPool<PoolApi, Block> as TransactionPool>::InPoolTransaction>, Global>
pub fn status(&self) -> PoolStatus
[src]
pub fn import_notification_stream(
&self
) -> Receiver<<BasicPool<PoolApi, Block> as TransactionPool>::Hash>
[src]
&self
) -> Receiver<<BasicPool<PoolApi, Block> as TransactionPool>::Hash>
pub fn hash_of(
&self,
xt: &<<BasicPool<PoolApi, Block> as TransactionPool>::Block as Block>::Extrinsic
) -> <BasicPool<PoolApi, Block> as TransactionPool>::Hash
[src]
&self,
xt: &<<BasicPool<PoolApi, Block> as TransactionPool>::Block as Block>::Extrinsic
) -> <BasicPool<PoolApi, Block> as TransactionPool>::Hash
pub fn on_broadcasted(
&self,
propagations: HashMap<<BasicPool<PoolApi, Block> as TransactionPool>::Hash, Vec<String, Global>, RandomState>
)
[src]
&self,
propagations: HashMap<<BasicPool<PoolApi, Block> as TransactionPool>::Hash, Vec<String, Global>, RandomState>
)
pub fn ready_transaction(
&self,
hash: &<BasicPool<PoolApi, Block> as TransactionPool>::Hash
) -> Option<Arc<<BasicPool<PoolApi, Block> as TransactionPool>::InPoolTransaction>>
[src]
&self,
hash: &<BasicPool<PoolApi, Block> as TransactionPool>::Hash
) -> Option<Arc<<BasicPool<PoolApi, Block> as TransactionPool>::InPoolTransaction>>
pub fn ready_at(
&self,
at: <<<BasicPool<PoolApi, Block> as TransactionPool>::Block as Block>::Header as Header>::Number
) -> Pin<Box<dyn Future<Output = Box<dyn Iterator<Item = Arc<Transaction<<<PoolApi as ChainApi>::Block as Block>::Hash, <<PoolApi as ChainApi>::Block as Block>::Extrinsic>>> + 'static + Send, Global>> + 'static + Send, Global>>
[src]
&self,
at: <<<BasicPool<PoolApi, Block> as TransactionPool>::Block as Block>::Header as Header>::Number
) -> Pin<Box<dyn Future<Output = Box<dyn Iterator<Item = Arc<Transaction<<<PoolApi as ChainApi>::Block as Block>::Hash, <<PoolApi as ChainApi>::Block as Block>::Extrinsic>>> + 'static + Send, Global>> + 'static + Send, Global>>
pub fn ready(
&self
) -> Box<dyn Iterator<Item = Arc<Transaction<<<PoolApi as ChainApi>::Block as Block>::Hash, <<PoolApi as ChainApi>::Block as Block>::Extrinsic>>> + 'static + Send, Global>
[src]
&self
) -> Box<dyn Iterator<Item = Arc<Transaction<<<PoolApi as ChainApi>::Block as Block>::Hash, <<PoolApi as ChainApi>::Block as Block>::Extrinsic>>> + 'static + Send, Global>