Pass relay parent as argument when collating (#1789)

This pr changes the collation function to also pass the current relay
parent the parachain block should be build on.
This commit is contained in:
Bastian Köcher
2020-10-06 20:37:19 +02:00
committed by GitHub
parent d00bdfef08
commit 325c24580e
4 changed files with 12 additions and 5 deletions
+5 -1
View File
@@ -285,7 +285,11 @@ pub struct CollationGenerationConfig {
/// Collator's authentication key, so it can sign things.
pub key: CollatorPair,
/// Collation function.
pub collator: Box<dyn Fn(&ValidationData) -> Box<dyn Future<Output = Option<Collation>> + Unpin + Send> + Send + Sync>,
///
/// 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>,
/// The parachain that this collator collates for
pub para_id: ParaId,
}