mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 08:47:57 +00:00
Fix try-runtime with create-snapshot (#13223)
* Fix try-runtime with create-snapshot * Apply review suggestions
This commit is contained in:
@@ -71,7 +71,7 @@ where
|
||||
|
||||
let executor = build_executor::<HostFns>(&shared);
|
||||
let _ = State::Live(command.from)
|
||||
.into_ext::<Block, HostFns>(&shared, &executor, Some(path.into()))
|
||||
.into_ext::<Block, HostFns>(&shared, &executor, Some(path.into()), false)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
|
||||
@@ -99,7 +99,7 @@ where
|
||||
HostFns: HostFunctions,
|
||||
{
|
||||
let executor = build_executor::<HostFns>(&shared);
|
||||
let ext = command.state.into_ext::<Block, HostFns>(&shared, &executor, None).await?;
|
||||
let ext = command.state.into_ext::<Block, HostFns>(&shared, &executor, None, true).await?;
|
||||
|
||||
// get the block number associated with this block.
|
||||
let block_ws_uri = command.block_ws_uri::<Block>();
|
||||
|
||||
@@ -137,7 +137,7 @@ where
|
||||
pallet: vec![],
|
||||
child_tree: true,
|
||||
});
|
||||
let ext = state.into_ext::<Block, HostFns>(&shared, &executor, None).await?;
|
||||
let ext = state.into_ext::<Block, HostFns>(&shared, &executor, None, true).await?;
|
||||
maybe_state_ext = Some(ext);
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ where
|
||||
{
|
||||
let executor = build_executor(&shared);
|
||||
// we first build the externalities with the remote code.
|
||||
let ext = command.state.into_ext::<Block, HostFns>(&shared, &executor, None).await?;
|
||||
let ext = command.state.into_ext::<Block, HostFns>(&shared, &executor, None, true).await?;
|
||||
|
||||
let header_ws_uri = command.header_ws_uri::<Block>();
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ where
|
||||
HostFns: HostFunctions,
|
||||
{
|
||||
let executor = build_executor(&shared);
|
||||
let ext = command.state.into_ext::<Block, HostFns>(&shared, &executor, None).await?;
|
||||
let ext = command.state.into_ext::<Block, HostFns>(&shared, &executor, None, true).await?;
|
||||
|
||||
let (_, encoded_result) = state_machine_call_with_proof::<Block, HostFns>(
|
||||
&ext,
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user