diff --git a/runtime/common/src/message_router/mock/mod.rs b/runtime/common/src/message_router/mock/mod.rs index d4705694..1756e9ef 100644 --- a/runtime/common/src/message_router/mock/mod.rs +++ b/runtime/common/src/message_router/mock/mod.rs @@ -91,8 +91,8 @@ pub fn relay_ext() -> sp_io::TestExternalities { pallet_balances::GenesisConfig:: { balances: vec![(ALICE, INITIAL_BALANCE), (para_account_id(1), INITIAL_BALANCE)], } - .assimilate_storage(&mut t) - .unwrap(); + .assimilate_storage(&mut t) + .unwrap(); let mut ext = sp_io::TestExternalities::new(t); ext.execute_with(|| System::set_block_number(1)); diff --git a/runtime/common/src/message_router/mock/parachain.rs b/runtime/common/src/message_router/mock/parachain.rs index 34551f5c..95840acf 100644 --- a/runtime/common/src/message_router/mock/parachain.rs +++ b/runtime/common/src/message_router/mock/parachain.rs @@ -54,30 +54,30 @@ parameter_types! { } impl frame_system::Config for Runtime { - type Origin = Origin; - type Call = Call; - type Index = u64; + type AccountData = pallet_balances::AccountData; + type AccountId = AccountId; + type BaseCallFilter = Everything; + type BlockHashCount = BlockHashCount; + type BlockLength = (); type BlockNumber = u64; + type BlockWeights = (); + type Call = Call; + type DbWeight = (); + type Event = Event; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; type Header = Header; - type Event = Event; - type BlockHashCount = BlockHashCount; - type BlockWeights = (); - type BlockLength = (); - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); + type Index = u64; + type Lookup = IdentityLookup; + type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); - type DbWeight = (); - type BaseCallFilter = Everything; - type SystemWeightInfo = (); - type SS58Prefix = (); + type OnNewAccount = (); type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; + type Origin = Origin; + type PalletInfo = PalletInfo; + type SS58Prefix = (); + type SystemWeightInfo = (); + type Version = (); } parameter_types! { @@ -87,15 +87,15 @@ parameter_types! { } impl pallet_balances::Config for Runtime { - type MaxLocks = MaxLocks; + type AccountStore = System; type Balance = Balance; - type Event = Event; type DustRemoval = (); + type Event = Event; type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type WeightInfo = (); + type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; + type WeightInfo = (); } parameter_types! { @@ -128,27 +128,27 @@ parameter_types! { } pub type LocalAssetTransactor = -XcmCurrencyAdapter, LocationToAccountId, AccountId, ()>; + XcmCurrencyAdapter, LocationToAccountId, AccountId, ()>; pub type XcmRouter = super::ParachainXcmRouter; pub type Barrier = AllowUnpaidExecutionFrom; pub struct XcmConfig; impl Config for XcmConfig { - type Call = Call; - type XcmSender = XcmRouter; + type AssetClaims = (); type AssetTransactor = LocalAssetTransactor; - type OriginConverter = XcmOriginToCallOrigin; + type AssetTrap = (); + type Barrier = Barrier; + type Call = Call; type IsReserve = NativeAsset; type IsTeleporter = (); type LocationInverter = LocationInverter; - type Barrier = Barrier; - type Weigher = FixedWeightBounds; - type Trader = FixedRateOfFungible; + type OriginConverter = XcmOriginToCallOrigin; type ResponseHandler = (); - type AssetTrap = (); - type AssetClaims = (); type SubscriptionService = (); + type Trader = FixedRateOfFungible; + type Weigher = FixedWeightBounds; + type XcmSender = XcmRouter; } #[frame_support::pallet] @@ -298,20 +298,21 @@ impl mock_msg_queue::Config for Runtime { pub type LocalOriginToLocation = SignedToAccountId32; impl pallet_xcm::Config for Runtime { + type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; + type Call = Call; type Event = Event; - type SendXcmOrigin = EnsureXcmOrigin; - type XcmRouter = XcmRouter; type ExecuteXcmOrigin = EnsureXcmOrigin; + type LocationInverter = LocationInverter; + type Origin = Origin; + type SendXcmOrigin = EnsureXcmOrigin; + type Weigher = FixedWeightBounds; type XcmExecuteFilter = Everything; type XcmExecutor = XcmExecutor; - type XcmTeleportFilter = Nothing; type XcmReserveTransferFilter = Everything; - type Weigher = FixedWeightBounds; - type LocationInverter = LocationInverter; - type Origin = Origin; - type Call = Call; + type XcmRouter = XcmRouter; + type XcmTeleportFilter = Nothing; + const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; - type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; } type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; diff --git a/runtime/common/src/message_router/mock/relay_chain.rs b/runtime/common/src/message_router/mock/relay_chain.rs index 16b155d1..c1c9888e 100644 --- a/runtime/common/src/message_router/mock/relay_chain.rs +++ b/runtime/common/src/message_router/mock/relay_chain.rs @@ -45,30 +45,30 @@ parameter_types! { } impl frame_system::Config for Runtime { - type Origin = Origin; - type Call = Call; - type Index = u64; + type AccountData = pallet_balances::AccountData; + type AccountId = AccountId; + type BaseCallFilter = Everything; + type BlockHashCount = BlockHashCount; + type BlockLength = (); type BlockNumber = u64; + type BlockWeights = (); + type Call = Call; + type DbWeight = (); + type Event = Event; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; - type AccountId = AccountId; - type Lookup = IdentityLookup; type Header = Header; - type Event = Event; - type BlockHashCount = BlockHashCount; - type BlockWeights = (); - type BlockLength = (); - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = pallet_balances::AccountData; - type OnNewAccount = (); + type Index = u64; + type Lookup = IdentityLookup; + type MaxConsumers = frame_support::traits::ConstU32<16>; type OnKilledAccount = (); - type DbWeight = (); - type BaseCallFilter = Everything; - type SystemWeightInfo = (); - type SS58Prefix = (); + type OnNewAccount = (); type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; + type Origin = Origin; + type PalletInfo = PalletInfo; + type SS58Prefix = (); + type SystemWeightInfo = (); + type Version = (); } parameter_types! { @@ -78,15 +78,15 @@ parameter_types! { } impl pallet_balances::Config for Runtime { - type MaxLocks = MaxLocks; + type AccountStore = System; type Balance = Balance; - type Event = Event; type DustRemoval = (); + type Event = Event; type ExistentialDeposit = ExistentialDeposit; - type AccountStore = System; - type WeightInfo = (); + type MaxLocks = MaxLocks; type MaxReserves = MaxReserves; type ReserveIdentifier = [u8; 8]; + type WeightInfo = (); } impl shared::Config for Runtime {} @@ -127,40 +127,41 @@ pub type Barrier = AllowUnpaidExecutionFrom; pub struct XcmConfig; impl Config for XcmConfig { - type Call = Call; - type XcmSender = XcmRouter; + type AssetClaims = (); type AssetTransactor = LocalAssetTransactor; - type OriginConverter = LocalOriginConverter; + type AssetTrap = (); + type Barrier = Barrier; + type Call = Call; type IsReserve = (); type IsTeleporter = (); type LocationInverter = LocationInverter; - type Barrier = Barrier; - type Weigher = FixedWeightBounds; - type Trader = FixedRateOfFungible; + type OriginConverter = LocalOriginConverter; type ResponseHandler = (); - type AssetTrap = (); - type AssetClaims = (); type SubscriptionService = (); + type Trader = FixedRateOfFungible; + type Weigher = FixedWeightBounds; + type XcmSender = XcmRouter; } pub type LocalOriginToLocation = SignedToAccountId32; impl pallet_xcm::Config for Runtime { + type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; + type Call = Call; type Event = Event; - type SendXcmOrigin = xcm_builder::EnsureXcmOrigin; - type XcmRouter = XcmRouter; // Anyone can execute XCM messages locally... type ExecuteXcmOrigin = xcm_builder::EnsureXcmOrigin; + type LocationInverter = LocationInverter; + type Origin = Origin; + type SendXcmOrigin = xcm_builder::EnsureXcmOrigin; + type Weigher = FixedWeightBounds; type XcmExecuteFilter = Nothing; type XcmExecutor = XcmExecutor; - type XcmTeleportFilter = Everything; type XcmReserveTransferFilter = Everything; - type Weigher = FixedWeightBounds; - type LocationInverter = LocationInverter; - type Origin = Origin; - type Call = Call; + type XcmRouter = XcmRouter; + type XcmTeleportFilter = Everything; + const VERSION_DISCOVERY_QUEUE_SIZE: u32 = 100; - type AdvertisedXcmVersion = pallet_xcm::CurrentXcmVersion; } parameter_types! { @@ -169,9 +170,9 @@ parameter_types! { impl ump::Config for Runtime { type Event = Event; - type UmpSink = ump::XcmSink, Runtime>; - type FirstMessageFactorPercent = FirstMessageFactorPercent; type ExecuteOverweightOrigin = frame_system::EnsureRoot; + type FirstMessageFactorPercent = FirstMessageFactorPercent; + type UmpSink = ump::XcmSink, Runtime>; type WeightInfo = ump::TestWeightInfo; } diff --git a/runtime/common/src/message_router/mod.rs b/runtime/common/src/message_router/mod.rs index 9f055bb8..d2326dd6 100644 --- a/runtime/common/src/message_router/mod.rs +++ b/runtime/common/src/message_router/mod.rs @@ -20,11 +20,11 @@ #[cfg(feature = "runtime-benchmarks")] mod benchmarking; -mod weights; #[cfg(test)] mod mock; #[cfg(test)] mod test; +mod weights; // --- paritytech --- use frame_support::{pallet_prelude::*, traits::Get}; diff --git a/runtime/common/src/message_router/test.rs b/runtime/common/src/message_router/test.rs index 28faf033..a6995125 100644 --- a/runtime/common/src/message_router/test.rs +++ b/runtime/common/src/message_router/test.rs @@ -18,4 +18,4 @@ //! Unit tests for the message router. -use super::mock::*; \ No newline at end of file +use super::mock::*;