mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
Move spawning tasks from thread pools to Service's TaskManager for block importing (#5647)
Co-Authored-By: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
//! A manual sealing engine: the engine listens for rpc calls to seal blocks and create forks.
|
||||
//! This is suitable for a testing environment.
|
||||
|
||||
use futures::prelude::*;
|
||||
use futures::{prelude::*, future::BoxFuture};
|
||||
use sp_consensus::{
|
||||
Environment, Proposer, ForkChoiceStrategy, BlockImportParams, BlockOrigin, SelectChain,
|
||||
import_queue::{BasicQueue, CacheKeyId, Verifier, BoxBlockImport},
|
||||
@@ -67,7 +67,8 @@ impl<B: BlockT> Verifier<B> for ManualSealVerifier {
|
||||
|
||||
/// Instantiate the import queue for the manual seal consensus engine.
|
||||
pub fn import_queue<Block, B>(
|
||||
block_import: BoxBlockImport<Block, TransactionFor<B, Block>>
|
||||
block_import: BoxBlockImport<Block, TransactionFor<B, Block>>,
|
||||
spawner: impl Fn(BoxFuture<'static, ()>) -> ()
|
||||
) -> BasicQueue<Block, TransactionFor<B, Block>>
|
||||
where
|
||||
Block: BlockT,
|
||||
@@ -78,6 +79,7 @@ pub fn import_queue<Block, B>(
|
||||
Box::new(block_import),
|
||||
None,
|
||||
None,
|
||||
spawner,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user