mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 15:51:12 +00:00
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:
@@ -18,7 +18,7 @@ async-trait = "0.1.42"
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] }
|
||||
futures = { version = "0.3.1", features = ["thread-pool"] }
|
||||
log = "0.4.8"
|
||||
sp-core = { path= "../../core", version = "4.0.0-dev"}
|
||||
sp-core = { path = "../../core", version = "4.0.0-dev"}
|
||||
sp-inherents = { version = "4.0.0-dev", path = "../../inherents" }
|
||||
sp-state-machine = { version = "0.10.0-dev", path = "../../state-machine" }
|
||||
futures-timer = "3.0.1"
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user