diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/lib.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/lib.rs index a61ea528bf5f..50acaa79b678 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/lib.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-kusama/src/lib.rs @@ -23,24 +23,22 @@ pub use frame_support::{ }; pub use integration_tests_common::{ constants::{ - asset_hub_kusama::ED as ASSET_HUB_KUSAMA_ED, - kusama::ED as KUSAMA_ED, - PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, + asset_hub_kusama::ED as ASSET_HUB_KUSAMA_ED, kusama::ED as KUSAMA_ED, PROOF_SIZE_THRESHOLD, + REF_TIME_THRESHOLD, XCM_V3, }, - xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, AssetHubKusama, - Kusama, PenpalKusamaA, AssetHubKusamaReceiver, KusamaPallet, AssetHubKusamaPallet, - AssetHubKusamaSender, PenpalKusamaAReceiver, KusamaReceiver, KusamaSender, - PenpalKusamaAPallet, PenpalKusamaASender + xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, + AssetHubKusama, AssetHubKusamaPallet, AssetHubKusamaReceiver, AssetHubKusamaSender, Kusama, + KusamaPallet, KusamaReceiver, KusamaSender, PenpalKusamaA, PenpalKusamaAPallet, + PenpalKusamaAReceiver, PenpalKusamaASender, }; pub use parachains_common::{AccountId, Balance}; pub use xcm::{ - prelude::{*, AccountId32 as AccountId32Junction}, + prelude::{AccountId32 as AccountId32Junction, *}, v3::{Error, NetworkId::Kusama as KusamaId}, }; pub use xcm_emulator::{ - assert_expected_events, bx, helpers::weight_within_threshold, - Chain, Parachain as Para, RelayChain as Relay, Test, TestArgs, - TestContext, TestExt + assert_expected_events, bx, helpers::weight_within_threshold, Chain, Parachain as Para, + RelayChain as Relay, Test, TestArgs, TestContext, TestExt, }; pub const ASSET_ID: u32 = 1; diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/lib.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/lib.rs index b07416c8b048..c6c07054710d 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/lib.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-polkadot/src/lib.rs @@ -23,24 +23,22 @@ pub use frame_support::{ }; pub use integration_tests_common::{ constants::{ - asset_hub_polkadot::ED as ASSET_HUB_POLKADOT_ED, - polkadot::ED as POLKADOT_ED, + asset_hub_polkadot::ED as ASSET_HUB_POLKADOT_ED, polkadot::ED as POLKADOT_ED, PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, }, xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, - AssetHubPolkadot, Polkadot, PolkadotPallet, PenpalPolkadotA, AssetHubPolkadotPallet, - AssetHubPolkadotReceiver, PolkadotSender, PolkadotReceiver, AssetHubPolkadotSender, - PenpalPolkadotAReceiver + AssetHubPolkadot, AssetHubPolkadotPallet, AssetHubPolkadotReceiver, AssetHubPolkadotSender, + PenpalPolkadotA, PenpalPolkadotAReceiver, Polkadot, PolkadotPallet, PolkadotReceiver, + PolkadotSender, }; pub use parachains_common::{AccountId, Balance}; pub use xcm::{ - prelude::{*, AccountId32 as AccountId32Junction}, + prelude::{AccountId32 as AccountId32Junction, *}, v3::{Error, NetworkId::Polkadot as PolkadotId}, }; pub use xcm_emulator::{ - assert_expected_events, bx, helpers::weight_within_threshold, - Chain, Parachain as Para, RelayChain as Relay, Test, TestArgs, - TestContext, TestExt + assert_expected_events, bx, helpers::weight_within_threshold, Chain, Parachain as Para, + RelayChain as Relay, Test, TestArgs, TestContext, TestExt, }; pub const ASSET_ID: u32 = 1; diff --git a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/lib.rs index f4cb7cafde27..77e0326c7448 100644 --- a/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/integration-tests/emulated/assets/asset-hub-westend/src/lib.rs @@ -25,25 +25,22 @@ pub use frame_support::{ }; pub use integration_tests_common::{ constants::{ - asset_hub_westend::ED as ASSET_HUB_WESTEND_ED, - westend::ED as WESTEND_ED, + asset_hub_westend::ED as ASSET_HUB_WESTEND_ED, westend::ED as WESTEND_ED, PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, }, xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, - AssetHubWestend, Westend, PenpalWestendA, AssetHubWestendReceiver, - AssetHubWestendPallet, WestendPallet, WestendSender, WestendReceiver, - AssetHubWestendSender, PenpalWestendAReceiver, PenpalWestendASender, - PenpalWestendAPallet, + AssetHubWestend, AssetHubWestendPallet, AssetHubWestendReceiver, AssetHubWestendSender, + PenpalWestendA, PenpalWestendAPallet, PenpalWestendAReceiver, PenpalWestendASender, Westend, + WestendPallet, WestendReceiver, WestendSender, }; pub use parachains_common::{AccountId, Balance}; pub use xcm::{ - prelude::{*, AccountId32 as AccountId32Junction}, + prelude::{AccountId32 as AccountId32Junction, *}, v3::{Error, NetworkId::Westend as WestendId}, }; pub use xcm_emulator::{ - assert_expected_events, bx, helpers::weight_within_threshold, - Chain, Parachain as Para, RelayChain as Relay, Test, TestArgs, - TestContext, TestExt + assert_expected_events, bx, helpers::weight_within_threshold, Chain, Parachain as Para, + RelayChain as Relay, Test, TestArgs, TestContext, TestExt, }; pub const ASSET_ID: u32 = 1; diff --git a/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/src/lib.rs index 0d985c1c4077..639b6a30c3bd 100644 --- a/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/integration-tests/emulated/bridges/bridge-hub-rococo/src/lib.rs @@ -18,26 +18,24 @@ pub use bp_messages::LaneId; pub use frame_support::assert_ok; pub use integration_tests_common::{ constants::{ - asset_hub_kusama::ED as ASSET_HUB_ROCOCO_ED, - kusama::ED as ROCOCO_ED, - PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, + asset_hub_kusama::ED as ASSET_HUB_ROCOCO_ED, kusama::ED as ROCOCO_ED, PROOF_SIZE_THRESHOLD, + REF_TIME_THRESHOLD, XCM_V3, }, xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, - Rococo, BridgeHubRococo, AssetHubWococo, RococoPallet, BridgeHubWococo, - AssetHubRococo, PenpalRococoA, AssetHubRococoReceiver, + AssetHubRococo, AssetHubRococoReceiver, AssetHubWococo, BridgeHubRococo, BridgeHubWococo, + PenpalRococoA, Rococo, RococoPallet, }; pub use parachains_common::{AccountId, Balance}; pub use xcm::{ - prelude::{*, AccountId32 as AccountId32Junction}, + prelude::{AccountId32 as AccountId32Junction, *}, v3::{ Error, NetworkId::{Rococo as RococoId, Wococo as WococoId}, }, }; pub use xcm_emulator::{ - assert_expected_events, bx, helpers::weight_within_threshold, - Chain, Parachain as Para, RelayChain as Relay, Test, TestArgs, - TestContext, TestExt + assert_expected_events, bx, helpers::weight_within_threshold, Chain, Parachain as Para, + RelayChain as Relay, Test, TestArgs, TestContext, TestExt, }; pub const ASSET_ID: u32 = 1; diff --git a/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/lib.rs b/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/lib.rs index 8f5bf6531dde..8578d25fe12e 100644 --- a/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/lib.rs +++ b/cumulus/parachains/integration-tests/emulated/collectives/collectives-polkadot/src/lib.rs @@ -15,29 +15,24 @@ // along with Cumulus. If not, see . pub use codec::Encode; -pub use frame_support::{ - assert_ok, sp_runtime::AccountId32, -}; +pub use frame_support::{assert_ok, sp_runtime::AccountId32}; pub use integration_tests_common::{ constants::{ - accounts::ALICE, - asset_hub_polkadot::ED as ASSET_HUB_POLKADOT_ED, - polkadot::ED as POLKADOT_ED, - PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, + accounts::ALICE, asset_hub_polkadot::ED as ASSET_HUB_POLKADOT_ED, + polkadot::ED as POLKADOT_ED, PROOF_SIZE_THRESHOLD, REF_TIME_THRESHOLD, XCM_V3, }, xcm_helpers::{xcm_transact_paid_execution, xcm_transact_unpaid_execution}, - AssetHubPolkadot, Polkadot, AssetHubPolkadotReceiver, PenpalPolkadotA, - AssetHubPolkadotPallet, Collectives, + AssetHubPolkadot, AssetHubPolkadotPallet, AssetHubPolkadotReceiver, Collectives, + PenpalPolkadotA, Polkadot, }; pub use parachains_common::{AccountId, Balance}; pub use xcm::{ - prelude::{*, AccountId32 as AccountId32Junction}, + prelude::{AccountId32 as AccountId32Junction, *}, v3::{Error, NetworkId::Polkadot as PolkadotId}, }; pub use xcm_emulator::{ - assert_expected_events, bx, helpers::weight_within_threshold, - Chain, ParaId, Parachain as Para, RelayChain as Relay, Test, TestArgs, - TestContext, TestExt, TestExternalities, + assert_expected_events, bx, helpers::weight_within_threshold, Chain, ParaId, Parachain as Para, + RelayChain as Relay, Test, TestArgs, TestContext, TestExt, TestExternalities, }; pub const ASSET_ID: u32 = 1; diff --git a/cumulus/parachains/integration-tests/emulated/common/src/constants.rs b/cumulus/parachains/integration-tests/emulated/common/src/constants.rs index 38e6af0eaeca..d6a364c715dd 100644 --- a/cumulus/parachains/integration-tests/emulated/common/src/constants.rs +++ b/cumulus/parachains/integration-tests/emulated/common/src/constants.rs @@ -15,6 +15,9 @@ // along with Cumulus. If not, see . // Substrate +use beefy_primitives::ecdsa_crypto::AuthorityId as BeefyId; +use grandpa::AuthorityId as GrandpaId; +use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_consensus_babe::AuthorityId as BabeId; use sp_core::{sr25519, storage::Storage, Pair, Public}; @@ -22,9 +25,6 @@ use sp_runtime::{ traits::{IdentifyAccount, Verify}, BuildStorage, MultiSignature, Perbill, }; -use beefy_primitives::ecdsa_crypto::AuthorityId as BeefyId; -use grandpa::AuthorityId as GrandpaId; -use pallet_im_online::sr25519::AuthorityId as ImOnlineId; // Cumulus use parachains_common::{AccountId, AssetHubPolkadotAuraId, AuraId, Balance, BlockNumber}; diff --git a/cumulus/parachains/integration-tests/emulated/common/src/impls.rs b/cumulus/parachains/integration-tests/emulated/common/src/impls.rs index 869b0b01a6f1..6eaf4cdfa941 100644 --- a/cumulus/parachains/integration-tests/emulated/common/src/impls.rs +++ b/cumulus/parachains/integration-tests/emulated/common/src/impls.rs @@ -24,10 +24,10 @@ pub use crate::{ }; // Substrate -use sp_core::Get; -pub use frame_support::{traits::fungibles::Inspect, assert_ok}; +pub use frame_support::{assert_ok, traits::fungibles::Inspect}; pub use pallet_assets; pub use pallet_message_queue; +use sp_core::Get; // Cumulus use bp_messages::{ @@ -35,32 +35,30 @@ use bp_messages::{ LaneId, MessageKey, OutboundLaneData, }; use bridge_runtime_common::messages_xcm_extension::XcmBlobMessageDispatchResult; +pub use cumulus_pallet_dmp_queue; +pub use cumulus_pallet_parachain_system; +pub use cumulus_pallet_xcmp_queue; +pub use cumulus_primitives_core::{ + relay_chain::HrmpChannelId, DmpMessageHandler, ParaId, XcmpMessageHandler, +}; use pallet_bridge_messages::{Config, Instance1, Instance2, OutboundLanes, Pallet}; -pub use cumulus_primitives_core::{relay_chain::HrmpChannelId, DmpMessageHandler, ParaId, XcmpMessageHandler}; pub use parachains_common::{AccountId, Balance}; pub use xcm_emulator::{ - assert_expected_events, bx, - helpers::weight_within_threshold, BridgeMessageHandler, Chain, - BridgeMessage, BridgeMessageDispatchError, TestExt, Parachain, RelayChain, + assert_expected_events, bx, helpers::weight_within_threshold, BridgeMessage, + BridgeMessageDispatchError, BridgeMessageHandler, Chain, Parachain, RelayChain, TestExt, }; -pub use cumulus_pallet_parachain_system; -pub use cumulus_pallet_dmp_queue; -pub use cumulus_pallet_xcmp_queue; // Polkadot +pub use pallet_xcm; pub use polkadot_runtime_parachains::{ - dmp, - hrmp, + dmp, hrmp, inclusion::{AggregateMessageOrigin, UmpQueueId}, }; pub use xcm::{ - prelude::{ - OriginKind, Outcome, VersionedXcm, Weight, - }, + prelude::{OriginKind, Outcome, VersionedXcm, Weight}, v3::Error, DoubleEncoded, }; -pub use pallet_xcm; pub struct BridgeHubMessageHandler { _marker: std::marker::PhantomData<(S, T, I)>, diff --git a/cumulus/parachains/integration-tests/emulated/common/src/lib.rs b/cumulus/parachains/integration-tests/emulated/common/src/lib.rs index 52cefab0691b..29faa556d379 100644 --- a/cumulus/parachains/integration-tests/emulated/common/src/lib.rs +++ b/cumulus/parachains/integration-tests/emulated/common/src/lib.rs @@ -30,9 +30,8 @@ use frame_support::traits::OnInitialize; // Cumulus use xcm_emulator::{ - decl_test_bridges, decl_test_networks, decl_test_parachains, - decl_test_relay_chains, decl_test_sender_receiver_accounts_parameter_types, - DefaultMessageProcessor, + decl_test_bridges, decl_test_networks, decl_test_parachains, decl_test_relay_chains, + decl_test_sender_receiver_accounts_parameter_types, DefaultMessageProcessor, }; decl_test_relay_chains! { diff --git a/cumulus/parachains/integration-tests/emulated/common/src/xcm_helpers.rs b/cumulus/parachains/integration-tests/emulated/common/src/xcm_helpers.rs index 539698d460d0..4096cdbba0b9 100644 --- a/cumulus/parachains/integration-tests/emulated/common/src/xcm_helpers.rs +++ b/cumulus/parachains/integration-tests/emulated/common/src/xcm_helpers.rs @@ -18,8 +18,8 @@ use parachains_common::AccountId; use xcm::{ prelude::{ AccountId32, All, BuyExecution, DepositAsset, MultiAsset, MultiAssets, MultiLocation, - OriginKind, RefundSurplus, Transact, UnpaidExecution, VersionedXcm, Weight, - WeightLimit, WithdrawAsset, Xcm, X1, + OriginKind, RefundSurplus, Transact, UnpaidExecution, VersionedXcm, Weight, WeightLimit, + WithdrawAsset, Xcm, X1, }, DoubleEncoded, }; diff --git a/cumulus/xcm/xcm-emulator/src/lib.rs b/cumulus/xcm/xcm-emulator/src/lib.rs index 650bc58c57cf..35fdad99527c 100644 --- a/cumulus/xcm/xcm-emulator/src/lib.rs +++ b/cumulus/xcm/xcm-emulator/src/lib.rs @@ -14,34 +14,28 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . +pub use codec::{Decode, Encode}; pub use lazy_static::lazy_static; pub use log; pub use paste; pub use std::{ - any::type_name, - collections::HashMap, - error::Error, - fmt, - marker::PhantomData, - ops::Deref, + any::type_name, collections::HashMap, error::Error, fmt, marker::PhantomData, ops::Deref, sync::Mutex, }; -pub use codec::{Encode, Decode}; // Substrate pub use frame_support::{ assert_ok, sp_runtime::{traits::Header as HeaderT, AccountId32, DispatchResult}, traits::{ - EnqueueMessage, Get, Hooks, OriginTrait, ProcessMessage, - ProcessMessageError, ServiceQueues, + EnqueueMessage, Get, Hooks, OriginTrait, ProcessMessage, ProcessMessageError, ServiceQueues, }, weights::{Weight, WeightMeter}, }; pub use frame_system::{Config as SystemConfig, Pallet as SystemPallet}; pub use pallet_balances::AccountData; pub use sp_arithmetic::traits::Bounded; -pub use sp_core::{parameter_types, sr25519, blake2_256, storage::Storage, Pair}; +pub use sp_core::{blake2_256, parameter_types, sr25519, storage::Storage, Pair}; pub use sp_io::TestExternalities; pub use sp_std::{cell::RefCell, collections::vec_deque::VecDeque, fmt::Debug}; pub use sp_tracing; @@ -54,9 +48,7 @@ pub use cumulus_primitives_core::{ }; pub use cumulus_primitives_parachain_inherent::ParachainInherentData; pub use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder; -pub use pallet_message_queue::{ - Config as MessageQueueConfig, Pallet as MessageQueuePallet, -}; +pub use pallet_message_queue::{Config as MessageQueueConfig, Pallet as MessageQueuePallet}; pub use parachains_common::{AccountId, Balance, BlockNumber}; pub use polkadot_primitives; pub use polkadot_runtime_parachains::inclusion::{AggregateMessageOrigin, UmpQueueId}; @@ -64,7 +56,8 @@ pub use polkadot_runtime_parachains::inclusion::{AggregateMessageOrigin, UmpQueu // Polkadot pub use polkadot_parachain::primitives::RelayChainBlockNumber; pub use xcm::v3::prelude::{ - Ancestor, MultiAssets, MultiLocation, Parent, Parachain as ParachainJunction, WeightLimit, XcmHash, X1 + Ancestor, MultiAssets, MultiLocation, Parachain as ParachainJunction, Parent, WeightLimit, + XcmHash, X1, }; pub use xcm_executor::traits::ConvertLocation;