Update Substrate & Polkadot (#141)

This commit is contained in:
Bastian Köcher
2020-07-09 15:28:45 +02:00
committed by GitHub
parent 416c97030c
commit 03205eb601
10 changed files with 520 additions and 418 deletions
+7 -12
View File
@@ -43,10 +43,13 @@ impl SubstrateCli for Cli {
}
fn description() -> String {
format!("Cumulus test parachain collator\n\nThe command-line arguments provided first will be \
format!(
"Cumulus test parachain collator\n\nThe command-line arguments provided first will be \
passed to the parachain node, while the arguments provided after -- will be passed \
to the relaychain node.\n\n\
{} [parachain-args] -- [relaychain-args]", Self::executable_name())
{} [parachain-args] -- [relaychain-args]",
Self::executable_name()
)
}
fn author() -> String {
@@ -61,10 +64,6 @@ impl SubstrateCli for Cli {
2017
}
fn executable_name() -> String {
"cumulus-test-parachain-collator".into()
}
fn load_spec(&self, _id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
// Such a hack :(
Ok(Box::new(chain_spec::get_chain_spec(
@@ -106,10 +105,6 @@ impl SubstrateCli for PolkadotCli {
2017
}
fn executable_name() -> String {
"cumulus-test-parachain-collator".into()
}
fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
polkadot_cli::Cli::from_iter([PolkadotCli::executable_name().to_string()].iter())
.load_spec(id)
@@ -161,7 +156,7 @@ pub fn run() -> Result<()> {
})
}
Some(Subcommand::ExportGenesisState(params)) => {
sc_cli::init_logger("");
sc_cli::init_logger("", &<sc_cli::LogRotationOpt as structopt::StructOpt>::from_args())?;
let block = generate_genesis_state(params.parachain_id.into())?;
let header_hex = format!("0x{:?}", HexDisplay::from(&block.header().encode()));
@@ -200,7 +195,7 @@ pub fn run() -> Result<()> {
})
}
Some(Subcommand::PolkadotValidationWorker(cmd)) => {
sc_cli::init_logger("");
sc_cli::init_logger("", &<sc_cli::LogRotationOpt as structopt::StructOpt>::from_args())?;
polkadot_service::run_validation_worker(&cmd.mem_id)?;
Ok(())