merge from cumulus release branch inc extra commit (#940)

* Revert "Companion for substrate#10632 (#895)"

This reverts commit fd145766d4.

* Revert "Companion for paritytech/polkadot#4712 (#901)"

This reverts commit 9c977d66a3.

* Prepare branch

* Make sure to use `state_version = 0` for now

* Fix lock file

* Minimising changes to cargo lock

* updating to include weights update.

Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
Squirrel
2022-02-01 11:01:18 +00:00
committed by GitHub
parent 7881fe6a16
commit 04c518de01
17 changed files with 181 additions and 239 deletions
+2 -2
View File
@@ -21,13 +21,13 @@ path = "src/main.rs"
[features]
runtime-benchmarks = ["parachain-template-runtime/runtime-benchmarks"]
try-runtime = ["parachain-template-runtime/try-runtime"]
try-runtime = [ "parachain-template-runtime/try-runtime" ]
[dependencies]
clap = { version = "3.0", features = ["derive"] }
derive_more = "0.99.2"
log = "0.4.14"
codec = { package = "parity-scale-codec", version = "2.0.0" }
structopt = "0.3.8"
serde = { version = "1.0.132", features = ["derive"] }
hex-literal = "0.3.1"
+23 -23
View File
@@ -1,16 +1,16 @@
use crate::chain_spec;
use clap::{AppSettings, Parser};
use std::path::PathBuf;
use structopt::StructOpt;
/// Sub-commands supported by the collator.
#[derive(Debug, clap::Subcommand)]
#[derive(Debug, StructOpt)]
pub enum Subcommand {
/// Export the genesis state of the parachain.
#[clap(name = "export-genesis-state")]
#[structopt(name = "export-genesis-state")]
ExportGenesisState(ExportGenesisStateCommand),
/// Export the genesis wasm of the parachain.
#[clap(name = "export-genesis-wasm")]
#[structopt(name = "export-genesis-wasm")]
ExportGenesisWasm(ExportGenesisWasmCommand),
/// Build a chain specification.
@@ -35,7 +35,7 @@ pub enum Subcommand {
Revert(sc_cli::RevertCmd),
/// The custom benchmark subcommmand benchmarking runtime pallets.
#[clap(name = "benchmark", about = "Benchmark runtime pallets.")]
#[structopt(name = "benchmark", about = "Benchmark runtime pallets.")]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
/// Try some testing command against a specified runtime state.
@@ -43,52 +43,52 @@ pub enum Subcommand {
}
/// Command for exporting the genesis state of the parachain
#[derive(Debug, Parser)]
#[derive(Debug, StructOpt)]
pub struct ExportGenesisStateCommand {
/// Output file name or stdout if unspecified.
#[clap(parse(from_os_str))]
#[structopt(parse(from_os_str))]
pub output: Option<PathBuf>,
/// Write output in binary. Default is to write in hex.
#[clap(short, long)]
#[structopt(short, long)]
pub raw: bool,
/// The name of the chain for that the genesis state should be exported.
#[clap(long)]
#[structopt(long)]
pub chain: Option<String>,
}
/// Command for exporting the genesis wasm file.
#[derive(Debug, Parser)]
#[derive(Debug, StructOpt)]
pub struct ExportGenesisWasmCommand {
/// Output file name or stdout if unspecified.
#[clap(parse(from_os_str))]
#[structopt(parse(from_os_str))]
pub output: Option<PathBuf>,
/// Write output in binary. Default is to write in hex.
#[clap(short, long)]
#[structopt(short, long)]
pub raw: bool,
/// The name of the chain for that the genesis wasm file should be exported.
#[clap(long)]
#[structopt(long)]
pub chain: Option<String>,
}
#[derive(Debug, Parser)]
#[clap(setting(
AppSettings::PropagateVersion |
AppSettings::ArgsNegateSubcommands |
AppSettings::SubcommandsNegateReqs,
))]
#[derive(Debug, StructOpt)]
#[structopt(settings = &[
structopt::clap::AppSettings::GlobalVersion,
structopt::clap::AppSettings::ArgsNegateSubcommands,
structopt::clap::AppSettings::SubcommandsNegateReqs,
])]
pub struct Cli {
#[clap(subcommand)]
#[structopt(subcommand)]
pub subcommand: Option<Subcommand>,
#[clap(flatten)]
#[structopt(flatten)]
pub run: cumulus_client_cli::RunCmd,
/// Relay chain arguments
#[clap(raw = true)]
#[structopt(raw = true)]
pub relay_chain_args: Vec<String>,
}
@@ -113,6 +113,6 @@ impl RelayChainCli {
let extension = chain_spec::Extensions::try_get(&*para_config.chain_spec);
let chain_id = extension.map(|e| e.relay_chain.clone());
let base_path = para_config.base_path.as_ref().map(|x| x.path().join("polkadot"));
Self { base_path, chain_id, base: polkadot_cli::RunCmd::parse_from(relay_chain_args) }
Self { base_path, chain_id, base: polkadot_cli::RunCmd::from_iter(relay_chain_args) }
}
}