babe: pass epoch data via intermediates (#4807)

* babe: pass epoch data via intermediates

* Switch to use Box<dyn Any> for intermediates

* Set intermediate.epoch to be Option

* Fix proposer should put out an empty intermediate

* Remove unnecessary encode/decode

* Add EpochData to block_import_params in slot worker

* Fix aura compile

* Fix integration test
This commit is contained in:
Wei Tang
2020-02-06 18:52:30 +01:00
committed by GitHub
parent 4df27e760e
commit 14b0c9a746
7 changed files with 106 additions and 34 deletions
+3 -1
View File
@@ -81,7 +81,7 @@ pub trait SimpleSlotWorker<B: BlockT> {
type Claim: Send + 'static;
/// Epoch data necessary for authoring.
type EpochData;
type EpochData: Send + 'static;
/// The logging target to use when logging messages.
fn logging_target(&self) -> &'static str;
@@ -119,6 +119,7 @@ pub trait SimpleSlotWorker<B: BlockT> {
Vec<B::Extrinsic>,
StorageChanges<<Self::BlockImport as BlockImport<B>>::Transaction, B>,
Self::Claim,
Self::EpochData,
) -> sp_consensus::BlockImportParams<
B,
<Self::BlockImport as BlockImport<B>>::Transaction
@@ -280,6 +281,7 @@ pub trait SimpleSlotWorker<B: BlockT> {
body,
proposal.storage_changes,
claim,
epoch_data,
);
info!(