mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 12:11:02 +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:
@@ -27,12 +27,8 @@ use sp_runtime::{
|
||||
|
||||
// Cumulus
|
||||
use parachains_common::{AccountId, AssetHubPolkadotAuraId, AuraId, Balance, BlockNumber};
|
||||
use polkadot_parachain_primitives::primitives::{HeadData, ValidationCode};
|
||||
use polkadot_primitives::{AssignmentId, ValidatorId};
|
||||
use polkadot_runtime_parachains::{
|
||||
configuration::HostConfiguration,
|
||||
paras::{ParaGenesisArgs, ParaKind},
|
||||
};
|
||||
use polkadot_runtime_parachains::configuration::HostConfiguration;
|
||||
use polkadot_service::chain_spec::get_authority_keys_from_seed_no_beefy;
|
||||
use xcm;
|
||||
|
||||
@@ -138,144 +134,6 @@ pub mod validators {
|
||||
|
||||
/// The default XCM version to set in genesis config.
|
||||
const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;
|
||||
// Polkadot
|
||||
pub mod polkadot {
|
||||
use super::*;
|
||||
pub const ED: Balance = polkadot_runtime_constants::currency::EXISTENTIAL_DEPOSIT;
|
||||
const STASH: u128 = 100 * polkadot_runtime_constants::currency::UNITS;
|
||||
|
||||
pub fn get_host_config() -> HostConfiguration<BlockNumber> {
|
||||
HostConfiguration {
|
||||
max_upward_queue_count: 10,
|
||||
max_upward_queue_size: 51200,
|
||||
max_upward_message_size: 51200,
|
||||
max_upward_message_num_per_candidate: 10,
|
||||
max_downward_message_size: 51200,
|
||||
hrmp_sender_deposit: 100_000_000_000,
|
||||
hrmp_recipient_deposit: 100_000_000_000,
|
||||
hrmp_channel_max_capacity: 1000,
|
||||
hrmp_channel_max_message_size: 102400,
|
||||
hrmp_channel_max_total_size: 102400,
|
||||
hrmp_max_parachain_outbound_channels: 30,
|
||||
hrmp_max_parachain_inbound_channels: 30,
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
fn session_keys(
|
||||
babe: BabeId,
|
||||
grandpa: GrandpaId,
|
||||
im_online: ImOnlineId,
|
||||
para_validator: ValidatorId,
|
||||
para_assignment: AssignmentId,
|
||||
authority_discovery: AuthorityDiscoveryId,
|
||||
) -> polkadot_runtime::SessionKeys {
|
||||
polkadot_runtime::SessionKeys {
|
||||
babe,
|
||||
grandpa,
|
||||
im_online,
|
||||
para_validator,
|
||||
para_assignment,
|
||||
authority_discovery,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn genesis() -> Storage {
|
||||
let genesis_config = polkadot_runtime::RuntimeGenesisConfig {
|
||||
system: polkadot_runtime::SystemConfig {
|
||||
code: polkadot_runtime::WASM_BINARY.unwrap().to_vec(),
|
||||
..Default::default()
|
||||
},
|
||||
balances: polkadot_runtime::BalancesConfig {
|
||||
balances: accounts::init_balances()
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|k| (k, ED * 4096))
|
||||
.collect(),
|
||||
},
|
||||
session: polkadot_runtime::SessionConfig {
|
||||
keys: validators::initial_authorities()
|
||||
.iter()
|
||||
.map(|x| {
|
||||
(
|
||||
x.0.clone(),
|
||||
x.0.clone(),
|
||||
polkadot::session_keys(
|
||||
x.2.clone(),
|
||||
x.3.clone(),
|
||||
x.4.clone(),
|
||||
x.5.clone(),
|
||||
x.6.clone(),
|
||||
x.7.clone(),
|
||||
),
|
||||
)
|
||||
})
|
||||
.collect::<Vec<_>>(),
|
||||
},
|
||||
staking: polkadot_runtime::StakingConfig {
|
||||
validator_count: validators::initial_authorities().len() as u32,
|
||||
minimum_validator_count: 1,
|
||||
stakers: validators::initial_authorities()
|
||||
.iter()
|
||||
.map(|x| {
|
||||
(x.0.clone(), x.1.clone(), STASH, polkadot_runtime::StakerStatus::Validator)
|
||||
})
|
||||
.collect(),
|
||||
invulnerables: validators::initial_authorities()
|
||||
.iter()
|
||||
.map(|x| x.0.clone())
|
||||
.collect(),
|
||||
force_era: pallet_staking::Forcing::ForceNone,
|
||||
slash_reward_fraction: Perbill::from_percent(10),
|
||||
..Default::default()
|
||||
},
|
||||
babe: polkadot_runtime::BabeConfig {
|
||||
authorities: Default::default(),
|
||||
epoch_config: Some(polkadot_runtime::BABE_GENESIS_EPOCH_CONFIG),
|
||||
..Default::default()
|
||||
},
|
||||
configuration: polkadot_runtime::ConfigurationConfig { config: get_host_config() },
|
||||
paras: polkadot_runtime::ParasConfig {
|
||||
paras: vec![
|
||||
(
|
||||
asset_hub_polkadot::PARA_ID.into(),
|
||||
ParaGenesisArgs {
|
||||
genesis_head: HeadData::default(),
|
||||
validation_code: ValidationCode(
|
||||
asset_hub_polkadot_runtime::WASM_BINARY.unwrap().to_vec(),
|
||||
),
|
||||
para_kind: ParaKind::Parachain,
|
||||
},
|
||||
),
|
||||
(
|
||||
penpal::PARA_ID_A.into(),
|
||||
ParaGenesisArgs {
|
||||
genesis_head: HeadData::default(),
|
||||
validation_code: ValidationCode(
|
||||
penpal_runtime::WASM_BINARY.unwrap().to_vec(),
|
||||
),
|
||||
para_kind: ParaKind::Parachain,
|
||||
},
|
||||
),
|
||||
(
|
||||
penpal::PARA_ID_B.into(),
|
||||
ParaGenesisArgs {
|
||||
genesis_head: HeadData::default(),
|
||||
validation_code: ValidationCode(
|
||||
penpal_runtime::WASM_BINARY.unwrap().to_vec(),
|
||||
),
|
||||
para_kind: ParaKind::Parachain,
|
||||
},
|
||||
),
|
||||
],
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
genesis_config.build_storage().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
// Westend
|
||||
pub mod westend {
|
||||
@@ -386,149 +244,6 @@ pub mod westend {
|
||||
}
|
||||
}
|
||||
|
||||
// Kusama
|
||||
pub mod kusama {
|
||||
use super::*;
|
||||
pub const ED: Balance = kusama_runtime_constants::currency::EXISTENTIAL_DEPOSIT;
|
||||
use kusama_runtime_constants::currency::UNITS as KSM;
|
||||
const ENDOWMENT: u128 = 1_000_000 * KSM;
|
||||
const STASH: u128 = 100 * KSM;
|
||||
|
||||
pub fn get_host_config() -> HostConfiguration<BlockNumber> {
|
||||
HostConfiguration {
|
||||
max_upward_queue_count: 10,
|
||||
max_upward_queue_size: 51200,
|
||||
max_upward_message_size: 51200,
|
||||
max_upward_message_num_per_candidate: 10,
|
||||
max_downward_message_size: 51200,
|
||||
hrmp_sender_deposit: 5_000_000_000_000,
|
||||
hrmp_recipient_deposit: 5_000_000_000_000,
|
||||
hrmp_channel_max_capacity: 1000,
|
||||
hrmp_channel_max_message_size: 102400,
|
||||
hrmp_channel_max_total_size: 102400,
|
||||
hrmp_max_parachain_outbound_channels: 30,
|
||||
hrmp_max_parachain_inbound_channels: 30,
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
fn session_keys(
|
||||
babe: BabeId,
|
||||
grandpa: GrandpaId,
|
||||
im_online: ImOnlineId,
|
||||
para_validator: ValidatorId,
|
||||
para_assignment: AssignmentId,
|
||||
authority_discovery: AuthorityDiscoveryId,
|
||||
beefy: BeefyId,
|
||||
) -> kusama_runtime::SessionKeys {
|
||||
kusama_runtime::SessionKeys {
|
||||
babe,
|
||||
grandpa,
|
||||
im_online,
|
||||
para_validator,
|
||||
para_assignment,
|
||||
authority_discovery,
|
||||
beefy,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn genesis() -> Storage {
|
||||
let genesis_config = kusama_runtime::RuntimeGenesisConfig {
|
||||
system: kusama_runtime::SystemConfig {
|
||||
code: kusama_runtime::WASM_BINARY.unwrap().to_vec(),
|
||||
..Default::default()
|
||||
},
|
||||
balances: kusama_runtime::BalancesConfig {
|
||||
balances: accounts::init_balances()
|
||||
.iter()
|
||||
.map(|k: &AccountId| (k.clone(), ENDOWMENT))
|
||||
.collect(),
|
||||
},
|
||||
session: kusama_runtime::SessionConfig {
|
||||
keys: validators::initial_authorities()
|
||||
.iter()
|
||||
.map(|x| {
|
||||
(
|
||||
x.0.clone(),
|
||||
x.0.clone(),
|
||||
kusama::session_keys(
|
||||
x.2.clone(),
|
||||
x.3.clone(),
|
||||
x.4.clone(),
|
||||
x.5.clone(),
|
||||
x.6.clone(),
|
||||
x.7.clone(),
|
||||
get_from_seed::<BeefyId>("Alice"),
|
||||
),
|
||||
)
|
||||
})
|
||||
.collect::<Vec<_>>(),
|
||||
},
|
||||
staking: kusama_runtime::StakingConfig {
|
||||
validator_count: validators::initial_authorities().len() as u32,
|
||||
minimum_validator_count: 1,
|
||||
stakers: validators::initial_authorities()
|
||||
.iter()
|
||||
.map(|x| {
|
||||
(x.0.clone(), x.1.clone(), STASH, kusama_runtime::StakerStatus::Validator)
|
||||
})
|
||||
.collect(),
|
||||
invulnerables: validators::initial_authorities()
|
||||
.iter()
|
||||
.map(|x| x.0.clone())
|
||||
.collect(),
|
||||
force_era: pallet_staking::Forcing::NotForcing,
|
||||
slash_reward_fraction: Perbill::from_percent(10),
|
||||
..Default::default()
|
||||
},
|
||||
babe: kusama_runtime::BabeConfig {
|
||||
authorities: Default::default(),
|
||||
epoch_config: Some(kusama_runtime::BABE_GENESIS_EPOCH_CONFIG),
|
||||
..Default::default()
|
||||
},
|
||||
configuration: kusama_runtime::ConfigurationConfig { config: get_host_config() },
|
||||
paras: kusama_runtime::ParasConfig {
|
||||
paras: vec![
|
||||
(
|
||||
asset_hub_kusama::PARA_ID.into(),
|
||||
ParaGenesisArgs {
|
||||
genesis_head: HeadData::default(),
|
||||
validation_code: ValidationCode(
|
||||
asset_hub_kusama_runtime::WASM_BINARY.unwrap().to_vec(),
|
||||
),
|
||||
para_kind: ParaKind::Parachain,
|
||||
},
|
||||
),
|
||||
(
|
||||
penpal::PARA_ID_A.into(),
|
||||
ParaGenesisArgs {
|
||||
genesis_head: HeadData::default(),
|
||||
validation_code: ValidationCode(
|
||||
penpal_runtime::WASM_BINARY.unwrap().to_vec(),
|
||||
),
|
||||
para_kind: ParaKind::Parachain,
|
||||
},
|
||||
),
|
||||
(
|
||||
penpal::PARA_ID_B.into(),
|
||||
ParaGenesisArgs {
|
||||
genesis_head: HeadData::default(),
|
||||
validation_code: ValidationCode(
|
||||
penpal_runtime::WASM_BINARY.unwrap().to_vec(),
|
||||
),
|
||||
para_kind: ParaKind::Parachain,
|
||||
},
|
||||
),
|
||||
],
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
genesis_config.build_storage().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
// Rococo
|
||||
pub mod rococo {
|
||||
use super::*;
|
||||
@@ -627,63 +342,6 @@ pub mod rococo {
|
||||
}
|
||||
}
|
||||
|
||||
// Asset Hub Polkadot
|
||||
pub mod asset_hub_polkadot {
|
||||
use super::*;
|
||||
pub const PARA_ID: u32 = 1000;
|
||||
pub const ED: Balance = parachains_common::polkadot::currency::EXISTENTIAL_DEPOSIT;
|
||||
|
||||
pub fn genesis() -> Storage {
|
||||
let genesis_config = asset_hub_polkadot_runtime::RuntimeGenesisConfig {
|
||||
system: asset_hub_polkadot_runtime::SystemConfig {
|
||||
code: asset_hub_polkadot_runtime::WASM_BINARY
|
||||
.expect("WASM binary was not build, please build it!")
|
||||
.to_vec(),
|
||||
..Default::default()
|
||||
},
|
||||
balances: asset_hub_polkadot_runtime::BalancesConfig {
|
||||
balances: accounts::init_balances()
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|k| (k, ED * 4096))
|
||||
.collect(),
|
||||
},
|
||||
parachain_info: asset_hub_polkadot_runtime::ParachainInfoConfig {
|
||||
parachain_id: PARA_ID.into(),
|
||||
..Default::default()
|
||||
},
|
||||
collator_selection: asset_hub_polkadot_runtime::CollatorSelectionConfig {
|
||||
invulnerables: collators::invulnerables_asset_hub_polkadot()
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|(acc, _)| acc)
|
||||
.collect(),
|
||||
candidacy_bond: ED * 16,
|
||||
..Default::default()
|
||||
},
|
||||
session: asset_hub_polkadot_runtime::SessionConfig {
|
||||
keys: collators::invulnerables_asset_hub_polkadot()
|
||||
.into_iter()
|
||||
.map(|(acc, aura)| {
|
||||
(
|
||||
acc.clone(), // account id
|
||||
acc, // validator id
|
||||
asset_hub_polkadot_runtime::SessionKeys { aura }, // session keys
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
},
|
||||
polkadot_xcm: asset_hub_polkadot_runtime::PolkadotXcmConfig {
|
||||
safe_xcm_version: Some(SAFE_XCM_VERSION),
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
genesis_config.build_storage().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
// Asset Hub Westend
|
||||
pub mod asset_hub_westend {
|
||||
use super::*;
|
||||
@@ -742,31 +400,31 @@ pub mod asset_hub_westend {
|
||||
}
|
||||
|
||||
// Asset Hub Kusama
|
||||
pub mod asset_hub_kusama {
|
||||
pub mod asset_hub_rococo {
|
||||
use super::*;
|
||||
pub const PARA_ID: u32 = 1000;
|
||||
pub const ED: Balance = parachains_common::kusama::currency::EXISTENTIAL_DEPOSIT;
|
||||
pub const ED: Balance = parachains_common::rococo::currency::EXISTENTIAL_DEPOSIT;
|
||||
|
||||
pub fn genesis() -> Storage {
|
||||
let genesis_config = asset_hub_kusama_runtime::RuntimeGenesisConfig {
|
||||
system: asset_hub_kusama_runtime::SystemConfig {
|
||||
code: asset_hub_kusama_runtime::WASM_BINARY
|
||||
let genesis_config = asset_hub_westend_runtime::RuntimeGenesisConfig {
|
||||
system: asset_hub_westend_runtime::SystemConfig {
|
||||
code: asset_hub_westend_runtime::WASM_BINARY
|
||||
.expect("WASM binary was not build, please build it!")
|
||||
.to_vec(),
|
||||
..Default::default()
|
||||
},
|
||||
balances: asset_hub_kusama_runtime::BalancesConfig {
|
||||
balances: asset_hub_westend_runtime::BalancesConfig {
|
||||
balances: accounts::init_balances()
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|k| (k, ED * 4096))
|
||||
.collect(),
|
||||
},
|
||||
parachain_info: asset_hub_kusama_runtime::ParachainInfoConfig {
|
||||
parachain_info: asset_hub_westend_runtime::ParachainInfoConfig {
|
||||
parachain_id: PARA_ID.into(),
|
||||
..Default::default()
|
||||
},
|
||||
collator_selection: asset_hub_kusama_runtime::CollatorSelectionConfig {
|
||||
collator_selection: asset_hub_westend_runtime::CollatorSelectionConfig {
|
||||
invulnerables: collators::invulnerables()
|
||||
.iter()
|
||||
.cloned()
|
||||
@@ -775,19 +433,19 @@ pub mod asset_hub_kusama {
|
||||
candidacy_bond: ED * 16,
|
||||
..Default::default()
|
||||
},
|
||||
session: asset_hub_kusama_runtime::SessionConfig {
|
||||
session: asset_hub_westend_runtime::SessionConfig {
|
||||
keys: collators::invulnerables()
|
||||
.into_iter()
|
||||
.map(|(acc, aura)| {
|
||||
(
|
||||
acc.clone(), // account id
|
||||
acc, // validator id
|
||||
asset_hub_kusama_runtime::SessionKeys { aura }, // session keys
|
||||
acc.clone(), // account id
|
||||
acc, // validator id
|
||||
asset_hub_westend_runtime::SessionKeys { aura }, // session keys
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
},
|
||||
polkadot_xcm: asset_hub_kusama_runtime::PolkadotXcmConfig {
|
||||
polkadot_xcm: asset_hub_westend_runtime::PolkadotXcmConfig {
|
||||
safe_xcm_version: Some(SAFE_XCM_VERSION),
|
||||
..Default::default()
|
||||
},
|
||||
@@ -859,177 +517,6 @@ pub mod penpal {
|
||||
}
|
||||
}
|
||||
|
||||
// Collectives
|
||||
pub mod collectives {
|
||||
use super::*;
|
||||
pub const PARA_ID: u32 = 1001;
|
||||
pub const ED: Balance = parachains_common::polkadot::currency::EXISTENTIAL_DEPOSIT;
|
||||
|
||||
pub fn genesis() -> Storage {
|
||||
let genesis_config = collectives_polkadot_runtime::RuntimeGenesisConfig {
|
||||
system: collectives_polkadot_runtime::SystemConfig {
|
||||
code: collectives_polkadot_runtime::WASM_BINARY
|
||||
.expect("WASM binary was not build, please build it!")
|
||||
.to_vec(),
|
||||
..Default::default()
|
||||
},
|
||||
balances: collectives_polkadot_runtime::BalancesConfig {
|
||||
balances: accounts::init_balances()
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|k| (k, ED * 4096))
|
||||
.collect(),
|
||||
},
|
||||
parachain_info: collectives_polkadot_runtime::ParachainInfoConfig {
|
||||
parachain_id: PARA_ID.into(),
|
||||
..Default::default()
|
||||
},
|
||||
collator_selection: collectives_polkadot_runtime::CollatorSelectionConfig {
|
||||
invulnerables: collators::invulnerables()
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|(acc, _)| acc)
|
||||
.collect(),
|
||||
candidacy_bond: ED * 16,
|
||||
..Default::default()
|
||||
},
|
||||
session: collectives_polkadot_runtime::SessionConfig {
|
||||
keys: collators::invulnerables()
|
||||
.into_iter()
|
||||
.map(|(acc, aura)| {
|
||||
(
|
||||
acc.clone(), // account id
|
||||
acc, // validator id
|
||||
collectives_polkadot_runtime::SessionKeys { aura }, // session keys
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
},
|
||||
polkadot_xcm: collectives_polkadot_runtime::PolkadotXcmConfig {
|
||||
safe_xcm_version: Some(SAFE_XCM_VERSION),
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
genesis_config.build_storage().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
// Bridge Hub Kusama
|
||||
pub mod bridge_hub_kusama {
|
||||
use super::*;
|
||||
pub const PARA_ID: u32 = 1002;
|
||||
pub const ED: Balance = parachains_common::kusama::currency::EXISTENTIAL_DEPOSIT;
|
||||
|
||||
pub fn genesis() -> Storage {
|
||||
let genesis_config = bridge_hub_kusama_runtime::RuntimeGenesisConfig {
|
||||
system: bridge_hub_kusama_runtime::SystemConfig {
|
||||
code: bridge_hub_kusama_runtime::WASM_BINARY
|
||||
.expect("WASM binary was not build, please build it!")
|
||||
.to_vec(),
|
||||
..Default::default()
|
||||
},
|
||||
balances: bridge_hub_kusama_runtime::BalancesConfig {
|
||||
balances: accounts::init_balances()
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|k| (k, ED * 4096))
|
||||
.collect(),
|
||||
},
|
||||
parachain_info: bridge_hub_kusama_runtime::ParachainInfoConfig {
|
||||
parachain_id: PARA_ID.into(),
|
||||
..Default::default()
|
||||
},
|
||||
collator_selection: bridge_hub_kusama_runtime::CollatorSelectionConfig {
|
||||
invulnerables: collators::invulnerables()
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|(acc, _)| acc)
|
||||
.collect(),
|
||||
candidacy_bond: ED * 16,
|
||||
..Default::default()
|
||||
},
|
||||
session: bridge_hub_kusama_runtime::SessionConfig {
|
||||
keys: collators::invulnerables()
|
||||
.into_iter()
|
||||
.map(|(acc, aura)| {
|
||||
(
|
||||
acc.clone(), // account id
|
||||
acc, // validator id
|
||||
bridge_hub_kusama_runtime::SessionKeys { aura }, // session keys
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
},
|
||||
polkadot_xcm: bridge_hub_kusama_runtime::PolkadotXcmConfig {
|
||||
safe_xcm_version: Some(SAFE_XCM_VERSION),
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
genesis_config.build_storage().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
// Bridge Hub Polkadot
|
||||
pub mod bridge_hub_polkadot {
|
||||
use super::*;
|
||||
pub const PARA_ID: u32 = 1002;
|
||||
pub const ED: Balance = parachains_common::polkadot::currency::EXISTENTIAL_DEPOSIT;
|
||||
|
||||
pub fn genesis() -> Storage {
|
||||
let genesis_config = bridge_hub_polkadot_runtime::RuntimeGenesisConfig {
|
||||
system: bridge_hub_polkadot_runtime::SystemConfig {
|
||||
code: bridge_hub_polkadot_runtime::WASM_BINARY
|
||||
.expect("WASM binary was not build, please build it!")
|
||||
.to_vec(),
|
||||
..Default::default()
|
||||
},
|
||||
balances: bridge_hub_polkadot_runtime::BalancesConfig {
|
||||
balances: accounts::init_balances()
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|k| (k, ED * 4096))
|
||||
.collect(),
|
||||
},
|
||||
parachain_info: bridge_hub_polkadot_runtime::ParachainInfoConfig {
|
||||
parachain_id: PARA_ID.into(),
|
||||
..Default::default()
|
||||
},
|
||||
collator_selection: bridge_hub_polkadot_runtime::CollatorSelectionConfig {
|
||||
invulnerables: collators::invulnerables()
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|(acc, _)| acc)
|
||||
.collect(),
|
||||
candidacy_bond: ED * 16,
|
||||
..Default::default()
|
||||
},
|
||||
session: bridge_hub_polkadot_runtime::SessionConfig {
|
||||
keys: collators::invulnerables()
|
||||
.into_iter()
|
||||
.map(|(acc, aura)| {
|
||||
(
|
||||
acc.clone(), // account id
|
||||
acc, // validator id
|
||||
bridge_hub_polkadot_runtime::SessionKeys { aura }, // session keys
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
},
|
||||
polkadot_xcm: bridge_hub_polkadot_runtime::PolkadotXcmConfig {
|
||||
safe_xcm_version: Some(SAFE_XCM_VERSION),
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
genesis_config.build_storage().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
// Bridge Hub Rococo & Bridge Hub Wococo
|
||||
pub mod bridge_hub_rococo {
|
||||
use super::*;
|
||||
|
||||
@@ -19,8 +19,7 @@ pub mod xcm_helpers;
|
||||
|
||||
use constants::{
|
||||
accounts::{ALICE, BOB},
|
||||
asset_hub_kusama, asset_hub_polkadot, asset_hub_westend, bridge_hub_kusama,
|
||||
bridge_hub_polkadot, bridge_hub_rococo, collectives, kusama, penpal, polkadot, rococo, westend,
|
||||
asset_hub_rococo, asset_hub_westend, bridge_hub_rococo, penpal, rococo, westend,
|
||||
};
|
||||
use impls::{RococoWococoMessageHandler, WococoRococoMessageHandler};
|
||||
|
||||
@@ -34,36 +33,6 @@ use xcm_emulator::{
|
||||
};
|
||||
|
||||
decl_test_relay_chains! {
|
||||
#[api_version(5)]
|
||||
pub struct Polkadot {
|
||||
genesis = polkadot::genesis(),
|
||||
on_init = (),
|
||||
runtime = polkadot_runtime,
|
||||
core = {
|
||||
MessageProcessor: DefaultMessageProcessor<Polkadot>,
|
||||
SovereignAccountOf: polkadot_runtime::xcm_config::SovereignAccountOf,
|
||||
},
|
||||
pallets = {
|
||||
XcmPallet: polkadot_runtime::XcmPallet,
|
||||
Balances: polkadot_runtime::Balances,
|
||||
Hrmp: polkadot_runtime::Hrmp,
|
||||
}
|
||||
},
|
||||
#[api_version(5)]
|
||||
pub struct Kusama {
|
||||
genesis = kusama::genesis(),
|
||||
on_init = (),
|
||||
runtime = kusama_runtime,
|
||||
core = {
|
||||
MessageProcessor: DefaultMessageProcessor<Kusama>,
|
||||
SovereignAccountOf: kusama_runtime::xcm_config::SovereignAccountOf,
|
||||
},
|
||||
pallets = {
|
||||
XcmPallet: kusama_runtime::XcmPallet,
|
||||
Balances: kusama_runtime::Balances,
|
||||
Hrmp: kusama_runtime::Hrmp,
|
||||
}
|
||||
},
|
||||
#[api_version(7)]
|
||||
pub struct Westend {
|
||||
genesis = westend::genesis(),
|
||||
@@ -112,164 +81,6 @@ decl_test_relay_chains! {
|
||||
}
|
||||
|
||||
decl_test_parachains! {
|
||||
// Polkadot Parachains
|
||||
pub struct AssetHubPolkadot {
|
||||
genesis = asset_hub_polkadot::genesis(),
|
||||
on_init = {
|
||||
asset_hub_polkadot_runtime::AuraExt::on_initialize(1);
|
||||
},
|
||||
runtime = asset_hub_polkadot_runtime,
|
||||
core = {
|
||||
XcmpMessageHandler: asset_hub_polkadot_runtime::XcmpQueue,
|
||||
DmpMessageHandler: asset_hub_polkadot_runtime::DmpQueue,
|
||||
LocationToAccountId: asset_hub_polkadot_runtime::xcm_config::LocationToAccountId,
|
||||
ParachainInfo: asset_hub_polkadot_runtime::ParachainInfo,
|
||||
},
|
||||
pallets = {
|
||||
PolkadotXcm: asset_hub_polkadot_runtime::PolkadotXcm,
|
||||
Assets: asset_hub_polkadot_runtime::Assets,
|
||||
Balances: asset_hub_polkadot_runtime::Balances,
|
||||
}
|
||||
},
|
||||
pub struct Collectives {
|
||||
genesis = collectives::genesis(),
|
||||
on_init = {
|
||||
collectives_polkadot_runtime::AuraExt::on_initialize(1);
|
||||
},
|
||||
runtime = collectives_polkadot_runtime,
|
||||
core = {
|
||||
XcmpMessageHandler: collectives_polkadot_runtime::XcmpQueue,
|
||||
DmpMessageHandler: collectives_polkadot_runtime::DmpQueue,
|
||||
LocationToAccountId: collectives_polkadot_runtime::xcm_config::LocationToAccountId,
|
||||
ParachainInfo: collectives_polkadot_runtime::ParachainInfo,
|
||||
},
|
||||
pallets = {
|
||||
PolkadotXcm: collectives_polkadot_runtime::PolkadotXcm,
|
||||
Balances: collectives_polkadot_runtime::Balances,
|
||||
}
|
||||
},
|
||||
pub struct BridgeHubPolkadot {
|
||||
genesis = bridge_hub_polkadot::genesis(),
|
||||
on_init = {
|
||||
bridge_hub_polkadot_runtime::AuraExt::on_initialize(1);
|
||||
},
|
||||
runtime = bridge_hub_polkadot_runtime,
|
||||
core = {
|
||||
XcmpMessageHandler: bridge_hub_polkadot_runtime::XcmpQueue,
|
||||
DmpMessageHandler: bridge_hub_polkadot_runtime::DmpQueue,
|
||||
LocationToAccountId: bridge_hub_polkadot_runtime::xcm_config::LocationToAccountId,
|
||||
ParachainInfo: bridge_hub_polkadot_runtime::ParachainInfo,
|
||||
},
|
||||
pallets = {
|
||||
PolkadotXcm: bridge_hub_polkadot_runtime::PolkadotXcm,
|
||||
}
|
||||
},
|
||||
pub struct PenpalPolkadotA {
|
||||
genesis = penpal::genesis(penpal::PARA_ID_A),
|
||||
on_init = {
|
||||
penpal_runtime::AuraExt::on_initialize(1);
|
||||
},
|
||||
runtime = penpal_runtime,
|
||||
core = {
|
||||
XcmpMessageHandler: penpal_runtime::XcmpQueue,
|
||||
DmpMessageHandler: penpal_runtime::DmpQueue,
|
||||
LocationToAccountId: penpal_runtime::xcm_config::LocationToAccountId,
|
||||
ParachainInfo: penpal_runtime::ParachainInfo,
|
||||
},
|
||||
pallets = {
|
||||
PolkadotXcm: penpal_runtime::PolkadotXcm,
|
||||
Assets: penpal_runtime::Assets,
|
||||
}
|
||||
},
|
||||
pub struct PenpalPolkadotB {
|
||||
genesis = penpal::genesis(penpal::PARA_ID_B),
|
||||
on_init = {
|
||||
penpal_runtime::AuraExt::on_initialize(1);
|
||||
},
|
||||
runtime = penpal_runtime,
|
||||
core = {
|
||||
XcmpMessageHandler: penpal_runtime::XcmpQueue,
|
||||
DmpMessageHandler: penpal_runtime::DmpQueue,
|
||||
LocationToAccountId: penpal_runtime::xcm_config::LocationToAccountId,
|
||||
ParachainInfo: penpal_runtime::ParachainInfo,
|
||||
},
|
||||
pallets = {
|
||||
PolkadotXcm: penpal_runtime::PolkadotXcm,
|
||||
Assets: penpal_runtime::Assets,
|
||||
}
|
||||
},
|
||||
// Kusama Parachains
|
||||
pub struct AssetHubKusama {
|
||||
genesis = asset_hub_kusama::genesis(),
|
||||
on_init = {
|
||||
asset_hub_kusama_runtime::AuraExt::on_initialize(1);
|
||||
},
|
||||
runtime = asset_hub_kusama_runtime,
|
||||
core = {
|
||||
XcmpMessageHandler: asset_hub_kusama_runtime::XcmpQueue,
|
||||
DmpMessageHandler: asset_hub_kusama_runtime::DmpQueue,
|
||||
LocationToAccountId: asset_hub_kusama_runtime::xcm_config::LocationToAccountId,
|
||||
ParachainInfo: asset_hub_kusama_runtime::ParachainInfo,
|
||||
},
|
||||
pallets = {
|
||||
PolkadotXcm: asset_hub_kusama_runtime::PolkadotXcm,
|
||||
Assets: asset_hub_kusama_runtime::Assets,
|
||||
ForeignAssets: asset_hub_kusama_runtime::ForeignAssets,
|
||||
PoolAssets: asset_hub_kusama_runtime::PoolAssets,
|
||||
AssetConversion: asset_hub_kusama_runtime::AssetConversion,
|
||||
Balances: asset_hub_kusama_runtime::Balances,
|
||||
}
|
||||
},
|
||||
pub struct BridgeHubKusama {
|
||||
genesis = bridge_hub_kusama::genesis(),
|
||||
on_init = {
|
||||
bridge_hub_kusama_runtime::AuraExt::on_initialize(1);
|
||||
},
|
||||
runtime = bridge_hub_kusama_runtime,
|
||||
core = {
|
||||
XcmpMessageHandler: bridge_hub_kusama_runtime::XcmpQueue,
|
||||
DmpMessageHandler: bridge_hub_kusama_runtime::DmpQueue,
|
||||
LocationToAccountId: bridge_hub_kusama_runtime::xcm_config::LocationToAccountId,
|
||||
ParachainInfo: bridge_hub_kusama_runtime::ParachainInfo,
|
||||
},
|
||||
pallets = {
|
||||
PolkadotXcm: bridge_hub_kusama_runtime::PolkadotXcm,
|
||||
}
|
||||
},
|
||||
pub struct PenpalKusamaA {
|
||||
genesis = penpal::genesis(penpal::PARA_ID_A),
|
||||
on_init = {
|
||||
penpal_runtime::AuraExt::on_initialize(1);
|
||||
},
|
||||
runtime = penpal_runtime,
|
||||
core = {
|
||||
XcmpMessageHandler: penpal_runtime::XcmpQueue,
|
||||
DmpMessageHandler: penpal_runtime::DmpQueue,
|
||||
LocationToAccountId: penpal_runtime::xcm_config::LocationToAccountId,
|
||||
ParachainInfo: penpal_runtime::ParachainInfo,
|
||||
},
|
||||
pallets = {
|
||||
PolkadotXcm: penpal_runtime::PolkadotXcm,
|
||||
Assets: penpal_runtime::Assets,
|
||||
}
|
||||
},
|
||||
pub struct PenpalKusamaB {
|
||||
genesis = penpal::genesis(penpal::PARA_ID_B),
|
||||
on_init = {
|
||||
penpal_runtime::AuraExt::on_initialize(1);
|
||||
},
|
||||
runtime = penpal_runtime,
|
||||
core = {
|
||||
XcmpMessageHandler: penpal_runtime::XcmpQueue,
|
||||
DmpMessageHandler: penpal_runtime::DmpQueue,
|
||||
LocationToAccountId: penpal_runtime::xcm_config::LocationToAccountId,
|
||||
ParachainInfo: penpal_runtime::ParachainInfo,
|
||||
},
|
||||
pallets = {
|
||||
PolkadotXcm: penpal_runtime::PolkadotXcm,
|
||||
Assets: penpal_runtime::Assets,
|
||||
}
|
||||
},
|
||||
// Westend Parachains
|
||||
pub struct AssetHubWestend {
|
||||
genesis = asset_hub_westend::genesis(),
|
||||
@@ -329,7 +140,7 @@ decl_test_parachains! {
|
||||
},
|
||||
// AssetHubRococo (aka Rockmine/Rockmine2) mirrors AssetHubKusama
|
||||
pub struct AssetHubRococo {
|
||||
genesis = asset_hub_kusama::genesis(),
|
||||
genesis = asset_hub_rococo::genesis(),
|
||||
on_init = {
|
||||
asset_hub_polkadot_runtime::AuraExt::on_initialize(1);
|
||||
},
|
||||
@@ -363,7 +174,7 @@ decl_test_parachains! {
|
||||
}
|
||||
},
|
||||
pub struct AssetHubWococo {
|
||||
genesis = asset_hub_polkadot::genesis(),
|
||||
genesis = asset_hub_westend::genesis(),
|
||||
on_init = {
|
||||
asset_hub_polkadot_runtime::AuraExt::on_initialize(1);
|
||||
},
|
||||
@@ -399,31 +210,6 @@ decl_test_parachains! {
|
||||
}
|
||||
|
||||
decl_test_networks! {
|
||||
pub struct PolkadotMockNet {
|
||||
relay_chain = Polkadot,
|
||||
parachains = vec![
|
||||
AssetHubPolkadot,
|
||||
Collectives,
|
||||
BridgeHubPolkadot,
|
||||
PenpalPolkadotA,
|
||||
PenpalPolkadotB,
|
||||
],
|
||||
// TODO: uncomment when https://github.com/paritytech/cumulus/pull/2528 is merged
|
||||
// bridge = PolkadotKusamaMockBridge
|
||||
bridge = ()
|
||||
},
|
||||
pub struct KusamaMockNet {
|
||||
relay_chain = Kusama,
|
||||
parachains = vec![
|
||||
AssetHubKusama,
|
||||
PenpalKusamaA,
|
||||
BridgeHubKusama,
|
||||
PenpalKusamaB,
|
||||
],
|
||||
// TODO: uncomment when https://github.com/paritytech/cumulus/pull/2528 is merged
|
||||
// bridge = KusamaPolkadotMockBridge
|
||||
bridge = ()
|
||||
},
|
||||
pub struct WestendMockNet {
|
||||
relay_chain = Westend,
|
||||
parachains = vec![
|
||||
@@ -475,16 +261,6 @@ decl_test_bridges! {
|
||||
// }
|
||||
}
|
||||
|
||||
// Polkadot implementation
|
||||
impl_accounts_helpers_for_relay_chain!(Polkadot);
|
||||
impl_assert_events_helpers_for_relay_chain!(Polkadot);
|
||||
impl_hrmp_channels_helpers_for_relay_chain!(Polkadot);
|
||||
|
||||
// Kusama implementation
|
||||
impl_accounts_helpers_for_relay_chain!(Kusama);
|
||||
impl_assert_events_helpers_for_relay_chain!(Kusama);
|
||||
impl_hrmp_channels_helpers_for_relay_chain!(Kusama);
|
||||
|
||||
// Westend implementation
|
||||
impl_accounts_helpers_for_relay_chain!(Westend);
|
||||
impl_assert_events_helpers_for_relay_chain!(Westend);
|
||||
@@ -497,65 +273,31 @@ impl_assert_events_helpers_for_relay_chain!(Rococo);
|
||||
impl_accounts_helpers_for_relay_chain!(Wococo);
|
||||
impl_assert_events_helpers_for_relay_chain!(Wococo);
|
||||
|
||||
// AssetHubPolkadot implementation
|
||||
impl_accounts_helpers_for_parachain!(AssetHubPolkadot);
|
||||
impl_assets_helpers_for_parachain!(AssetHubPolkadot, Polkadot);
|
||||
impl_assert_events_helpers_for_parachain!(AssetHubPolkadot);
|
||||
|
||||
// AssetHubKusama implementation
|
||||
impl_accounts_helpers_for_parachain!(AssetHubKusama);
|
||||
impl_assets_helpers_for_parachain!(AssetHubKusama, Kusama);
|
||||
impl_assert_events_helpers_for_parachain!(AssetHubKusama);
|
||||
|
||||
// AssetHubWestend implementation
|
||||
impl_accounts_helpers_for_parachain!(AssetHubWestend);
|
||||
impl_assets_helpers_for_parachain!(AssetHubWestend, Westend);
|
||||
impl_assert_events_helpers_for_parachain!(AssetHubWestend);
|
||||
|
||||
// PenpalPolkadot implementations
|
||||
impl_assert_events_helpers_for_parachain!(PenpalPolkadotA);
|
||||
impl_assert_events_helpers_for_parachain!(PenpalPolkadotB);
|
||||
|
||||
// PenpalKusama implementations
|
||||
impl_assert_events_helpers_for_parachain!(PenpalKusamaA);
|
||||
impl_assert_events_helpers_for_parachain!(PenpalKusamaB);
|
||||
|
||||
// PenpalWestendA implementation
|
||||
impl_assert_events_helpers_for_parachain!(PenpalWestendA);
|
||||
|
||||
// Collectives implementation
|
||||
impl_accounts_helpers_for_parachain!(Collectives);
|
||||
impl_assert_events_helpers_for_parachain!(Collectives);
|
||||
|
||||
// BridgeHubRococo implementation
|
||||
impl_accounts_helpers_for_parachain!(BridgeHubRococo);
|
||||
impl_assert_events_helpers_for_parachain!(BridgeHubRococo);
|
||||
|
||||
decl_test_sender_receiver_accounts_parameter_types! {
|
||||
// Relays
|
||||
Polkadot { sender: ALICE, receiver: BOB },
|
||||
Kusama { sender: ALICE, receiver: BOB },
|
||||
Westend { sender: ALICE, receiver: BOB },
|
||||
Rococo { sender: ALICE, receiver: BOB },
|
||||
Wococo { sender: ALICE, receiver: BOB },
|
||||
// Asset Hubs
|
||||
AssetHubPolkadot { sender: ALICE, receiver: BOB },
|
||||
AssetHubKusama { sender: ALICE, receiver: BOB },
|
||||
AssetHubWestend { sender: ALICE, receiver: BOB },
|
||||
AssetHubRococo { sender: ALICE, receiver: BOB },
|
||||
AssetHubWococo { sender: ALICE, receiver: BOB },
|
||||
// Collectives
|
||||
Collectives { sender: ALICE, receiver: BOB },
|
||||
// Bridged Hubs
|
||||
BridgeHubPolkadot { sender: ALICE, receiver: BOB },
|
||||
BridgeHubKusama { sender: ALICE, receiver: BOB },
|
||||
BridgeHubRococo { sender: ALICE, receiver: BOB },
|
||||
BridgeHubWococo { sender: ALICE, receiver: BOB },
|
||||
// Penpals
|
||||
PenpalPolkadotA { sender: ALICE, receiver: BOB },
|
||||
PenpalPolkadotB { sender: ALICE, receiver: BOB },
|
||||
PenpalKusamaA { sender: ALICE, receiver: BOB },
|
||||
PenpalKusamaB { sender: ALICE, receiver: BOB },
|
||||
PenpalWestendA { sender: ALICE, receiver: BOB },
|
||||
PenpalRococoA { sender: ALICE, receiver: BOB }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user