|
16 | 16 |
|
17 | 17 | pub use codec::Encode; |
18 | 18 | pub use frame_support::{ |
19 | | - assert_ok, instances::Instance1, pallet_prelude::Weight, traits::fungibles::Inspect, |
| 19 | + assert_err, assert_ok, |
| 20 | + instances::Instance1, |
| 21 | + pallet_prelude::Weight, |
| 22 | + sp_runtime::{AccountId32, DispatchError, DispatchResult, MultiAddress}, |
| 23 | + traits::{fungibles::Inspect, OriginTrait}, |
20 | 24 | }; |
21 | 25 | pub use integration_tests_common::{ |
22 | 26 | constants::{ |
23 | 27 | accounts::{ALICE, BOB}, |
| 28 | + asset_hub_kusama::ED as ASSET_HUB_KUSAMA_ED, |
24 | 29 | kusama::ED as KUSAMA_ED, |
25 | 30 | PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, |
26 | 31 | }, |
27 | | - AccountId, AssetHubKusama, AssetHubKusamaPallet, AssetHubKusamaReceiver, AssetHubKusamaSender, |
28 | | - BridgeHubKusama, BridgeHubKusamaPallet, BridgeHubKusamaReceiver, BridgeHubKusamaSender, |
29 | | - BridgeHubPolkadot, BridgeHubPolkadotPallet, BridgeHubPolkadotReceiver, BridgeHubPolkadotSender, |
30 | | - Collectives, CollectivesPallet, CollectivesReceiver, CollectivesSender, Kusama, KusamaMockNet, |
31 | | - KusamaPallet, KusamaReceiver, KusamaSender, PenpalKusama, PenpalKusamaReceiver, |
32 | | - PenpalKusamaSender, PenpalPolkadot, PenpalPolkadotReceiver, PenpalPolkadotSender, Polkadot, |
| 32 | + lazy_static::lazy_static, |
| 33 | + xcm_transact_paid_execution, xcm_transact_unpaid_execution, AssetHubKusama, |
| 34 | + AssetHubKusamaPallet, AssetHubKusamaReceiver, AssetHubKusamaSender, BridgeHubKusama, |
| 35 | + BridgeHubKusamaPallet, BridgeHubKusamaReceiver, BridgeHubKusamaSender, BridgeHubPolkadot, |
| 36 | + BridgeHubPolkadotPallet, BridgeHubPolkadotReceiver, BridgeHubPolkadotSender, Collectives, |
| 37 | + CollectivesPallet, CollectivesReceiver, CollectivesSender, Kusama, KusamaMockNet, KusamaPallet, |
| 38 | + KusamaReceiver, KusamaSender, PenpalKusamaA, PenpalKusamaAPallet, PenpalKusamaAReceiver, |
| 39 | + PenpalKusamaASender, PenpalKusamaB, PenpalKusamaBPallet, PenpalKusamaBReceiver, |
| 40 | + PenpalKusamaBSender, PenpalPolkadotA, PenpalPolkadotAReceiver, PenpalPolkadotASender, Polkadot, |
33 | 41 | PolkadotMockNet, PolkadotPallet, PolkadotReceiver, PolkadotSender, |
34 | 42 | }; |
| 43 | +pub use parachains_common::{AccountId, Balance}; |
35 | 44 | pub use polkadot_core_primitives::InboundDownwardMessage; |
| 45 | +pub use polkadot_parachain::primitives::{HrmpChannelId, Id}; |
| 46 | +pub use polkadot_runtime_parachains::inclusion::{AggregateMessageOrigin, UmpQueueId}; |
36 | 47 | pub use xcm::{ |
37 | 48 | prelude::*, |
38 | 49 | v3::{Error, NetworkId::Kusama as KusamaId}, |
| 50 | + DoubleEncoded, |
39 | 51 | }; |
40 | 52 | pub use xcm_emulator::{ |
41 | 53 | assert_expected_events, bx, cumulus_pallet_dmp_queue, helpers::weight_within_threshold, |
42 | | - Parachain as Para, RelayChain as Relay, TestExt, |
| 54 | + AccountId32Junction, Chain, ParaId, Parachain as Para, RelayChain as Relay, Test, TestArgs, |
| 55 | + TestContext, TestExt, TestExternalities, |
43 | 56 | }; |
44 | 57 |
|
| 58 | +pub const ASSET_ID: u32 = 1; |
| 59 | +pub const ASSET_MIN_BALANCE: u128 = 1000; |
| 60 | +// `Assets` pallet index |
| 61 | +pub const ASSETS_PALLET_ID: u8 = 50; |
| 62 | + |
| 63 | +pub type RelayToSystemParaTest = Test<Kusama, AssetHubKusama>; |
| 64 | +pub type SystemParaToRelayTest = Test<AssetHubKusama, Kusama>; |
| 65 | +pub type SystemParaToParaTest = Test<AssetHubKusama, PenpalKusamaA>; |
| 66 | + |
| 67 | +/// Returns a `TestArgs` instance to de used for the Relay Chain accross integraton tests |
| 68 | +pub fn relay_test_args(amount: Balance) -> TestArgs { |
| 69 | + TestArgs { |
| 70 | + dest: Kusama::child_location_of(AssetHubKusama::para_id()), |
| 71 | + beneficiary: AccountId32Junction { |
| 72 | + network: None, |
| 73 | + id: AssetHubKusamaReceiver::get().into(), |
| 74 | + } |
| 75 | + .into(), |
| 76 | + amount, |
| 77 | + assets: (Here, amount).into(), |
| 78 | + asset_id: None, |
| 79 | + fee_asset_item: 0, |
| 80 | + weight_limit: WeightLimit::Unlimited, |
| 81 | + } |
| 82 | +} |
| 83 | + |
| 84 | +/// Returns a `TestArgs` instance to de used for the System Parachain accross integraton tests |
| 85 | +pub fn system_para_test_args( |
| 86 | + dest: MultiLocation, |
| 87 | + beneficiary_id: AccountId32, |
| 88 | + amount: Balance, |
| 89 | + assets: MultiAssets, |
| 90 | + asset_id: Option<u32>, |
| 91 | +) -> TestArgs { |
| 92 | + TestArgs { |
| 93 | + dest, |
| 94 | + beneficiary: AccountId32Junction { network: None, id: beneficiary_id.into() }.into(), |
| 95 | + amount, |
| 96 | + assets, |
| 97 | + asset_id, |
| 98 | + fee_asset_item: 0, |
| 99 | + weight_limit: WeightLimit::Unlimited, |
| 100 | + } |
| 101 | +} |
| 102 | + |
45 | 103 | #[cfg(test)] |
46 | 104 | mod tests; |
0 commit comments