Fix try-runtime with create-snapshot (#13223)

* Fix try-runtime with create-snapshot

* Apply review suggestions
This commit is contained in:
zjb0807
2023-01-26 12:12:19 +13:00
committed by GitHub
parent 1da71f0226
commit 73a9776266
6 changed files with 10 additions and 7 deletions
@@ -609,6 +609,7 @@ impl State {
shared: &SharedParams,
executor: &WasmExecutor<HostFns>,
state_snapshot: Option<SnapshotConfig>,
try_runtime_check: bool,
) -> sc_cli::Result<RemoteExternalities<Block>>
where
Block::Hash: FromStr,
@@ -707,8 +708,10 @@ impl State {
}
// whatever runtime we have in store now must have been compiled with try-runtime feature.
if !ensure_try_runtime::<Block, HostFns>(&executor, &mut ext) {
return Err("given runtime is NOT compiled with try-runtime feature!".into())
if try_runtime_check {
if !ensure_try_runtime::<Block, HostFns>(&executor, &mut ext) {
return Err("given runtime is NOT compiled with try-runtime feature!".into())
}
}
Ok(ext)