mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-23 22:31:06 +00:00
Remove kusama and polkadot runtime crates (#1731)
This pull request is removing the Kusama and Polkadot runtime crates. As still some crates dependent on the runtime crates, this pull request is doing some more changes. - It removes the `hostperfcheck` CLI command. This CLI command could compare the current node against the standard hardware by doing some checks. Later we added the hardware benchmark feature to Substrate. This hardware benchmark is running on every node startup and prints a warning if the current node is too slow. This makes this CLI command a duplicate that was also depending on the kusama runtime. - The pull request is removing the emulated integration tests that were requiring the Kusama or Polkadot runtime crates.
This commit is contained in:
@@ -12,5 +12,3 @@ generate-bags = { path = "../../../substrate/utils/frame/generate-bags" }
|
||||
sp-io = { path = "../../../substrate/primitives/io" }
|
||||
|
||||
westend-runtime = { path = "../../runtime/westend" }
|
||||
kusama-runtime = { package = "staging-kusama-runtime", path = "../../runtime/kusama" }
|
||||
polkadot-runtime = { path = "../../runtime/polkadot" }
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
|
||||
use clap::{Parser, ValueEnum};
|
||||
use generate_bags::generate_thresholds;
|
||||
use kusama_runtime::Runtime as KusamaRuntime;
|
||||
use polkadot_runtime::Runtime as PolkadotRuntime;
|
||||
use std::path::{Path, PathBuf};
|
||||
use westend_runtime::Runtime as WestendRuntime;
|
||||
|
||||
@@ -31,8 +29,6 @@ use westend_runtime::Runtime as WestendRuntime;
|
||||
#[value(rename_all = "PascalCase")]
|
||||
enum Runtime {
|
||||
Westend,
|
||||
Kusama,
|
||||
Polkadot,
|
||||
}
|
||||
|
||||
impl Runtime {
|
||||
@@ -41,8 +37,6 @@ impl Runtime {
|
||||
) -> Box<dyn FnOnce(usize, &Path, u128, u128) -> Result<(), std::io::Error>> {
|
||||
match self {
|
||||
Runtime::Westend => Box::new(generate_thresholds::<WestendRuntime>),
|
||||
Runtime::Kusama => Box::new(generate_thresholds::<KusamaRuntime>),
|
||||
Runtime::Polkadot => Box::new(generate_thresholds::<PolkadotRuntime>),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,7 +48,7 @@ struct Opt {
|
||||
n_bags: usize,
|
||||
|
||||
/// Which runtime to generate.
|
||||
#[arg(long, ignore_case = true, value_enum, default_value_t = Runtime::Polkadot)]
|
||||
#[arg(long, ignore_case = true, value_enum, default_value_t = Runtime::Westend)]
|
||||
runtime: Runtime,
|
||||
|
||||
/// Where to write the output.
|
||||
|
||||
@@ -7,11 +7,7 @@ edition.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
[dependencies]
|
||||
polkadot-runtime = { path = "../../../runtime/polkadot" }
|
||||
kusama-runtime = { package = "staging-kusama-runtime", path = "../../../runtime/kusama" }
|
||||
westend-runtime = { path = "../../../runtime/westend" }
|
||||
polkadot-runtime-constants = { path = "../../../runtime/polkadot/constants" }
|
||||
kusama-runtime-constants = { path = "../../../runtime/kusama/constants" }
|
||||
westend-runtime-constants = { path = "../../../runtime/westend/constants" }
|
||||
|
||||
pallet-bags-list-remote-tests = { path = "../../../../substrate/frame/bags-list/remote-tests" }
|
||||
|
||||
@@ -29,16 +29,14 @@ enum Command {
|
||||
#[derive(Clone, Debug, ValueEnum)]
|
||||
#[value(rename_all = "PascalCase")]
|
||||
enum Runtime {
|
||||
Polkadot,
|
||||
Kusama,
|
||||
Westend,
|
||||
}
|
||||
|
||||
#[derive(Parser)]
|
||||
struct Cli {
|
||||
#[arg(long, short, default_value = "wss://kusama-rpc.polkadot.io:443")]
|
||||
#[arg(long, short, default_value = "wss://westend-rpc.polkadot.io:443")]
|
||||
uri: String,
|
||||
#[arg(long, short, ignore_case = true, value_enum, default_value_t = Runtime::Kusama)]
|
||||
#[arg(long, short, ignore_case = true, value_enum, default_value_t = Runtime::Westend)]
|
||||
runtime: Runtime,
|
||||
#[arg(long, short, ignore_case = true, value_enum, default_value_t = Command::SanityCheck)]
|
||||
command: Command,
|
||||
@@ -60,16 +58,6 @@ async fn main() {
|
||||
|
||||
use pallet_bags_list_remote_tests::*;
|
||||
match options.runtime {
|
||||
Runtime::Polkadot => sp_core::crypto::set_default_ss58_version(
|
||||
<polkadot_runtime::Runtime as frame_system::Config>::SS58Prefix::get()
|
||||
.try_into()
|
||||
.unwrap(),
|
||||
),
|
||||
Runtime::Kusama => sp_core::crypto::set_default_ss58_version(
|
||||
<kusama_runtime::Runtime as frame_system::Config>::SS58Prefix::get()
|
||||
.try_into()
|
||||
.unwrap(),
|
||||
),
|
||||
Runtime::Westend => sp_core::crypto::set_default_ss58_version(
|
||||
<westend_runtime::Runtime as frame_system::Config>::SS58Prefix::get()
|
||||
.try_into()
|
||||
@@ -78,27 +66,6 @@ async fn main() {
|
||||
};
|
||||
|
||||
match (options.runtime, options.command) {
|
||||
(Runtime::Kusama, Command::CheckMigration) => {
|
||||
use kusama_runtime::{Block, Runtime};
|
||||
use kusama_runtime_constants::currency::UNITS;
|
||||
migration::execute::<Runtime, Block>(UNITS as u64, "KSM", options.uri.clone()).await;
|
||||
},
|
||||
(Runtime::Kusama, Command::SanityCheck) => {
|
||||
use kusama_runtime::{Block, Runtime};
|
||||
use kusama_runtime_constants::currency::UNITS;
|
||||
try_state::execute::<Runtime, Block>(UNITS as u64, "KSM", options.uri.clone()).await;
|
||||
},
|
||||
(Runtime::Kusama, Command::Snapshot) => {
|
||||
use kusama_runtime::{Block, Runtime};
|
||||
use kusama_runtime_constants::currency::UNITS;
|
||||
snapshot::execute::<Runtime, Block>(
|
||||
options.snapshot_limit,
|
||||
UNITS.try_into().unwrap(),
|
||||
options.uri.clone(),
|
||||
)
|
||||
.await;
|
||||
},
|
||||
|
||||
(Runtime::Westend, Command::CheckMigration) => {
|
||||
use westend_runtime::{Block, Runtime};
|
||||
use westend_runtime_constants::currency::UNITS;
|
||||
@@ -119,26 +86,5 @@ async fn main() {
|
||||
)
|
||||
.await;
|
||||
},
|
||||
|
||||
(Runtime::Polkadot, Command::CheckMigration) => {
|
||||
use polkadot_runtime::{Block, Runtime};
|
||||
use polkadot_runtime_constants::currency::UNITS;
|
||||
migration::execute::<Runtime, Block>(UNITS as u64, "DOT", options.uri.clone()).await;
|
||||
},
|
||||
(Runtime::Polkadot, Command::SanityCheck) => {
|
||||
use polkadot_runtime::{Block, Runtime};
|
||||
use polkadot_runtime_constants::currency::UNITS;
|
||||
try_state::execute::<Runtime, Block>(UNITS as u64, "DOT", options.uri.clone()).await;
|
||||
},
|
||||
(Runtime::Polkadot, Command::Snapshot) => {
|
||||
use polkadot_runtime::{Block, Runtime};
|
||||
use polkadot_runtime_constants::currency::UNITS;
|
||||
snapshot::execute::<Runtime, Block>(
|
||||
options.snapshot_limit,
|
||||
UNITS.try_into().unwrap(),
|
||||
options.uri.clone(),
|
||||
)
|
||||
.await;
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user