mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 07:01:03 +00:00
Rename Statemint to Asset Hub (#2633)
* change dir names * cargo toml updates * fix crate imports for build * change chain spec names and PR review rule * update cli to accept asset-hub * find/replace benchmark commands * integration tests * bridges docs * more integration tests * AuraId * other statemint tidying * rename statemint mod * chain spec mod * rename e2e test dirs * one more Runtime::Statemine * benchmark westmint * rename chain spec name and id * rename chain spec files * more tidying in scripts/docs/tests * rename old dir if exists * Force people to manually do the move. (Safer as there could be additional considerations with their setup) * review touchups * more renaming * Update polkadot-parachain/src/command.rs Co-authored-by: Bastian Köcher <git@kchr.de> * better error message * do not break on-chain spec_name * log info message that path has been renamed * better penpal docs --------- Co-authored-by: gilescope <gilescope@gmail.com> Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: parity-processbot <>
This commit is contained in:
+3
-3
@@ -1,9 +1,9 @@
|
||||
[package]
|
||||
name = "statemine-it"
|
||||
name = "asset-hub-kusama-integration-tests"
|
||||
version = "1.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2021"
|
||||
description = "Statemine parachain runtime integration tests with xcm-emulator"
|
||||
description = "Asset Hub Kusama runtime integration tests with xcm-emulator"
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false }
|
||||
@@ -29,7 +29,7 @@ pallet-xcm = { default-features = false, git = "https://github.com/paritytech/po
|
||||
# Cumulus
|
||||
parachains-common = { path = "../../../../common" }
|
||||
penpal-runtime = { path = "../../../../runtimes/testing/penpal" }
|
||||
statemine-runtime = { path = "../../../../runtimes/assets/statemine" }
|
||||
asset-hub-kusama-runtime = { path = "../../../../runtimes/assets/asset-hub-kusama" }
|
||||
|
||||
# Local
|
||||
xcm-emulator = { default-features = false, path = "../../../../../xcm/xcm-emulator" }
|
||||
+7
-7
@@ -8,13 +8,13 @@ pub use integration_tests_common::{
|
||||
kusama::ED as KUSAMA_ED,
|
||||
PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3,
|
||||
},
|
||||
AccountId, BHKusama, BHKusamaPallet, BHKusamaReceiver, BHKusamaSender, BHPolkadot,
|
||||
BHPolkadotPallet, BHPolkadotReceiver, BHPolkadotSender, Collectives, CollectivesPallet,
|
||||
CollectivesReceiver, CollectivesSender, Kusama, KusamaMockNet, KusamaPallet, KusamaReceiver,
|
||||
KusamaSender, PenpalKusama, PenpalKusamaReceiver, PenpalKusamaSender, PenpalPolkadot,
|
||||
PenpalPolkadotReceiver, PenpalPolkadotSender, Polkadot, PolkadotMockNet, PolkadotPallet,
|
||||
PolkadotReceiver, PolkadotSender, Statemine, StateminePallet, StatemineReceiver,
|
||||
StatemineSender,
|
||||
AccountId, AssetHubKusama, AssetHubKusamaPallet, AssetHubKusamaReceiver, AssetHubKusamaSender,
|
||||
BHKusama, BHKusamaPallet, BHKusamaReceiver, BHKusamaSender, BHPolkadot, BHPolkadotPallet,
|
||||
BHPolkadotReceiver, BHPolkadotSender, Collectives, CollectivesPallet, CollectivesReceiver,
|
||||
CollectivesSender, Kusama, KusamaMockNet, KusamaPallet, KusamaReceiver, KusamaSender,
|
||||
PenpalKusama, PenpalKusamaReceiver, PenpalKusamaSender, PenpalPolkadot, PenpalPolkadotReceiver,
|
||||
PenpalPolkadotSender, Polkadot, PolkadotMockNet, PolkadotPallet, PolkadotReceiver,
|
||||
PolkadotSender,
|
||||
};
|
||||
pub use polkadot_core_primitives::InboundDownwardMessage;
|
||||
pub use xcm::{
|
||||
+9
-7
@@ -5,13 +5,14 @@ fn reserve_transfer_native_asset_from_relay_to_assets() {
|
||||
// Init tests variables
|
||||
let amount = KUSAMA_ED * 1000;
|
||||
let relay_sender_balance_before = Kusama::account_data_of(KusamaSender::get()).free;
|
||||
let para_receiver_balance_before = Statemine::account_data_of(StatemineReceiver::get()).free;
|
||||
let para_receiver_balance_before =
|
||||
AssetHubKusama::account_data_of(AssetHubKusamaReceiver::get()).free;
|
||||
|
||||
let origin = <Kusama as Relay>::RuntimeOrigin::signed(KusamaSender::get());
|
||||
let assets_para_destination: VersionedMultiLocation =
|
||||
Kusama::child_location_of(Statemine::para_id()).into();
|
||||
Kusama::child_location_of(AssetHubKusama::para_id()).into();
|
||||
let beneficiary: VersionedMultiLocation =
|
||||
AccountId32 { network: None, id: StatemineReceiver::get().into() }.into();
|
||||
AccountId32 { network: None, id: AssetHubKusamaReceiver::get().into() }.into();
|
||||
let native_assets: VersionedMultiAssets = (Here, amount).into();
|
||||
let fee_asset_item = 0;
|
||||
let weight_limit = WeightLimit::Unlimited;
|
||||
@@ -40,11 +41,11 @@ fn reserve_transfer_native_asset_from_relay_to_assets() {
|
||||
});
|
||||
|
||||
// Receive XCM message in Assets Parachain
|
||||
Statemine::execute_with(|| {
|
||||
type RuntimeEvent = <Statemine as Para>::RuntimeEvent;
|
||||
AssetHubKusama::execute_with(|| {
|
||||
type RuntimeEvent = <AssetHubKusama as Para>::RuntimeEvent;
|
||||
|
||||
assert_expected_events!(
|
||||
Statemine,
|
||||
AssetHubKusama,
|
||||
vec![
|
||||
RuntimeEvent::DmpQueue(cumulus_pallet_dmp_queue::Event::ExecutedDownward {
|
||||
outcome: Outcome::Incomplete(_, Error::UntrustedReserveLocation),
|
||||
@@ -56,7 +57,8 @@ fn reserve_transfer_native_asset_from_relay_to_assets() {
|
||||
|
||||
// Check if balances are updated accordingly in Relay Chain and Assets Parachain
|
||||
let relay_sender_balance_after = Kusama::account_data_of(KusamaSender::get()).free;
|
||||
let para_sender_balance_after = Statemine::account_data_of(StatemineReceiver::get()).free;
|
||||
let para_sender_balance_after =
|
||||
AssetHubKusama::account_data_of(AssetHubKusamaReceiver::get()).free;
|
||||
|
||||
assert_eq!(relay_sender_balance_before - amount, relay_sender_balance_after);
|
||||
assert_eq!(para_sender_balance_after, para_receiver_balance_before);
|
||||
+10
-8
@@ -5,13 +5,14 @@ fn teleport_native_assets_from_relay_to_assets_para() {
|
||||
// Init tests variables
|
||||
let amount = KUSAMA_ED * 1000;
|
||||
let relay_sender_balance_before = Kusama::account_data_of(KusamaSender::get()).free;
|
||||
let para_receiver_balance_before = Statemine::account_data_of(StatemineReceiver::get()).free;
|
||||
let para_receiver_balance_before =
|
||||
AssetHubKusama::account_data_of(AssetHubKusamaReceiver::get()).free;
|
||||
|
||||
let origin = <Kusama as Relay>::RuntimeOrigin::signed(KusamaSender::get());
|
||||
let assets_para_destination: VersionedMultiLocation =
|
||||
Kusama::child_location_of(Statemine::para_id()).into();
|
||||
Kusama::child_location_of(AssetHubKusama::para_id()).into();
|
||||
let beneficiary: VersionedMultiLocation =
|
||||
AccountId32 { network: None, id: StatemineReceiver::get().into() }.into();
|
||||
AccountId32 { network: None, id: AssetHubKusamaReceiver::get().into() }.into();
|
||||
let native_assets: VersionedMultiAssets = (Here, amount).into();
|
||||
let fee_asset_item = 0;
|
||||
let weight_limit = WeightLimit::Unlimited;
|
||||
@@ -40,14 +41,14 @@ fn teleport_native_assets_from_relay_to_assets_para() {
|
||||
});
|
||||
|
||||
// Receive XCM message in Assets Parachain
|
||||
Statemine::execute_with(|| {
|
||||
type RuntimeEvent = <Statemine as Para>::RuntimeEvent;
|
||||
AssetHubKusama::execute_with(|| {
|
||||
type RuntimeEvent = <AssetHubKusama as Para>::RuntimeEvent;
|
||||
|
||||
assert_expected_events!(
|
||||
Statemine,
|
||||
AssetHubKusama,
|
||||
vec![
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, .. }) => {
|
||||
who: *who == StatemineReceiver::get().into(),
|
||||
who: *who == AssetHubKusamaReceiver::get().into(),
|
||||
},
|
||||
]
|
||||
);
|
||||
@@ -55,7 +56,8 @@ fn teleport_native_assets_from_relay_to_assets_para() {
|
||||
|
||||
// Check if balances are updated accordingly in Relay Chain and Assets Parachain
|
||||
let relay_sender_balance_after = Kusama::account_data_of(KusamaSender::get()).free;
|
||||
let para_sender_balance_after = Statemine::account_data_of(StatemineReceiver::get()).free;
|
||||
let para_sender_balance_after =
|
||||
AssetHubKusama::account_data_of(AssetHubKusamaReceiver::get()).free;
|
||||
|
||||
assert_eq!(relay_sender_balance_before - amount, relay_sender_balance_after);
|
||||
assert!(para_sender_balance_after > para_receiver_balance_before);
|
||||
+6
-6
@@ -6,14 +6,14 @@ fn transact_sudo_from_relay_to_assets_para() {
|
||||
// Call to be executed in Assets Parachain
|
||||
const ASSET_ID: u32 = 1;
|
||||
|
||||
let call = <Statemine as Para>::RuntimeCall::Assets(pallet_assets::Call::<
|
||||
<Statemine as Para>::Runtime,
|
||||
let call = <AssetHubKusama as Para>::RuntimeCall::Assets(pallet_assets::Call::<
|
||||
<AssetHubKusama as Para>::Runtime,
|
||||
Instance1,
|
||||
>::force_create {
|
||||
id: ASSET_ID.into(),
|
||||
is_sufficient: true,
|
||||
min_balance: 1000,
|
||||
owner: StatemineSender::get().into(),
|
||||
owner: AssetHubKusamaSender::get().into(),
|
||||
})
|
||||
.encode()
|
||||
.into();
|
||||
@@ -21,7 +21,7 @@ fn transact_sudo_from_relay_to_assets_para() {
|
||||
// XcmPallet send arguments
|
||||
let sudo_origin = <Kusama as Relay>::RuntimeOrigin::root();
|
||||
let assets_para_destination: VersionedMultiLocation =
|
||||
Kusama::child_location_of(Statemine::para_id()).into();
|
||||
Kusama::child_location_of(AssetHubKusama::para_id()).into();
|
||||
|
||||
let weight_limit = WeightLimit::Unlimited;
|
||||
let require_weight_at_most = Weight::from_parts(1000000000, 200000);
|
||||
@@ -52,7 +52,7 @@ fn transact_sudo_from_relay_to_assets_para() {
|
||||
});
|
||||
|
||||
// Receive XCM message in Assets Parachain
|
||||
Statemine::execute_with(|| {
|
||||
assert!(<Statemine as StateminePallet>::Assets::asset_exists(ASSET_ID));
|
||||
AssetHubKusama::execute_with(|| {
|
||||
assert!(<AssetHubKusama as AssetHubKusamaPallet>::Assets::asset_exists(ASSET_ID));
|
||||
});
|
||||
}
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
[package]
|
||||
name = "statemint-it"
|
||||
name = "asset-hub-polkadot-integration-tests"
|
||||
version = "1.0.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2021"
|
||||
description = "Statemint parachain runtime integration tests with xcm-emulator"
|
||||
description = "Asset Hub Polkadot runtime integration tests with xcm-emulator"
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false }
|
||||
@@ -29,7 +29,7 @@ pallet-xcm = { default-features = false, git = "https://github.com/paritytech/po
|
||||
# Cumulus
|
||||
parachains-common = { path = "../../../../common" }
|
||||
penpal-runtime = { path = "../../../../runtimes/testing/penpal" }
|
||||
statemint-runtime = { path = "../../../../runtimes/assets/statemint" }
|
||||
asset-hub-polkadot-runtime = { path = "../../../../runtimes/assets/asset-hub-polkadot" }
|
||||
|
||||
# Local
|
||||
xcm-emulator = { default-features = false, path = "../../../../../xcm/xcm-emulator" }
|
||||
+8
-7
@@ -8,13 +8,14 @@ pub use integration_tests_common::{
|
||||
polkadot::ED as POLKADOT_ED,
|
||||
PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3,
|
||||
},
|
||||
AccountId, BHKusama, BHKusamaPallet, BHKusamaReceiver, BHKusamaSender, BHPolkadot,
|
||||
BHPolkadotPallet, BHPolkadotReceiver, BHPolkadotSender, Collectives, CollectivesPallet,
|
||||
CollectivesReceiver, CollectivesSender, Kusama, KusamaMockNet, KusamaPallet, KusamaReceiver,
|
||||
KusamaSender, PenpalKusama, PenpalKusamaReceiver, PenpalKusamaSender, PenpalPolkadot,
|
||||
PenpalPolkadotReceiver, PenpalPolkadotSender, Polkadot, PolkadotMockNet, PolkadotPallet,
|
||||
PolkadotReceiver, PolkadotSender, Statemine, StateminePallet, StatemineReceiver,
|
||||
StatemineSender, Statemint, StatemintPallet, StatemintReceiver, StatemintSender,
|
||||
AccountId, AssetHubKusama, AssetHubKusamaPallet, AssetHubKusamaReceiver, AssetHubKusamaSender,
|
||||
AssetHubPolkadot, AssetHubPolkadotPallet, AssetHubPolkadotReceiver, AssetHubPolkadotSender,
|
||||
BHKusama, BHKusamaPallet, BHKusamaReceiver, BHKusamaSender, BHPolkadot, BHPolkadotPallet,
|
||||
BHPolkadotReceiver, BHPolkadotSender, Collectives, CollectivesPallet, CollectivesReceiver,
|
||||
CollectivesSender, Kusama, KusamaMockNet, KusamaPallet, KusamaReceiver, KusamaSender,
|
||||
PenpalKusama, PenpalKusamaReceiver, PenpalKusamaSender, PenpalPolkadot, PenpalPolkadotReceiver,
|
||||
PenpalPolkadotSender, Polkadot, PolkadotMockNet, PolkadotPallet, PolkadotReceiver,
|
||||
PolkadotSender,
|
||||
};
|
||||
pub use polkadot_core_primitives::InboundDownwardMessage;
|
||||
pub use xcm::{
|
||||
+9
-7
@@ -5,13 +5,14 @@ fn reserve_transfer_native_asset_from_relay_to_assets() {
|
||||
// Init tests variables
|
||||
let amount = POLKADOT_ED * 1000;
|
||||
let relay_sender_balance_before = Polkadot::account_data_of(PolkadotSender::get()).free;
|
||||
let para_receiver_balance_before = Statemint::account_data_of(StatemintReceiver::get()).free;
|
||||
let para_receiver_balance_before =
|
||||
AssetHubPolkadot::account_data_of(AssetHubPolkadotReceiver::get()).free;
|
||||
|
||||
let origin = <Polkadot as Relay>::RuntimeOrigin::signed(PolkadotSender::get());
|
||||
let assets_para_destination: VersionedMultiLocation =
|
||||
Polkadot::child_location_of(Statemint::para_id()).into();
|
||||
Polkadot::child_location_of(AssetHubPolkadot::para_id()).into();
|
||||
let beneficiary: VersionedMultiLocation =
|
||||
AccountId32 { network: None, id: StatemintReceiver::get().into() }.into();
|
||||
AccountId32 { network: None, id: AssetHubPolkadotReceiver::get().into() }.into();
|
||||
let native_assets: VersionedMultiAssets = (Here, amount).into();
|
||||
let fee_asset_item = 0;
|
||||
let weight_limit = WeightLimit::Unlimited;
|
||||
@@ -40,11 +41,11 @@ fn reserve_transfer_native_asset_from_relay_to_assets() {
|
||||
});
|
||||
|
||||
// Receive XCM message in Assets Parachain
|
||||
Statemint::execute_with(|| {
|
||||
type RuntimeEvent = <Statemint as Para>::RuntimeEvent;
|
||||
AssetHubPolkadot::execute_with(|| {
|
||||
type RuntimeEvent = <AssetHubPolkadot as Para>::RuntimeEvent;
|
||||
|
||||
assert_expected_events!(
|
||||
Statemint,
|
||||
AssetHubPolkadot,
|
||||
vec![
|
||||
RuntimeEvent::DmpQueue(cumulus_pallet_dmp_queue::Event::ExecutedDownward {
|
||||
outcome: Outcome::Incomplete(_, Error::UntrustedReserveLocation),
|
||||
@@ -56,7 +57,8 @@ fn reserve_transfer_native_asset_from_relay_to_assets() {
|
||||
|
||||
// Check if balances are updated accordingly in Relay Chain and Assets Parachain
|
||||
let relay_sender_balance_after = Polkadot::account_data_of(PolkadotSender::get()).free;
|
||||
let para_sender_balance_after = Statemint::account_data_of(StatemintReceiver::get()).free;
|
||||
let para_sender_balance_after =
|
||||
AssetHubPolkadot::account_data_of(AssetHubPolkadotReceiver::get()).free;
|
||||
|
||||
assert_eq!(relay_sender_balance_before - amount, relay_sender_balance_after);
|
||||
assert_eq!(para_sender_balance_after, para_receiver_balance_before);
|
||||
+10
-8
@@ -5,13 +5,14 @@ fn teleport_native_assets_from_relay_to_assets_para() {
|
||||
// Init tests variables
|
||||
let amount = POLKADOT_ED * 1000;
|
||||
let relay_sender_balance_before = Polkadot::account_data_of(PolkadotSender::get()).free;
|
||||
let para_receiver_balance_before = Statemint::account_data_of(StatemintReceiver::get()).free;
|
||||
let para_receiver_balance_before =
|
||||
AssetHubPolkadot::account_data_of(AssetHubPolkadotReceiver::get()).free;
|
||||
|
||||
let origin = <Polkadot as Relay>::RuntimeOrigin::signed(PolkadotSender::get());
|
||||
let assets_para_destination: VersionedMultiLocation =
|
||||
Polkadot::child_location_of(Statemint::para_id()).into();
|
||||
Polkadot::child_location_of(AssetHubPolkadot::para_id()).into();
|
||||
let beneficiary: VersionedMultiLocation =
|
||||
AccountId32 { network: None, id: StatemintReceiver::get().into() }.into();
|
||||
AccountId32 { network: None, id: AssetHubPolkadotReceiver::get().into() }.into();
|
||||
let native_assets: VersionedMultiAssets = (Here, amount).into();
|
||||
let fee_asset_item = 0;
|
||||
let weight_limit = WeightLimit::Unlimited;
|
||||
@@ -38,14 +39,14 @@ fn teleport_native_assets_from_relay_to_assets_para() {
|
||||
});
|
||||
|
||||
// Receive XCM message in Assets Parachain
|
||||
Statemint::execute_with(|| {
|
||||
type RuntimeEvent = <Statemint as Para>::RuntimeEvent;
|
||||
AssetHubPolkadot::execute_with(|| {
|
||||
type RuntimeEvent = <AssetHubPolkadot as Para>::RuntimeEvent;
|
||||
|
||||
assert_expected_events!(
|
||||
Statemint,
|
||||
AssetHubPolkadot,
|
||||
vec![
|
||||
RuntimeEvent::Balances(pallet_balances::Event::Deposit { who, .. }) => {
|
||||
who: *who == StatemintReceiver::get().into(),
|
||||
who: *who == AssetHubPolkadotReceiver::get().into(),
|
||||
},
|
||||
]
|
||||
);
|
||||
@@ -53,7 +54,8 @@ fn teleport_native_assets_from_relay_to_assets_para() {
|
||||
|
||||
// Check if balances are updated accordingly in Relay Chain and Assets Parachain
|
||||
let relay_sender_balance_after = Polkadot::account_data_of(PolkadotSender::get()).free;
|
||||
let para_sender_balance_after = Statemint::account_data_of(StatemintReceiver::get()).free;
|
||||
let para_sender_balance_after =
|
||||
AssetHubPolkadot::account_data_of(AssetHubPolkadotReceiver::get()).free;
|
||||
|
||||
assert_eq!(relay_sender_balance_before - amount, relay_sender_balance_after);
|
||||
assert!(para_sender_balance_after > para_receiver_balance_before);
|
||||
+6
-6
@@ -6,14 +6,14 @@ fn transact_sudo_from_relay_to_assets_para() {
|
||||
// Call to be executed in Assets Parachain
|
||||
const ASSET_ID: u32 = 1;
|
||||
|
||||
let call = <Statemint as Para>::RuntimeCall::Assets(pallet_assets::Call::<
|
||||
<Statemint as Para>::Runtime,
|
||||
let call = <AssetHubPolkadot as Para>::RuntimeCall::Assets(pallet_assets::Call::<
|
||||
<AssetHubPolkadot as Para>::Runtime,
|
||||
Instance1,
|
||||
>::force_create {
|
||||
id: ASSET_ID.into(),
|
||||
is_sufficient: true,
|
||||
min_balance: 1000,
|
||||
owner: StatemintSender::get().into(),
|
||||
owner: AssetHubPolkadotSender::get().into(),
|
||||
})
|
||||
.encode()
|
||||
.into();
|
||||
@@ -21,7 +21,7 @@ fn transact_sudo_from_relay_to_assets_para() {
|
||||
// XcmPallet send arguments
|
||||
let sudo_origin = <Polkadot as Relay>::RuntimeOrigin::root();
|
||||
let assets_para_destination: VersionedMultiLocation =
|
||||
Polkadot::child_location_of(Statemint::para_id()).into();
|
||||
Polkadot::child_location_of(AssetHubPolkadot::para_id()).into();
|
||||
|
||||
let weight_limit = WeightLimit::Unlimited;
|
||||
let require_weight_at_most = Weight::from_parts(1000000000, 200000);
|
||||
@@ -52,7 +52,7 @@ fn transact_sudo_from_relay_to_assets_para() {
|
||||
});
|
||||
|
||||
// Receive XCM message in Assets Parachain
|
||||
Statemint::execute_with(|| {
|
||||
assert!(<Statemint as StatemintPallet>::Assets::asset_exists(ASSET_ID));
|
||||
AssetHubPolkadot::execute_with(|| {
|
||||
assert!(<AssetHubPolkadot as AssetHubPolkadotPallet>::Assets::asset_exists(ASSET_ID));
|
||||
});
|
||||
}
|
||||
@@ -41,8 +41,8 @@ parachains-common = { path = "../../../common" }
|
||||
parachain-info = { path = "../../../pallets/parachain-info" }
|
||||
cumulus-primitives-core = { path = "../../../../primitives/core" }
|
||||
penpal-runtime = { path = "../../../runtimes/testing/penpal" }
|
||||
statemint-runtime = { path = "../../../runtimes/assets/statemint" }
|
||||
statemine-runtime = { path = "../../../runtimes/assets/statemine" }
|
||||
asset-hub-polkadot-runtime = { path = "../../../runtimes/assets/asset-hub-polkadot" }
|
||||
asset-hub-kusama-runtime = { path = "../../../runtimes/assets/asset-hub-kusama" }
|
||||
collectives-polkadot-runtime = { path = "../../../runtimes/collectives/collectives-polkadot" }
|
||||
bridge-hub-kusama-runtime = { path = "../../../runtimes/bridge-hubs/bridge-hub-kusama" }
|
||||
bridge-hub-polkadot-runtime = { path = "../../../runtimes/bridge-hubs/bridge-hub-polkadot" }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use grandpa::AuthorityId as GrandpaId;
|
||||
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
|
||||
pub use parachains_common::{AccountId, AuraId, Balance, BlockNumber, StatemintAuraId};
|
||||
pub use parachains_common::{AccountId, AssetHubPolkadotAuraId, AuraId, Balance, BlockNumber};
|
||||
use polkadot_primitives::{AssignmentId, ValidatorId};
|
||||
pub use polkadot_runtime_parachains::configuration::HostConfiguration;
|
||||
use polkadot_service::chain_spec::get_authority_keys_from_seed_no_beefy;
|
||||
@@ -71,15 +71,15 @@ pub mod accounts {
|
||||
pub mod collators {
|
||||
use super::*;
|
||||
|
||||
pub fn invulnerables_statemint() -> Vec<(AccountId, StatemintAuraId)> {
|
||||
pub fn invulnerables_asset_hub_polkadot() -> Vec<(AccountId, AssetHubPolkadotAuraId)> {
|
||||
vec![
|
||||
(
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
get_from_seed::<StatemintAuraId>("Alice"),
|
||||
get_from_seed::<AssetHubPolkadotAuraId>("Alice"),
|
||||
),
|
||||
(
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob"),
|
||||
get_from_seed::<StatemintAuraId>("Bob"),
|
||||
get_from_seed::<AssetHubPolkadotAuraId>("Bob"),
|
||||
),
|
||||
]
|
||||
}
|
||||
@@ -305,29 +305,31 @@ pub mod kusama {
|
||||
}
|
||||
}
|
||||
|
||||
// Statemint
|
||||
pub mod statemint {
|
||||
// Asset Hub Polkadot
|
||||
pub mod asset_hub_polkadot {
|
||||
use super::*;
|
||||
pub const PARA_ID: u32 = 1000;
|
||||
pub const ED: Balance = statemint_runtime::constants::currency::EXISTENTIAL_DEPOSIT;
|
||||
pub const ED: Balance = asset_hub_polkadot_runtime::constants::currency::EXISTENTIAL_DEPOSIT;
|
||||
|
||||
pub fn genesis() -> Storage {
|
||||
let genesis_config = statemint_runtime::GenesisConfig {
|
||||
system: statemint_runtime::SystemConfig {
|
||||
code: statemint_runtime::WASM_BINARY
|
||||
let genesis_config = asset_hub_polkadot_runtime::GenesisConfig {
|
||||
system: asset_hub_polkadot_runtime::SystemConfig {
|
||||
code: asset_hub_polkadot_runtime::WASM_BINARY
|
||||
.expect("WASM binary was not build, please build it!")
|
||||
.to_vec(),
|
||||
},
|
||||
balances: statemint_runtime::BalancesConfig {
|
||||
balances: asset_hub_polkadot_runtime::BalancesConfig {
|
||||
balances: accounts::init_balances()
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|k| (k, ED * 4096))
|
||||
.collect(),
|
||||
},
|
||||
parachain_info: statemint_runtime::ParachainInfoConfig { parachain_id: PARA_ID.into() },
|
||||
collator_selection: statemint_runtime::CollatorSelectionConfig {
|
||||
invulnerables: collators::invulnerables_statemint()
|
||||
parachain_info: asset_hub_polkadot_runtime::ParachainInfoConfig {
|
||||
parachain_id: PARA_ID.into(),
|
||||
},
|
||||
collator_selection: asset_hub_polkadot_runtime::CollatorSelectionConfig {
|
||||
invulnerables: collators::invulnerables_asset_hub_polkadot()
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|(acc, _)| acc)
|
||||
@@ -335,14 +337,14 @@ pub mod statemint {
|
||||
candidacy_bond: ED * 16,
|
||||
..Default::default()
|
||||
},
|
||||
session: statemint_runtime::SessionConfig {
|
||||
keys: collators::invulnerables_statemint()
|
||||
session: asset_hub_polkadot_runtime::SessionConfig {
|
||||
keys: collators::invulnerables_asset_hub_polkadot()
|
||||
.into_iter()
|
||||
.map(|(acc, aura)| {
|
||||
(
|
||||
acc.clone(), // account id
|
||||
acc, // validator id
|
||||
statemint_runtime::SessionKeys { aura }, // session keys
|
||||
acc.clone(), // account id
|
||||
acc, // validator id
|
||||
asset_hub_polkadot_runtime::SessionKeys { aura }, // session keys
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
@@ -350,7 +352,7 @@ pub mod statemint {
|
||||
aura: Default::default(),
|
||||
aura_ext: Default::default(),
|
||||
parachain_system: Default::default(),
|
||||
polkadot_xcm: statemint_runtime::PolkadotXcmConfig {
|
||||
polkadot_xcm: asset_hub_polkadot_runtime::PolkadotXcmConfig {
|
||||
safe_xcm_version: Some(SAFE_XCM_VERSION),
|
||||
},
|
||||
};
|
||||
@@ -359,28 +361,30 @@ pub mod statemint {
|
||||
}
|
||||
}
|
||||
|
||||
// Statemint
|
||||
pub mod statemine {
|
||||
// Asset Hub Kusama
|
||||
pub mod asset_hub_kusama {
|
||||
use super::*;
|
||||
pub const PARA_ID: u32 = 1000;
|
||||
pub const ED: Balance = statemine_runtime::constants::currency::EXISTENTIAL_DEPOSIT;
|
||||
pub const ED: Balance = asset_hub_kusama_runtime::constants::currency::EXISTENTIAL_DEPOSIT;
|
||||
|
||||
pub fn genesis() -> Storage {
|
||||
let genesis_config = statemine_runtime::GenesisConfig {
|
||||
system: statemine_runtime::SystemConfig {
|
||||
code: statemine_runtime::WASM_BINARY
|
||||
let genesis_config = asset_hub_kusama_runtime::GenesisConfig {
|
||||
system: asset_hub_kusama_runtime::SystemConfig {
|
||||
code: asset_hub_kusama_runtime::WASM_BINARY
|
||||
.expect("WASM binary was not build, please build it!")
|
||||
.to_vec(),
|
||||
},
|
||||
balances: statemine_runtime::BalancesConfig {
|
||||
balances: asset_hub_kusama_runtime::BalancesConfig {
|
||||
balances: accounts::init_balances()
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|k| (k, ED * 4096))
|
||||
.collect(),
|
||||
},
|
||||
parachain_info: statemine_runtime::ParachainInfoConfig { parachain_id: PARA_ID.into() },
|
||||
collator_selection: statemine_runtime::CollatorSelectionConfig {
|
||||
parachain_info: asset_hub_kusama_runtime::ParachainInfoConfig {
|
||||
parachain_id: PARA_ID.into(),
|
||||
},
|
||||
collator_selection: asset_hub_kusama_runtime::CollatorSelectionConfig {
|
||||
invulnerables: collators::invulnerables()
|
||||
.iter()
|
||||
.cloned()
|
||||
@@ -389,14 +393,14 @@ pub mod statemine {
|
||||
candidacy_bond: ED * 16,
|
||||
..Default::default()
|
||||
},
|
||||
session: statemine_runtime::SessionConfig {
|
||||
session: asset_hub_kusama_runtime::SessionConfig {
|
||||
keys: collators::invulnerables()
|
||||
.into_iter()
|
||||
.map(|(acc, aura)| {
|
||||
(
|
||||
acc.clone(), // account id
|
||||
acc, // validator id
|
||||
statemine_runtime::SessionKeys { aura }, // session keys
|
||||
acc.clone(), // account id
|
||||
acc, // validator id
|
||||
asset_hub_kusama_runtime::SessionKeys { aura }, // session keys
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
@@ -404,7 +408,7 @@ pub mod statemine {
|
||||
aura: Default::default(),
|
||||
aura_ext: Default::default(),
|
||||
parachain_system: Default::default(),
|
||||
polkadot_xcm: statemine_runtime::PolkadotXcmConfig {
|
||||
polkadot_xcm: asset_hub_kusama_runtime::PolkadotXcmConfig {
|
||||
safe_xcm_version: Some(SAFE_XCM_VERSION),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -2,11 +2,11 @@ pub mod constants;
|
||||
|
||||
pub use constants::{
|
||||
accounts::{ALICE, BOB},
|
||||
bridge_hub_kusama, bridge_hub_polkadot, collectives, kusama, penpal, polkadot, statemine,
|
||||
statemint,
|
||||
asset_hub_kusama, asset_hub_polkadot, bridge_hub_kusama, bridge_hub_polkadot, collectives,
|
||||
kusama, penpal, polkadot,
|
||||
};
|
||||
use frame_support::{parameter_types, sp_io, sp_tracing};
|
||||
pub use parachains_common::{AccountId, AuraId, Balance, BlockNumber, StatemintAuraId};
|
||||
pub use parachains_common::{AccountId, AssetHubPolkadotAuraId, AuraId, Balance, BlockNumber};
|
||||
pub use sp_core::{sr25519, storage::Storage, Get};
|
||||
use xcm::prelude::*;
|
||||
use xcm_emulator::{
|
||||
@@ -56,25 +56,25 @@ decl_test_relay_chains! {
|
||||
|
||||
decl_test_parachains! {
|
||||
// Polkadot
|
||||
pub struct Statemint {
|
||||
genesis = statemint::genesis(),
|
||||
pub struct AssetHubPolkadot {
|
||||
genesis = asset_hub_polkadot::genesis(),
|
||||
on_init = (),
|
||||
runtime = {
|
||||
Runtime: statemint_runtime::Runtime,
|
||||
RuntimeOrigin: statemint_runtime::RuntimeOrigin,
|
||||
RuntimeCall: statemint_runtime::RuntimeCall,
|
||||
RuntimeEvent: statemint_runtime::RuntimeEvent,
|
||||
XcmpMessageHandler: statemint_runtime::XcmpQueue,
|
||||
DmpMessageHandler: statemint_runtime::DmpQueue,
|
||||
LocationToAccountId: statemint_runtime::xcm_config::LocationToAccountId,
|
||||
System: statemint_runtime::System,
|
||||
Balances: statemint_runtime::Balances,
|
||||
ParachainSystem: statemint_runtime::ParachainSystem,
|
||||
ParachainInfo: statemint_runtime::ParachainInfo,
|
||||
Runtime: asset_hub_polkadot_runtime::Runtime,
|
||||
RuntimeOrigin: asset_hub_polkadot_runtime::RuntimeOrigin,
|
||||
RuntimeCall: asset_hub_polkadot_runtime::RuntimeCall,
|
||||
RuntimeEvent: asset_hub_polkadot_runtime::RuntimeEvent,
|
||||
XcmpMessageHandler: asset_hub_polkadot_runtime::XcmpQueue,
|
||||
DmpMessageHandler: asset_hub_polkadot_runtime::DmpQueue,
|
||||
LocationToAccountId: asset_hub_polkadot_runtime::xcm_config::LocationToAccountId,
|
||||
System: asset_hub_polkadot_runtime::System,
|
||||
Balances: asset_hub_polkadot_runtime::Balances,
|
||||
ParachainSystem: asset_hub_polkadot_runtime::ParachainSystem,
|
||||
ParachainInfo: asset_hub_polkadot_runtime::ParachainInfo,
|
||||
},
|
||||
pallets_extra = {
|
||||
PolkadotXcm: statemint_runtime::PolkadotXcm,
|
||||
Assets: statemint_runtime::Assets,
|
||||
PolkadotXcm: asset_hub_polkadot_runtime::PolkadotXcm,
|
||||
Assets: asset_hub_polkadot_runtime::Assets,
|
||||
}
|
||||
},
|
||||
pub struct PenpalPolkadot {
|
||||
@@ -99,26 +99,26 @@ decl_test_parachains! {
|
||||
}
|
||||
},
|
||||
// Kusama
|
||||
pub struct Statemine {
|
||||
genesis = statemine::genesis(),
|
||||
pub struct AssetHubKusama {
|
||||
genesis = asset_hub_kusama::genesis(),
|
||||
on_init = (),
|
||||
runtime = {
|
||||
Runtime: statemine_runtime::Runtime,
|
||||
RuntimeOrigin: statemine_runtime::RuntimeOrigin,
|
||||
RuntimeCall: statemine_runtime::RuntimeCall,
|
||||
RuntimeEvent: statemine_runtime::RuntimeEvent,
|
||||
XcmpMessageHandler: statemine_runtime::XcmpQueue,
|
||||
DmpMessageHandler: statemine_runtime::DmpQueue,
|
||||
LocationToAccountId: statemine_runtime::xcm_config::LocationToAccountId,
|
||||
System: statemine_runtime::System,
|
||||
Balances: statemine_runtime::Balances,
|
||||
ParachainSystem: statemine_runtime::ParachainSystem,
|
||||
ParachainInfo: statemine_runtime::ParachainInfo,
|
||||
Runtime: asset_hub_kusama_runtime::Runtime,
|
||||
RuntimeOrigin: asset_hub_kusama_runtime::RuntimeOrigin,
|
||||
RuntimeCall: asset_hub_kusama_runtime::RuntimeCall,
|
||||
RuntimeEvent: asset_hub_kusama_runtime::RuntimeEvent,
|
||||
XcmpMessageHandler: asset_hub_kusama_runtime::XcmpQueue,
|
||||
DmpMessageHandler: asset_hub_kusama_runtime::DmpQueue,
|
||||
LocationToAccountId: asset_hub_kusama_runtime::xcm_config::LocationToAccountId,
|
||||
System: asset_hub_kusama_runtime::System,
|
||||
Balances: asset_hub_kusama_runtime::Balances,
|
||||
ParachainSystem: asset_hub_kusama_runtime::ParachainSystem,
|
||||
ParachainInfo: asset_hub_kusama_runtime::ParachainInfo,
|
||||
},
|
||||
pallets_extra = {
|
||||
PolkadotXcm: statemine_runtime::PolkadotXcm,
|
||||
Assets: statemine_runtime::Assets,
|
||||
ForeignAssets: statemine_runtime::Assets,
|
||||
PolkadotXcm: asset_hub_kusama_runtime::PolkadotXcm,
|
||||
Assets: asset_hub_kusama_runtime::Assets,
|
||||
ForeignAssets: asset_hub_kusama_runtime::Assets,
|
||||
}
|
||||
},
|
||||
pub struct PenpalKusama {
|
||||
@@ -208,7 +208,7 @@ decl_test_networks! {
|
||||
pub struct PolkadotMockNet {
|
||||
relay_chain = Polkadot,
|
||||
parachains = vec![
|
||||
Statemint,
|
||||
AssetHubPolkadot,
|
||||
PenpalPolkadot,
|
||||
Collectives,
|
||||
BHPolkadot,
|
||||
@@ -217,7 +217,7 @@ decl_test_networks! {
|
||||
pub struct KusamaMockNet {
|
||||
relay_chain = Kusama,
|
||||
parachains = vec![
|
||||
Statemine,
|
||||
AssetHubKusama,
|
||||
PenpalKusama,
|
||||
BHKusama,
|
||||
],
|
||||
@@ -231,12 +231,12 @@ parameter_types! {
|
||||
// Kusama
|
||||
pub KusamaSender: AccountId = Kusama::account_id_of(ALICE);
|
||||
pub KusamaReceiver: AccountId = Kusama::account_id_of(BOB);
|
||||
// Statemint
|
||||
pub StatemintSender: AccountId = Statemint::account_id_of(ALICE);
|
||||
pub StatemintReceiver: AccountId = Statemint::account_id_of(BOB);
|
||||
// Statemine
|
||||
pub StatemineSender: AccountId = Statemine::account_id_of(ALICE);
|
||||
pub StatemineReceiver: AccountId = Statemine::account_id_of(BOB);
|
||||
// Asset Hub Polkadot
|
||||
pub AssetHubPolkadotSender: AccountId = AssetHubPolkadot::account_id_of(ALICE);
|
||||
pub AssetHubPolkadotReceiver: AccountId = AssetHubPolkadot::account_id_of(BOB);
|
||||
// Asset Hub Kusama
|
||||
pub AssetHubKusamaSender: AccountId = AssetHubKusama::account_id_of(ALICE);
|
||||
pub AssetHubKusamaReceiver: AccountId = AssetHubKusama::account_id_of(BOB);
|
||||
// Penpal Polkadot
|
||||
pub PenpalPolkadotSender: AccountId = PenpalPolkadot::account_id_of(ALICE);
|
||||
pub PenpalPolkadotReceiver: AccountId = PenpalPolkadot::account_id_of(BOB);
|
||||
|
||||
Reference in New Issue
Block a user