mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 02:21:04 +00:00
Expose that BasicQueue expects blocking spawn (#5860)
* Expose that `BasicQueue` expects blocking spawn Up to now `BasicQueue` expected a closure that to spawn a `Future`. This was expected to be a closure that spawns a blocking future. However, this wasn't documented anywhere. This pr introduces a new trait `SpawnBlocking` that exposes this requirement to the outside. * Feedback
This commit is contained in:
@@ -28,6 +28,7 @@ sp-blockchain = { path = "../../../primitives/blockchain" , version = "2.0.0-dev
|
||||
sp-consensus = { package = "sp-consensus", path = "../../../primitives/consensus/common" , version = "0.8.0-dev"}
|
||||
sp-inherents = { path = "../../../primitives/inherents" , version = "2.0.0-dev"}
|
||||
sp-runtime = { path = "../../../primitives/runtime" , version = "2.0.0-dev"}
|
||||
sp-core = { path = "../../../primitives/core" , version = "2.0.0-dev"}
|
||||
sp-transaction-pool = { path = "../../../primitives/transaction-pool" , version = "2.0.0-dev"}
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@@ -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::*, future::BoxFuture};
|
||||
use futures::prelude::*;
|
||||
use sp_consensus::{
|
||||
Environment, Proposer, ForkChoiceStrategy, BlockImportParams, BlockOrigin, SelectChain,
|
||||
import_queue::{BasicQueue, CacheKeyId, Verifier, BoxBlockImport},
|
||||
@@ -68,7 +68,7 @@ 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>>,
|
||||
spawner: impl Fn(BoxFuture<'static, ()>) -> ()
|
||||
spawner: &impl sp_core::traits::SpawnBlocking,
|
||||
) -> BasicQueue<Block, TransactionFor<B, Block>>
|
||||
where
|
||||
Block: BlockT,
|
||||
|
||||
Reference in New Issue
Block a user