Use Pin<Box<>> for collation future (#1792)

This commit is contained in:
Bastian Köcher
2020-10-07 13:29:00 +02:00
committed by GitHub
parent 7f4646505a
commit 2b798f8571
4 changed files with 5 additions and 4 deletions
+2 -1
View File
@@ -35,6 +35,7 @@ use polkadot_statement_table::{
},
v1::Misbehavior as TableMisbehavior,
};
use std::pin::Pin;
pub use sp_core::traits::SpawnNamed;
@@ -289,7 +290,7 @@ pub struct CollationGenerationConfig {
/// Will be called with the hash of the relay chain block the parachain
/// block should be build on and the [`ValidationData`] that provides
/// information about the state of the parachain on the relay chain.
pub collator: Box<dyn Fn(Hash, &ValidationData) -> Box<dyn Future<Output = Option<Collation>> + Unpin + Send> + Send + Sync>,
pub collator: Box<dyn Fn(Hash, &ValidationData) -> Pin<Box<dyn Future<Output = Option<Collation>> + Send>> + Send + Sync>,
/// The parachain that this collator collates for
pub para_id: ParaId,
}