pop_chains/try_runtime/
state.rs1use serde::Serialize;
4use std::path::PathBuf;
5use strum::{Display, EnumDiscriminants};
6use strum_macros::{AsRefStr, EnumMessage, EnumString, VariantArray};
7
8#[derive(Clone, Debug, clap::Subcommand, EnumDiscriminants, Serialize)]
10#[strum_discriminants(derive(AsRefStr, EnumString, EnumMessage, VariantArray, Display))]
11#[strum_discriminants(name(StateCommand))]
12pub enum State {
13 #[strum_discriminants(strum(
15 serialize = "live",
16 message = "Live",
17 detailed_message = "Run the migrations on top of live state.",
18 ))]
19 Live(LiveState),
20
21 #[strum_discriminants(strum(
23 serialize = "snap",
24 message = "Snapshot",
25 detailed_message = "Run the migrations on top of a chain snapshot."
26 ))]
27 Snap {
28 #[clap(short = 'p', long = "path", alias = "snapshot-path")]
30 path: Option<PathBuf>,
31 },
32}
33
34#[derive(Debug, Default, Clone, clap::Args, Serialize)]
36pub struct LiveState {
37 #[arg(
39 short,
40 long,
41 value_parser = super::parse::url,
42 )]
43 pub uri: Option<String>,
44
45 #[arg(
49 short,
50 long,
51 value_parser = super::parse::hash,
52 )]
53 pub at: Option<String>,
54
55 #[arg(short, long, num_args = 1..)]
60 pub pallet: Vec<String>,
61
62 #[arg(long = "prefix", value_parser = super::parse::hash, num_args = 1..)]
65 pub hashed_prefixes: Vec<String>,
66
67 #[arg(long)]
73 pub child_tree: bool,
74}