mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 22:51:13 +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:
@@ -49,12 +49,13 @@ use sp_consensus::{
|
||||
SelectChain, Error as ConsensusError, CanAuthorWith, RecordProof, BlockImport,
|
||||
BlockCheckParams, ImportResult,
|
||||
};
|
||||
use sp_consensus::import_queue::{BoxBlockImport, BasicQueue, Verifier, BoxJustificationImport, BoxFinalityProofImport};
|
||||
use sp_consensus::import_queue::{
|
||||
BoxBlockImport, BasicQueue, Verifier, BoxJustificationImport, BoxFinalityProofImport,
|
||||
};
|
||||
use codec::{Encode, Decode};
|
||||
use sc_client_api;
|
||||
use log::*;
|
||||
use sp_timestamp::{InherentError as TIError, TimestampInherentData};
|
||||
use futures::future::BoxFuture;
|
||||
|
||||
#[derive(derive_more::Display, Debug)]
|
||||
pub enum Error<B: BlockT> {
|
||||
@@ -462,7 +463,7 @@ pub fn import_queue<B, Transaction, Algorithm>(
|
||||
finality_proof_import: Option<BoxFinalityProofImport<B>>,
|
||||
algorithm: Algorithm,
|
||||
inherent_data_providers: InherentDataProviders,
|
||||
spawner: impl Fn(BoxFuture<'static, ()>) -> (),
|
||||
spawner: &impl sp_core::traits::SpawnBlocking,
|
||||
) -> Result<
|
||||
PowImportQueue<B, Transaction>,
|
||||
sp_consensus::Error
|
||||
|
||||
Reference in New Issue
Block a user