Skip to content

Commit 56de0a9

Browse files
[tests] add more e2e tests, make emulated setup closer to ecosystem reality (#428)
In the real world, not all assets are sufficient. This aligns our emulated networks to that reality. Only DOT/KSM and USDT are sufficient "by default" in tests. Also added more e2e tests. - [x] Does not require a CHANGELOG entry --------- Co-authored-by: fellowship-merge-bot[bot] <151052383+fellowship-merge-bot[bot]@users.noreply.github.com>
1 parent 4fd2981 commit 56de0a9

File tree

25 files changed

+1412
-715
lines changed

25 files changed

+1412
-715
lines changed

integration-tests/emulated/chains/parachains/assets/asset-hub-kusama/src/genesis.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ use xcm::prelude::*;
2828

2929
pub const PARA_ID: u32 = 1000;
3030
pub const ED: Balance = asset_hub_kusama_runtime::ExistentialDeposit::get();
31+
pub const USDT_ID: u32 = 1984;
3132

3233
frame_support::parameter_types! {
3334
pub AssetHubKusamaAssetOwner: AccountId = get_account_id_from_seed::<sr25519::Public>("Alice");
@@ -77,7 +78,10 @@ pub fn genesis() -> Storage {
7778
..Default::default()
7879
},
7980
assets: asset_hub_kusama_runtime::AssetsConfig {
80-
assets: vec![(RESERVABLE_ASSET_ID, AssetHubKusamaAssetOwner::get(), true, ED)],
81+
assets: vec![
82+
(RESERVABLE_ASSET_ID, AssetHubKusamaAssetOwner::get(), false, ED),
83+
(USDT_ID, AssetHubKusamaAssetOwner::get(), true, ED),
84+
],
8185
..Default::default()
8286
},
8387
foreign_assets: asset_hub_kusama_runtime::ForeignAssetsConfig {
@@ -86,7 +90,7 @@ pub fn genesis() -> Storage {
8690
(
8791
PenpalATeleportableAssetLocation::get().try_into().unwrap(),
8892
PenpalASiblingSovereignAccount::get(),
89-
true,
93+
false,
9094
ED,
9195
),
9296
],

integration-tests/emulated/chains/parachains/assets/asset-hub-polkadot/src/genesis.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ use xcm::prelude::*;
2929

3030
pub const PARA_ID: u32 = 1000;
3131
pub const ED: Balance = asset_hub_polkadot_runtime::ExistentialDeposit::get();
32+
pub const USDT_ID: u32 = 1984;
3233

3334
frame_support::parameter_types! {
3435
pub AssetHubPolkadotAssetOwner: AccountId = get_account_id_from_seed::<sr25519::Public>("Alice");
@@ -103,7 +104,10 @@ pub fn genesis() -> Storage {
103104
..Default::default()
104105
},
105106
assets: asset_hub_polkadot_runtime::AssetsConfig {
106-
assets: vec![(RESERVABLE_ASSET_ID, AssetHubPolkadotAssetOwner::get(), true, ED)],
107+
assets: vec![
108+
(RESERVABLE_ASSET_ID, AssetHubPolkadotAssetOwner::get(), false, ED),
109+
(USDT_ID, AssetHubPolkadotAssetOwner::get(), true, ED),
110+
],
107111
..Default::default()
108112
},
109113
foreign_assets: asset_hub_polkadot_runtime::ForeignAssetsConfig {
@@ -112,13 +116,13 @@ pub fn genesis() -> Storage {
112116
(
113117
PenpalATeleportableAssetLocation::get().try_into().unwrap(),
114118
PenpalASiblingSovereignAccount::get(),
115-
true,
119+
false,
116120
ED,
117121
),
118122
(
119123
PenpalBTeleportableAssetLocation::get().try_into().unwrap(),
120124
PenpalBSiblingSovereignAccount::get(),
121-
true,
125+
false,
122126
ED,
123127
),
124128
],

integration-tests/emulated/tests/assets/asset-hub-kusama/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ pub use codec::Encode;
1818
// Substrate
1919
pub use frame_support::{
2020
assert_err, assert_ok,
21+
dispatch::RawOrigin,
2122
pallet_prelude::Weight,
2223
sp_runtime::{AccountId32, DispatchError, DispatchResult},
2324
traits::fungibles::Inspect,
2425
};
26+
pub use sp_runtime::traits::Dispatchable;
2527

2628
// Polkadot
2729
pub use xcm::{
@@ -41,6 +43,9 @@ pub use emulated_integration_tests_common::{
4143
xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution},
4244
PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, RESERVABLE_ASSET_ID, XCM_V3,
4345
};
46+
pub use integration_tests_helpers::{
47+
test_parachain_is_trusted_teleporter_for_relay, test_relay_is_trusted_teleporter,
48+
};
4449
pub use kusama_runtime::xcm_config::UniversalLocation as KusamaUniversalLocation;
4550
pub use kusama_system_emulated_network::{
4651
asset_hub_kusama_emulated_chain::{
@@ -67,8 +72,8 @@ pub const ASSET_MIN_BALANCE: u128 = 1000;
6772
// `Assets` pallet index
6873
pub const ASSETS_PALLET_ID: u8 = 50;
6974

70-
pub type RelayToSystemParaTest = Test<Kusama, AssetHubKusama>;
7175
pub type RelayToParaTest = Test<Kusama, PenpalA>;
76+
pub type ParaToRelayTest = Test<PenpalA, Kusama>;
7277
pub type SystemParaToRelayTest = Test<AssetHubKusama, Kusama>;
7378
pub type SystemParaToParaTest = Test<AssetHubKusama, PenpalA>;
7479
pub type ParaToSystemParaTest = Test<PenpalA, AssetHubKusama>;

0 commit comments

Comments
 (0)