Use correct ExecutionContext for check_inherents (#9483)

Before we used the `other` context, while we are actually either in the
import or sync context.
This commit is contained in:
Bastian Köcher
2021-08-03 13:12:21 +02:00
committed by GitHub
parent 0240efde58
commit 3b471704d9
6 changed files with 25 additions and 12 deletions
@@ -75,6 +75,16 @@ pub enum BlockOrigin {
File,
}
impl From<BlockOrigin> for sp_core::ExecutionContext {
fn from(origin: BlockOrigin) -> Self {
if origin == BlockOrigin::NetworkInitialSync {
sp_core::ExecutionContext::Syncing
} else {
sp_core::ExecutionContext::Importing
}
}
}
/// Environment for a Consensus instance.
///
/// Creates proposer instance.