diff --git a/runtime/acala/src/lib.rs b/runtime/acala/src/lib.rs index 02edcbb111..a6d854847b 100644 --- a/runtime/acala/src/lib.rs +++ b/runtime/acala/src/lib.rs @@ -77,7 +77,6 @@ pub use pallet_timestamp::Call as TimestampCall; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; -use crate::xcm_config::XcmOriginToCallOrigin; pub use authority::AuthorityConfigImpl; pub use constants::{fee::*, time::*}; pub use primitives::{ @@ -102,8 +101,6 @@ pub use runtime_common::{ TipPerWeightStep, ACA, AUSD, DOT, LCDOT, LDOT, RENBTC, }; pub use xcm::latest::prelude::*; -use xcm_config::XcmConfig; -pub use xcm_executor::{Assets, Config, XcmExecutor}; mod authority; mod benchmarking; @@ -1437,22 +1434,6 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} -impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; - type XcmExecutor = XcmExecutor; - type ChannelInfo = ParachainSystem; - type VersionWrapper = PolkadotXcm; - type ExecuteOverweightOrigin = EnsureRootOrHalfGeneralCouncil; - type ControllerOrigin = EnsureRootOrHalfGeneralCouncil; - type ControllerOriginConverter = XcmOriginToCallOrigin; -} - -impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; - type XcmExecutor = XcmExecutor; - type ExecuteOverweightOrigin = EnsureRootOrHalfGeneralCouncil; -} - parameter_types! { pub DefaultExchangeRate: ExchangeRate = ExchangeRate::saturating_from_rational(1, 10); pub HomaTreasuryAccount: AccountId = HomaTreasuryPalletId::get().into_account(); @@ -1582,7 +1563,7 @@ construct_runtime!( SessionManager: module_session_manager::{Pallet, Call, Storage, Event, Config} = 45, // XCM - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Storage, Event} = 50, + XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 50, PolkadotXcm: pallet_xcm::{Pallet, Storage, Call, Event, Origin, Config} = 51, CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 52, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 53, diff --git a/runtime/acala/src/xcm_config.rs b/runtime/acala/src/xcm_config.rs index bcebedffd4..ee23d760b8 100644 --- a/runtime/acala/src/xcm_config.rs +++ b/runtime/acala/src/xcm_config.rs @@ -20,7 +20,7 @@ use super::{ constants::fee::*, AcalaTreasuryAccount, AccountId, AssetIdMapping, AssetIdMaps, Balance, Call, Convert, Currencies, CurrencyId, Event, ExistentialDeposits, FixedRateOfForeignAsset, GetNativeCurrencyId, NativeTokenExistentialDeposit, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeBlockWeights, - TransactionFeePoolTrader, UnknownTokens, XcmExecutor, XcmpQueue, ACA, AUSD, + TransactionFeePoolTrader, UnknownTokens, XcmpQueue, ACA, AUSD, }; use codec::{Decode, Encode}; pub use cumulus_primitives_core::ParaId; @@ -33,7 +33,7 @@ use orml_traits::{parameter_type_with_key, MultiCurrency}; use orml_xcm_support::{DepositToAlternative, IsNativeConcrete, MultiCurrencyAdapter, MultiNativeAsset}; use pallet_xcm::XcmPassthrough; use polkadot_parachain::primitives::Sibling; -use runtime_common::AcalaDropAssets; +use runtime_common::{AcalaDropAssets, EnsureRootOrHalfGeneralCouncil}; use xcm::latest::prelude::*; pub use xcm_builder::{ AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, @@ -42,6 +42,7 @@ pub use xcm_builder::{ SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeRevenue, TakeWeightCredit, }; +use xcm_executor::XcmExecutor; parameter_types! { pub DotLocation: MultiLocation = MultiLocation::parent(); @@ -206,6 +207,22 @@ impl cumulus_pallet_xcm::Config for Runtime { type XcmExecutor = XcmExecutor; } +impl cumulus_pallet_xcmp_queue::Config for Runtime { + type Event = Event; + type XcmExecutor = XcmExecutor; + type ChannelInfo = ParachainSystem; + type VersionWrapper = PolkadotXcm; + type ExecuteOverweightOrigin = EnsureRootOrHalfGeneralCouncil; + type ControllerOrigin = EnsureRootOrHalfGeneralCouncil; + type ControllerOriginConverter = XcmOriginToCallOrigin; +} + +impl cumulus_pallet_dmp_queue::Config for Runtime { + type Event = Event; + type XcmExecutor = XcmExecutor; + type ExecuteOverweightOrigin = EnsureRootOrHalfGeneralCouncil; +} + pub type LocalAssetTransactor = MultiCurrencyAdapter< Currencies, UnknownTokens, diff --git a/runtime/integration-tests/src/setup.rs b/runtime/integration-tests/src/setup.rs index 12daae37f3..c4d8808c20 100644 --- a/runtime/integration-tests/src/setup.rs +++ b/runtime/integration-tests/src/setup.rs @@ -55,10 +55,11 @@ mod mandala_imports { ParachainInfo, ParachainSystem, Proxy, ProxyType, Ratio, Runtime, Scheduler, Session, SessionKeys, SessionManager, SevenDays, StableAsset, StableAssetPalletId, System, Timestamp, TipPerWeightStep, TokenSymbol, Tokens, TransactionPayment, TransactionPaymentPalletId, TreasuryAccount, TreasuryPalletId, UncheckedExtrinsic, - Utility, Vesting, XcmExecutor, XcmInterface, EVM, NFT, + Utility, Vesting, XcmInterface, EVM, NFT, }; pub use runtime_common::{cent, dollar, millicent, ACA, AUSD, DOT, KSM, LDOT, LKSM}; pub use sp_runtime::traits::AccountIdConversion; + pub use xcm_executor::XcmExecutor; pub const NATIVE_CURRENCY: CurrencyId = ACA; pub const LIQUID_CURRENCY: CurrencyId = LDOT; @@ -90,11 +91,12 @@ mod karura_imports { OneDay, Origin, OriginCaller, ParachainAccount, ParachainInfo, ParachainSystem, PolkadotXcm, Proxy, ProxyType, Ratio, RelayChainBlockNumberProvider, Runtime, Scheduler, Session, SessionManager, SevenDays, System, Timestamp, TipPerWeightStep, TokenSymbol, Tokens, TransactionPayment, TransactionPaymentPalletId, - TreasuryPalletId, Utility, Vesting, XTokens, XcmExecutor, XcmInterface, EVM, NFT, + TreasuryPalletId, Utility, Vesting, XTokens, XcmInterface, EVM, NFT, }; pub use primitives::TradingPair; pub use runtime_common::{calculate_asset_ratio, cent, dollar, millicent, KAR, KSM, KUSD, LKSM}; pub use sp_runtime::traits::AccountIdConversion; + pub use xcm_executor::XcmExecutor; parameter_types! { pub EnabledTradingPairs: Vec = vec![ @@ -135,12 +137,13 @@ mod acala_imports { OriginCaller, ParachainAccount, ParachainInfo, ParachainSystem, PolkadotXcm, Proxy, ProxyType, Ratio, RelayChainBlockNumberProvider, Runtime, Scheduler, Session, SessionManager, SevenDays, System, Timestamp, TipPerWeightStep, TokenSymbol, Tokens, TransactionPayment, TransactionPaymentPalletId, TreasuryPalletId, - Utility, Vesting, XTokens, XcmExecutor, XcmInterface, EVM, LCDOT, NFT, + Utility, Vesting, XTokens, XcmInterface, EVM, LCDOT, NFT, }; pub use frame_support::parameter_types; pub use primitives::TradingPair; pub use runtime_common::{cent, dollar, millicent, ACA, AUSD, DOT, LDOT}; pub use sp_runtime::traits::AccountIdConversion; + pub use xcm_executor::XcmExecutor; parameter_types! { pub EnabledTradingPairs: Vec = vec![ diff --git a/runtime/karura/src/lib.rs b/runtime/karura/src/lib.rs index 4be9757da9..614057cac2 100644 --- a/runtime/karura/src/lib.rs +++ b/runtime/karura/src/lib.rs @@ -103,10 +103,7 @@ pub use runtime_common::{ TipPerWeightStep, BNC, KAR, KBTC, KINT, KSM, KUSD, LKSM, PHA, RENBTC, VSKSM, }; pub use xcm::latest::prelude::*; -use xcm_config::XcmConfig; -pub use xcm_executor::{Assets, Config, XcmExecutor}; -use crate::xcm_config::XcmOriginToCallOrigin; /// Import the stable_asset pallet. pub use nutsfinance_stable_asset; @@ -1447,22 +1444,6 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} -impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; - type XcmExecutor = XcmExecutor; - type ChannelInfo = ParachainSystem; - type VersionWrapper = PolkadotXcm; - type ExecuteOverweightOrigin = EnsureRootOrHalfGeneralCouncil; - type ControllerOrigin = EnsureRootOrHalfGeneralCouncil; - type ControllerOriginConverter = XcmOriginToCallOrigin; -} - -impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; - type XcmExecutor = XcmExecutor; - type ExecuteOverweightOrigin = EnsureRootOrHalfGeneralCouncil; -} - parameter_types! { pub DefaultExchangeRate: ExchangeRate = ExchangeRate::saturating_from_rational(1, 10); pub HomaTreasuryAccount: AccountId = HomaTreasuryPalletId::get().into_account(); @@ -1659,7 +1640,7 @@ construct_runtime!( SessionManager: module_session_manager::{Pallet, Call, Storage, Event, Config} = 45, // XCM - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Storage, Event} = 50, + XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 50, PolkadotXcm: pallet_xcm::{Pallet, Storage, Call, Event, Origin, Config} = 51, CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 52, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 53, diff --git a/runtime/karura/src/xcm_config.rs b/runtime/karura/src/xcm_config.rs index 8b79e3564d..dc7efcd937 100644 --- a/runtime/karura/src/xcm_config.rs +++ b/runtime/karura/src/xcm_config.rs @@ -20,7 +20,7 @@ use super::{ constants::{fee::*, parachains}, AccountId, AssetIdMapping, AssetIdMaps, Balance, Call, Convert, Currencies, CurrencyId, Event, ExistentialDeposits, GetNativeCurrencyId, KaruraTreasuryAccount, NativeTokenExistentialDeposit, Origin, ParachainInfo, ParachainSystem, - PolkadotXcm, Runtime, RuntimeBlockWeights, UnknownTokens, XcmExecutor, XcmInterface, XcmpQueue, KAR, KUSD, LKSM, + PolkadotXcm, Runtime, RuntimeBlockWeights, UnknownTokens, XcmInterface, XcmpQueue, KAR, KUSD, LKSM, }; use codec::{Decode, Encode}; pub use cumulus_primitives_core::ParaId; @@ -34,7 +34,7 @@ use orml_traits::{parameter_type_with_key, MultiCurrency}; use orml_xcm_support::{DepositToAlternative, IsNativeConcrete, MultiCurrencyAdapter, MultiNativeAsset}; use pallet_xcm::XcmPassthrough; use polkadot_parachain::primitives::Sibling; -use runtime_common::AcalaDropAssets; +use runtime_common::{AcalaDropAssets, EnsureRootOrHalfGeneralCouncil}; use xcm::latest::prelude::*; pub use xcm_builder::{ AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, @@ -43,6 +43,7 @@ pub use xcm_builder::{ SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeRevenue, TakeWeightCredit, }; +use xcm_executor::XcmExecutor; #[cfg(not(feature = "integration-tests"))] use super::{FixedRateOfForeignAsset, TransactionFeePoolTrader}; @@ -268,6 +269,22 @@ impl cumulus_pallet_xcm::Config for Runtime { type XcmExecutor = XcmExecutor; } +impl cumulus_pallet_xcmp_queue::Config for Runtime { + type Event = Event; + type XcmExecutor = XcmExecutor; + type ChannelInfo = ParachainSystem; + type VersionWrapper = PolkadotXcm; + type ExecuteOverweightOrigin = EnsureRootOrHalfGeneralCouncil; + type ControllerOrigin = EnsureRootOrHalfGeneralCouncil; + type ControllerOriginConverter = XcmOriginToCallOrigin; +} + +impl cumulus_pallet_dmp_queue::Config for Runtime { + type Event = Event; + type XcmExecutor = XcmExecutor; + type ExecuteOverweightOrigin = EnsureRootOrHalfGeneralCouncil; +} + parameter_types! { pub SelfLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(ParachainInfo::get().into()))); } diff --git a/runtime/mandala/src/lib.rs b/runtime/mandala/src/lib.rs index cf77b5e6fc..ae61a78e21 100644 --- a/runtime/mandala/src/lib.rs +++ b/runtime/mandala/src/lib.rs @@ -110,10 +110,7 @@ pub use runtime_common::{ TipPerWeightStep, ACA, AUSD, DOT, LDOT, RENBTC, }; pub use xcm::latest::prelude::*; -use xcm_config::XcmConfig; -pub use xcm_executor::{traits::WeightTrader, Assets, Config, XcmExecutor}; -use crate::xcm_config::XcmOriginToCallOrigin; /// Import the stable_asset pallet. pub use nutsfinance_stable_asset; @@ -1593,22 +1590,6 @@ impl cumulus_pallet_parachain_system::Config for Runtime { impl parachain_info::Config for Runtime {} -impl cumulus_pallet_xcmp_queue::Config for Runtime { - type Event = Event; - type XcmExecutor = XcmExecutor; - type ChannelInfo = ParachainSystem; - type VersionWrapper = (); - type ExecuteOverweightOrigin = EnsureRootOrHalfGeneralCouncil; - type ControllerOrigin = EnsureRootOrHalfGeneralCouncil; - type ControllerOriginConverter = XcmOriginToCallOrigin; -} - -impl cumulus_pallet_dmp_queue::Config for Runtime { - type Event = Event; - type XcmExecutor = XcmExecutor; - type ExecuteOverweightOrigin = EnsureRootOrHalfGeneralCouncil; -} - impl orml_unknown_tokens::Config for Runtime { type Event = Event; } diff --git a/runtime/mandala/src/xcm_config.rs b/runtime/mandala/src/xcm_config.rs index 9e231455be..47f8aa329c 100644 --- a/runtime/mandala/src/xcm_config.rs +++ b/runtime/mandala/src/xcm_config.rs @@ -20,7 +20,7 @@ use super::{ constants::fee::*, AccountId, AssetIdMapping, AssetIdMaps, Balance, Call, Convert, Currencies, CurrencyId, Event, ExistentialDeposits, FixedRateOfForeignAsset, GetNativeCurrencyId, NativeTokenExistentialDeposit, Origin, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeBlockWeights, TransactionFeePoolTrader, - TreasuryAccount, UnknownTokens, XcmExecutor, XcmpQueue, ACA, + TreasuryAccount, UnknownTokens, XcmpQueue, ACA, }; use codec::{Decode, Encode}; pub use cumulus_primitives_core::ParaId; @@ -33,7 +33,7 @@ use orml_traits::{parameter_type_with_key, MultiCurrency}; use orml_xcm_support::{DepositToAlternative, IsNativeConcrete, MultiCurrencyAdapter, MultiNativeAsset}; use pallet_xcm::XcmPassthrough; use polkadot_parachain::primitives::Sibling; -use runtime_common::AcalaDropAssets; +use runtime_common::{AcalaDropAssets, EnsureRootOrHalfGeneralCouncil}; use xcm::latest::prelude::*; pub use xcm_builder::{ AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, @@ -42,6 +42,7 @@ pub use xcm_builder::{ SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeRevenue, TakeWeightCredit, }; +use xcm_executor::XcmExecutor; parameter_types! { pub const DotLocation: MultiLocation = MultiLocation::parent(); @@ -199,6 +200,22 @@ impl cumulus_pallet_xcm::Config for Runtime { type XcmExecutor = XcmExecutor; } +impl cumulus_pallet_xcmp_queue::Config for Runtime { + type Event = Event; + type XcmExecutor = XcmExecutor; + type ChannelInfo = ParachainSystem; + type VersionWrapper = (); + type ExecuteOverweightOrigin = EnsureRootOrHalfGeneralCouncil; + type ControllerOrigin = EnsureRootOrHalfGeneralCouncil; + type ControllerOriginConverter = XcmOriginToCallOrigin; +} + +impl cumulus_pallet_dmp_queue::Config for Runtime { + type Event = Event; + type XcmExecutor = XcmExecutor; + type ExecuteOverweightOrigin = EnsureRootOrHalfGeneralCouncil; +} + pub type LocalAssetTransactor = MultiCurrencyAdapter< Currencies, UnknownTokens,