try-runtime - support all state versions (#12089)

* Add argument

* Apply

* More verbose parsing

* fmt

* fmt again

* Invalid state version

* reuse parsing

* type mismatch
This commit is contained in:
Piotr Mikołajczyk
2022-08-27 06:56:24 +02:00
committed by GitHub
parent 75a76d967b
commit 9e5b211828
6 changed files with 25 additions and 8 deletions
@@ -294,6 +294,7 @@ use sp_runtime::{
DeserializeOwned,
};
use sp_state_machine::{OverlayedChanges, StateMachine, TrieBackendBuilder};
use sp_version::StateVersion;
use std::{fmt::Debug, path::PathBuf, str::FromStr};
mod commands;
@@ -421,6 +422,10 @@ pub struct SharedParams {
/// When enabled, the spec name check will not panic, and instead only show a warning.
#[clap(long)]
pub no_spec_name_check: bool,
/// State version that is used by the chain.
#[clap(long, default_value = "1", parse(try_from_str = parse::state_version))]
pub state_version: StateVersion,
}
/// Our `try-runtime` command.