Refactor BlockImportParams to be non_exhaustive (#4936)

* Refactor BlockImportParams to be non_exhaustive

* Fix cargo check compile
This commit is contained in:
Wei Tang
2020-02-17 10:18:53 +01:00
committed by GitHub
parent 625e963aa2
commit c7b09b642a
16 changed files with 186 additions and 437 deletions
+6 -14
View File
@@ -85,21 +85,13 @@ impl<B: BlockT> Verifier<B> for PassThroughVerifier {
.or_else(|| l.try_as_raw(OpaqueDigestItemId::Consensus(b"babe")))
)
.map(|blob| vec![(well_known_cache_keys::AUTHORITIES, blob.to_vec())]);
let mut import = BlockImportParams::new(origin, header);
import.body = body;
import.finalized = self.0;
import.justification = justification;
import.fork_choice = Some(ForkChoiceStrategy::LongestChain);
Ok((BlockImportParams {
origin,
header,
body,
storage_changes: None,
finalized: self.0,
justification,
post_digests: vec![],
auxiliary: Vec::new(),
intermediates: Default::default(),
fork_choice: Some(ForkChoiceStrategy::LongestChain),
allow_missing_state: false,
import_existing: false,
}, maybe_keys))
Ok((import, maybe_keys))
}
}