mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 11:01:01 +00:00
Upgrade Polkadot & Substrate (#139)
* Upgrade Polkadot & Substrate * Update test/parachain/src/command.rs Co-authored-by: Cecile Tonglet <cecile@parity.io> Co-authored-by: Cecile Tonglet <cecile@parity.io>
This commit is contained in:
Generated
+182
-161
File diff suppressed because it is too large
Load Diff
@@ -34,35 +34,35 @@ use sp_runtime::{
|
|||||||
use std::{net::SocketAddr, sync::Arc};
|
use std::{net::SocketAddr, sync::Arc};
|
||||||
|
|
||||||
impl SubstrateCli for Cli {
|
impl SubstrateCli for Cli {
|
||||||
fn impl_name() -> &'static str {
|
fn impl_name() -> String {
|
||||||
"Cumulus Test Parachain Collator"
|
"Cumulus Test Parachain Collator".into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn impl_version() -> &'static str {
|
fn impl_version() -> String {
|
||||||
env!("SUBSTRATE_CLI_IMPL_VERSION")
|
env!("SUBSTRATE_CLI_IMPL_VERSION").into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn description() -> &'static str {
|
fn description() -> String {
|
||||||
"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 \
|
passed to the parachain node, while the arguments provided after -- will be passed \
|
||||||
to the relaychain node.\n\n\
|
to the relaychain node.\n\n\
|
||||||
cumulus-test-parachain-collator [parachain-args] -- [relaychain-args]"
|
{} [parachain-args] -- [relaychain-args]", Self::executable_name())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn author() -> &'static str {
|
fn author() -> String {
|
||||||
env!("CARGO_PKG_AUTHORS")
|
env!("CARGO_PKG_AUTHORS").into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn support_url() -> &'static str {
|
fn support_url() -> String {
|
||||||
"https://github.com/paritytech/cumulus/issues/new"
|
"https://github.com/paritytech/cumulus/issues/new".into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn copyright_start_year() -> i32 {
|
fn copyright_start_year() -> i32 {
|
||||||
2017
|
2017
|
||||||
}
|
}
|
||||||
|
|
||||||
fn executable_name() -> &'static str {
|
fn executable_name() -> String {
|
||||||
"cumulus-test-parachain-collator"
|
"cumulus-test-parachain-collator".into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load_spec(&self, _id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
|
fn load_spec(&self, _id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
|
||||||
@@ -78,46 +78,41 @@ impl SubstrateCli for Cli {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl SubstrateCli for PolkadotCli {
|
impl SubstrateCli for PolkadotCli {
|
||||||
fn impl_name() -> &'static str {
|
fn impl_name() -> String {
|
||||||
"Cumulus Test Parachain Collator"
|
"Cumulus Test Parachain Collator".into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn impl_version() -> &'static str {
|
fn impl_version() -> String {
|
||||||
env!("SUBSTRATE_CLI_IMPL_VERSION")
|
env!("SUBSTRATE_CLI_IMPL_VERSION").into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn description() -> &'static str {
|
fn description() -> String {
|
||||||
"Cumulus test parachain collator\n\nThe command-line arguments provided first will be \
|
"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 \
|
passed to the parachain node, while the arguments provided after -- will be passed \
|
||||||
to the relaychain node.\n\n\
|
to the relaychain node.\n\n\
|
||||||
cumulus-test-parachain-collator [parachain-args] -- [relaychain-args]"
|
cumulus-test-parachain-collator [parachain-args] -- [relaychain-args]"
|
||||||
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn author() -> &'static str {
|
fn author() -> String {
|
||||||
env!("CARGO_PKG_AUTHORS")
|
env!("CARGO_PKG_AUTHORS").into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn support_url() -> &'static str {
|
fn support_url() -> String {
|
||||||
"https://github.com/paritytech/cumulus/issues/new"
|
"https://github.com/paritytech/cumulus/issues/new".into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn copyright_start_year() -> i32 {
|
fn copyright_start_year() -> i32 {
|
||||||
2017
|
2017
|
||||||
}
|
}
|
||||||
|
|
||||||
fn executable_name() -> &'static str {
|
fn executable_name() -> String {
|
||||||
"cumulus-test-parachain-collator"
|
"cumulus-test-parachain-collator".into()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
|
fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
|
||||||
Ok(match id {
|
polkadot_cli::Cli::from_iter([PolkadotCli::executable_name().to_string()].iter())
|
||||||
"" | "local" | "dev" => Box::new(polkadot_service::PolkadotChainSpec::from_json_bytes(
|
.load_spec(id)
|
||||||
&include_bytes!("../res/polkadot_chainspec.json")[..],
|
|
||||||
)?),
|
|
||||||
path => Box::new(chain_spec::ChainSpec::from_json_file(
|
|
||||||
std::path::PathBuf::from(path),
|
|
||||||
)?),
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn native_runtime_version(chain_spec: &Box<dyn ChainSpec>) -> &'static RuntimeVersion {
|
fn native_runtime_version(chain_spec: &Box<dyn ChainSpec>) -> &'static RuntimeVersion {
|
||||||
@@ -161,7 +156,9 @@ pub fn run() -> Result<()> {
|
|||||||
Some(Subcommand::Base(subcommand)) => {
|
Some(Subcommand::Base(subcommand)) => {
|
||||||
let runner = cli.create_runner(subcommand)?;
|
let runner = cli.create_runner(subcommand)?;
|
||||||
|
|
||||||
runner.run_subcommand(subcommand, |config| Ok(new_full_start!(config).0))
|
runner.run_subcommand(subcommand, |config| {
|
||||||
|
Ok(new_full_start!(config).0.to_chain_ops_parts())
|
||||||
|
})
|
||||||
}
|
}
|
||||||
Some(Subcommand::ExportGenesisState(params)) => {
|
Some(Subcommand::ExportGenesisState(params)) => {
|
||||||
sc_cli::init_logger("");
|
sc_cli::init_logger("");
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
use ansi_term::Color;
|
use ansi_term::Color;
|
||||||
use cumulus_collator::{prepare_collator_config, CollatorBuilder};
|
use cumulus_collator::{prepare_collator_config, CollatorBuilder};
|
||||||
use cumulus_network::DelayedBlockAnnounceValidator;
|
use cumulus_network::DelayedBlockAnnounceValidator;
|
||||||
use futures::FutureExt;
|
use futures::{FutureExt, future::ready};
|
||||||
use polkadot_primitives::parachain::CollatorPair;
|
use polkadot_primitives::parachain::CollatorPair;
|
||||||
use sc_executor::native_executor_instance;
|
use sc_executor::native_executor_instance;
|
||||||
pub use sc_executor::NativeExecutor;
|
pub use sc_executor::NativeExecutor;
|
||||||
@@ -135,8 +135,12 @@ pub fn run_collator(
|
|||||||
prefix: format!("[{}] ", Color::Blue.bold().paint("Relaychain")),
|
prefix: format!("[{}] ", Color::Blue.bold().paint("Relaychain")),
|
||||||
};
|
};
|
||||||
|
|
||||||
let polkadot_future =
|
let (polkadot_future, task_manager) =
|
||||||
polkadot_collator::start_collator(builder, id, key, polkadot_config).map(|_| ());
|
polkadot_collator::start_collator(builder, id, key, polkadot_config)?;
|
||||||
|
|
||||||
|
// Make sure the polkadot task manager survives as long as the service.
|
||||||
|
let polkadot_future = polkadot_future.then(move |_| { let _ = task_manager; ready(())});
|
||||||
|
|
||||||
service.task_manager.spawn_essential_handle().spawn("polkadot", polkadot_future);
|
service.task_manager.spawn_essential_handle().spawn("polkadot", polkadot_future);
|
||||||
|
|
||||||
Ok(service.task_manager)
|
Ok(service.task_manager)
|
||||||
|
|||||||
Reference in New Issue
Block a user