From 1a2b8d32f3990afd1d03d8f86fce5dc32fc9e3df Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Wed, 29 Sep 2021 08:48:24 +0000 Subject: [PATCH] build: update xcm to v1 --- --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -79,7 +79,7 @@ // Polkadot imports use pallet_xcm::XcmPassthrough; use polkadot_parachain::primitives::Sibling; -use xcm::v0::{BodyId, Junction::*, MultiLocation, MultiLocation::*, NetworkId}; +use xcm::v1::{BodyId, Junction::*, MultiLocation, NetworkId, Junctions::*}; use xcm_builder::{ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds, IsConcrete, LocationInverter, NativeAsset, @@ -546,10 +546,10 @@ impl cumulus_pallet_aura_ext::Config for Runtime {} parameter_types! { - pub const RelayLocation: MultiLocation = X1(Parent); + pub const RelayLocation: MultiLocation = MultiLocation::parent(); pub const RelayNetwork: NetworkId = NetworkId::Polkadot; pub RelayOrigin: Origin = cumulus_pallet_xcm::Origin::Relay.into(); - pub Ancestry: MultiLocation = X1(Parachain(ParachainInfo::parachain_id().into())); + pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into(); } /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used @@ -606,12 +606,13 @@ // One XCM operation is 1_000_000 weight - almost certainly a conservative estimate. pub UnitWeightCost: Weight = 1_000_000; // 1200 UNIQUEs buy 1 second of weight. - pub const WeightPrice: (MultiLocation, u128) = (X1(Parent), 1_200 * UNIQUE); + pub const WeightPrice: (MultiLocation, u128) = (MultiLocation::parent(), 1_200 * UNIQUE); } match_type! { pub type ParentOrParentsUnitPlurality: impl Contains = { - X1(Parent) | X2(Parent, Plurality { id: BodyId::Unit, .. }) + MultiLocation { parents: 1, interior: Here } | + MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Unit, .. }) } }; } @@ -636,6 +637,7 @@ type Weigher = FixedWeightBounds; type Trader = UsingComponents, RelayLocation, AccountId, Balances, ()>; type ResponseHandler = (); // Don't handle responses for now. + type SubscriptionService = PolkadotXcm; } // parameter_types! { @@ -649,7 +651,7 @@ /// queues. pub type XcmRouter = ( // Two routers - use UMP to communicate with the relay chain: - cumulus_primitives_utility::ParentAsUmp, + cumulus_primitives_utility::ParentAsUmp, // ..and XCMP to communicate with the sibling chains. XcmpQueue, ); @@ -680,6 +682,7 @@ type Event = Event; type XcmExecutor = XcmExecutor; type ChannelInfo = ParachainSystem; + type VersionWrapper = (); } impl cumulus_pallet_dmp_queue::Config for Runtime { -- gitstuff