try-runtime: add cli option --export-proof (#12539)

* try-runtime: add cli option --export-proof

* extract proof in raw json format

* fix build

* fix(try-runtime execute-block): wrong block parsing

* fmt

* apply suggestions

* Update utils/frame/try-runtime/cli/src/lib.rs

Co-authored-by: Anton <anton.kalyaev@gmail.com>

* Update utils/frame/try-runtime/cli/src/lib.rs

Co-authored-by: Anton <anton.kalyaev@gmail.com>

* Update utils/frame/try-runtime/cli/src/lib.rs

Co-authored-by: Anton <anton.kalyaev@gmail.com>

* Update utils/frame/try-runtime/cli/src/lib.rs

Co-authored-by: Anton <anton.kalyaev@gmail.com>

* split off external dependencies

* fmt

* fix try-runtime compilation

Co-authored-by: Anton <anton.kalyaev@gmail.com>
This commit is contained in:
Éloïs
2022-12-30 18:54:04 +01:00
committed by GitHub
parent 46d4eb2a05
commit 66cfd01f17
6 changed files with 61 additions and 2 deletions
@@ -134,6 +134,7 @@ where
"TryRuntime_execute_block",
&payload,
full_extensions(),
shared.export_proof,
)?;
Ok(())
@@ -150,6 +150,10 @@ where
"TryRuntime_execute_block",
(block, command.state_root_check, command.try_state.clone()).encode().as_ref(),
full_extensions(),
shared
.export_proof
.as_ref()
.map(|path| path.as_path().join(&format!("{}.json", number))),
);
if let Err(why) = result {
@@ -59,6 +59,7 @@ where
"TryRuntime_on_runtime_upgrade",
command.checks.encode().as_ref(),
Default::default(), // we don't really need any extensions here.
shared.export_proof,
)?;
let (weight, total_weight) = <(Weight, Weight) as Decode>::decode(&mut &*encoded_result)