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
@@ -64,7 +64,7 @@ use sp_consensus::{BlockOrigin, BlockStatus, Error as ConsensusError};
use sp_core::{
convert_hash,
storage::{well_known_keys, ChildInfo, PrefixedStorageKey, StorageData, StorageKey},
ChangesTrieConfiguration, ExecutionContext, NativeOrEncoded,
ChangesTrieConfiguration, NativeOrEncoded,
};
#[cfg(feature = "test-helpers")]
use sp_keystore::SyncCryptoStorePtr;
@@ -958,11 +958,7 @@ where
// block.
(true, None, Some(ref body)) => {
let runtime_api = self.runtime_api();
let execution_context = if import_block.origin == BlockOrigin::NetworkInitialSync {
ExecutionContext::Syncing
} else {
ExecutionContext::Importing
};
let execution_context = import_block.origin.into();
runtime_api.execute_block_with_context(
&at,