mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 05:51:02 +00:00
Pool: parallel ready and runtime changes (#922)
* Revert "Revert runtime changes." This reverts commit 01a7d1aa83c2918dd63b7dc54eb688d544cfc649. * Parallel queue reads. * Avoid recursion in best iterator.
This commit is contained in:
@@ -393,13 +393,13 @@ impl<C: Components> TransactionPoolAdapter<C> {
|
||||
|
||||
impl<C: Components> network::TransactionPool<ComponentExHash<C>, ComponentBlock<C>> for TransactionPoolAdapter<C> {
|
||||
fn transactions(&self) -> Vec<(ComponentExHash<C>, ComponentExtrinsic<C>)> {
|
||||
self.pool.ready(|pending| pending
|
||||
self.pool.ready()
|
||||
.map(|t| {
|
||||
let hash = t.hash.clone();
|
||||
let ex: ComponentExtrinsic<C> = t.data.clone();
|
||||
(hash, ex)
|
||||
})
|
||||
.collect())
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn import(&self, transaction: &ComponentExtrinsic<C>) -> Option<ComponentExHash<C>> {
|
||||
|
||||
@@ -247,7 +247,7 @@ where
|
||||
let best_block = BlockId::number(first_service.client().info().unwrap().chain.best_number);
|
||||
first_service.transaction_pool().submit_one(&best_block, extrinsic_factory(&first_service)).unwrap();
|
||||
network.run_until_all_full(|_index, service|
|
||||
service.transaction_pool().all(usize::max_value()).len() == 1
|
||||
service.transaction_pool().ready().count() == 1
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user