referrerpolicy=no-referrer-when-downgrade

bridge_hub_westend_integration_tests/
lib.rs

1// Copyright (C) Parity Technologies (UK) Ltd.
2// SPDX-License-Identifier: Apache-2.0
3
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// 	http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16#[cfg(test)]
17mod imports {
18	// Substrate
19	pub(crate) use codec::Encode;
20	pub(crate) use frame_support::{
21		assert_err, assert_ok, pallet_prelude::DispatchResult, BoundedVec,
22	};
23	pub(crate) use sp_core::H160;
24	pub(crate) use sp_runtime::DispatchError;
25
26	// Polkadot
27	pub(crate) use xcm::{
28		latest::{ParentThen, ROCOCO_GENESIS_HASH, WESTEND_GENESIS_HASH},
29		prelude::{AccountId32 as AccountId32Junction, *},
30		v5,
31	};
32	pub(crate) use xcm_executor::traits::TransferType;
33	// Cumulus
34	pub(crate) use emulated_integration_tests_common::{
35		accounts::ALICE,
36		create_pool_with_native_on,
37		impls::Inspect,
38		test_dry_run_transfer_across_pk_bridge, test_parachain_is_trusted_teleporter,
39		test_parachain_is_trusted_teleporter_for_relay, test_relay_is_trusted_teleporter,
40		xcm_emulator::{
41			assert_expected_events, bx, Chain, Parachain as Para, RelayChain as Relay, TestExt,
42		},
43		xcm_helpers::xcm_transact_paid_execution,
44		ASSETS_PALLET_ID, USDT_ID,
45	};
46	pub(crate) use parachains_common::AccountId;
47	pub(crate) use rococo_westend_system_emulated_network::{
48		asset_hub_rococo_emulated_chain::{
49			asset_hub_rococo_runtime::xcm_config::TreasuryAccount,
50			genesis::ED as ASSET_HUB_ROCOCO_ED, AssetHubRococoParaPallet as AssetHubRococoPallet,
51		},
52		asset_hub_westend_emulated_chain::{
53			genesis::{AssetHubWestendAssetOwner, ED as ASSET_HUB_WESTEND_ED},
54			AssetHubWestendParaPallet as AssetHubWestendPallet,
55		},
56		bridge_hub_westend_emulated_chain::{
57			bridge_hub_westend_runtime, genesis::ED as BRIDGE_HUB_WESTEND_ED,
58			BridgeHubWestendExistentialDeposit,
59			BridgeHubWestendParaPallet as BridgeHubWestendPallet, BridgeHubWestendRuntimeOrigin,
60		},
61		penpal_emulated_chain::{
62			self,
63			penpal_runtime::xcm_config::{
64				CustomizableAssetFromSystemAssetHub as PenpalCustomizableAssetFromSystemAssetHub,
65				LocalTeleportableToAssetHub as PenpalLocalTeleportableToAssetHub,
66				UniversalLocation as PenpalUniversalLocation,
67			},
68			PenpalAParaPallet as PenpalAPallet, PenpalAssetOwner,
69			PenpalBParaPallet as PenpalBPallet,
70		},
71		rococo_emulated_chain::RococoRelayPallet as RococoPallet,
72		westend_emulated_chain::{genesis::ED as WESTEND_ED, WestendRelayPallet as WestendPallet},
73		AssetHubRococoPara as AssetHubRococo, AssetHubRococoParaReceiver as AssetHubRococoReceiver,
74		AssetHubRococoParaSender as AssetHubRococoSender, AssetHubWestendPara as AssetHubWestend,
75		AssetHubWestendParaReceiver as AssetHubWestendReceiver,
76		AssetHubWestendParaSender as AssetHubWestendSender, BridgeHubRococoPara as BridgeHubRococo,
77		BridgeHubWestendPara as BridgeHubWestend,
78		BridgeHubWestendParaReceiver as BridgeHubWestendReceiver,
79		BridgeHubWestendParaSender as BridgeHubWestendSender, PenpalAPara as PenpalA,
80		PenpalAParaReceiver as PenpalAReceiver, PenpalBPara as PenpalB,
81		PenpalBParaReceiver as PenpalBReceiver, PenpalBParaSender as PenpalBSender,
82		RococoRelay as Rococo, RococoRelayReceiver as RococoReceiver, WestendRelay as Westend,
83		WestendRelayReceiver as WestendReceiver, WestendRelaySender as WestendSender,
84	};
85
86	pub(crate) const ASSET_ID: u32 = 1;
87	pub(crate) const ASSET_MIN_BALANCE: u128 = 1000;
88}
89
90#[cfg(test)]
91mod tests;