Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New publish instruction #2359

Draft
wants to merge 108 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
6d5beca
Copy XCM V3 to V4
franciscoaguirre Aug 28, 2023
bf114a0
Add v4 procedural
franciscoaguirre Aug 28, 2023
b33c516
".git/.scripts/commands/fmt/fmt.sh"
Aug 28, 2023
9dc896e
Fix all errors
franciscoaguirre Aug 29, 2023
b61f5dd
Fix all conversion tests
franciscoaguirre Aug 29, 2023
2b61dff
Ported over polkadot#7236
franciscoaguirre Aug 29, 2023
053efa6
Fix more conversion issues
franciscoaguirre Aug 30, 2023
1e73a45
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Aug 30, 2023
812df22
Fix more version things
franciscoaguirre Aug 31, 2023
8ec2a1d
Fix pallet-xcm tests
franciscoaguirre Sep 1, 2023
56512b9
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Sep 1, 2023
b179a75
".git/.scripts/commands/fmt/fmt.sh"
Sep 1, 2023
f132002
Import GetWeight from v2
franciscoaguirre Sep 1, 2023
35e3b12
Fix clippy issues
franciscoaguirre Sep 1, 2023
fe8ab73
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Sep 1, 2023
c4ea551
".git/.scripts/commands/fmt/fmt.sh"
Sep 1, 2023
bb7892c
Fix cumulus issues
franciscoaguirre Sep 2, 2023
a18be4c
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Sep 2, 2023
6465d73
".git/.scripts/commands/fmt/fmt.sh"
Sep 2, 2023
e550269
Fix fuzzer compilation issue
franciscoaguirre Sep 2, 2023
df82a6f
Fix assets benchmarks
franciscoaguirre Sep 2, 2023
27b3f7a
Fix compilation issues
franciscoaguirre Sep 2, 2023
12e7768
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Sep 2, 2023
3226676
".git/.scripts/commands/fmt/fmt.sh"
Sep 2, 2023
66227d3
Fix runtime-benchmarks compilation issues
franciscoaguirre Sep 3, 2023
e1a581d
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Sep 3, 2023
d448008
Merge commit
franciscoaguirre Sep 4, 2023
3005d80
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Sep 4, 2023
95db365
Fix limits test
franciscoaguirre Sep 4, 2023
8126d0a
Fix
franciscoaguirre Sep 4, 2023
85d9c22
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Sep 5, 2023
e66e438
Remove the 'Multi' prefix from Locations and Assets
franciscoaguirre Sep 5, 2023
51f7b0c
Fixes
franciscoaguirre Sep 6, 2023
bf01267
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Sep 6, 2023
16f63ce
Address feedback and fix some outstanding issues
franciscoaguirre Sep 6, 2023
9eadae5
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Sep 7, 2023
09f8470
Fix small type confusion
franciscoaguirre Sep 7, 2023
36038eb
Fix small type confusion
franciscoaguirre Sep 7, 2023
50b4ae6
Fix small type confusion
franciscoaguirre Sep 7, 2023
3bacb50
Fix small type confusion
franciscoaguirre Sep 7, 2023
6f9306a
Fix small type confusion
franciscoaguirre Sep 7, 2023
1684d48
Fix small type confusion
franciscoaguirre Sep 7, 2023
10797bd
Fix conflicts
franciscoaguirre Sep 7, 2023
89998c3
Remove some remnants of Multi
franciscoaguirre Sep 7, 2023
3c653a2
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Sep 7, 2023
f4c5483
".git/.scripts/commands/fmt/fmt.sh"
Sep 7, 2023
ae00c52
Remove Abstract AssetId
franciscoaguirre Sep 7, 2023
2fe9519
Remove more references to abstract assets
franciscoaguirre Sep 7, 2023
042c0cc
Remove more references to abstract assets
franciscoaguirre Sep 7, 2023
71a61b5
Remove more references to abstract assets
franciscoaguirre Sep 8, 2023
73694fa
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Sep 8, 2023
7a3231a
Remove more references to abstract assets
franciscoaguirre Sep 8, 2023
a3a0124
".git/.scripts/commands/fmt/fmt.sh"
Sep 8, 2023
6ac7f6f
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Sep 8, 2023
b9701bf
Update polkadot/xcm/src/lib.rs
franciscoaguirre Sep 9, 2023
f9bfab7
Update polkadot/xcm/src/lib.rs
franciscoaguirre Sep 9, 2023
8f82a46
Address feedback
franciscoaguirre Sep 9, 2023
3cf6607
Fix V3/V4 NetworkId issues
franciscoaguirre Sep 11, 2023
177c30e
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Sep 11, 2023
b0a3c56
".git/.scripts/commands/fmt/fmt.sh"
Sep 11, 2023
efd0146
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Sep 12, 2023
a054f7b
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Sep 26, 2023
03dd1b8
Fix some conflicts
franciscoaguirre Sep 26, 2023
7ec0bd7
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Sep 27, 2023
fd06d44
Fix pallet-xcm
franciscoaguirre Sep 27, 2023
2c6db72
Add deprecation warnings in executor
franciscoaguirre Sep 27, 2023
09a697f
Address feedback
franciscoaguirre Sep 27, 2023
953d6d4
Remove more old syntax
franciscoaguirre Sep 27, 2023
00fd94b
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Sep 27, 2023
3b0a504
Fix universal exports
franciscoaguirre Sep 27, 2023
09ba7f2
Favor xcm executor's prepare_and_execute
franciscoaguirre Sep 27, 2023
1f15c8e
Fixes
franciscoaguirre Sep 27, 2023
31ab8e9
Fixing old runtime code
franciscoaguirre Sep 28, 2023
9dfc772
Replace more deprecated functions
franciscoaguirre Sep 28, 2023
bab9c85
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Oct 6, 2023
541d495
Rename more instances of multi-things
franciscoaguirre Oct 6, 2023
7129c5b
Moved some muts
franciscoaguirre Oct 9, 2023
056a427
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Oct 20, 2023
3709d36
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Oct 20, 2023
9d375b3
Fix a bunch of things
franciscoaguirre Oct 20, 2023
d81d176
Add TODO for LocatableAssetId to fix conflicts
franciscoaguirre Oct 23, 2023
16d8997
Fix conflicts
franciscoaguirre Oct 23, 2023
a1b9512
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Oct 25, 2023
2e2ade7
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Oct 25, 2023
1e9aeba
Address feedback
franciscoaguirre Oct 25, 2023
3408299
Fix more compiler issues
franciscoaguirre Oct 25, 2023
defc92f
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Nov 1, 2023
223f70f
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Nov 1, 2023
25e7fa2
Fix conflicts and add tests for xcm procedural
franciscoaguirre Nov 1, 2023
00f2c86
Add alias HERE for empty junctions when matching unpacked locations
franciscoaguirre Nov 1, 2023
e4e9ede
Fix unclosed delimiter
franciscoaguirre Nov 1, 2023
06b288a
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Nov 2, 2023
17436b2
Remove unused import
franciscoaguirre Nov 2, 2023
b580ef2
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Nov 3, 2023
d7ba541
Fix conflicts
franciscoaguirre Nov 7, 2023
dd156da
Remove unused stuff and fix conversion example
franciscoaguirre Nov 7, 2023
1136c1b
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Nov 7, 2023
e9dc9ca
Make Outcome a named fields struct
franciscoaguirre Nov 7, 2023
dfe5863
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Nov 7, 2023
b036638
Fixed conflicts, only missing the LocatableAssetId issue
franciscoaguirre Nov 7, 2023
2470925
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Nov 9, 2023
08ccf4f
More HEREs
franciscoaguirre Nov 13, 2023
739dc98
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Nov 13, 2023
e0b1da2
Fix conflicts
franciscoaguirre Nov 13, 2023
94f6f98
Fix conflicts
franciscoaguirre Nov 13, 2023
a0a4c1b
Merge branch 'master' into cis-xcm-v4
franciscoaguirre Nov 14, 2023
7bccc37
Fix a lot more conflicts
franciscoaguirre Nov 15, 2023
ab56554
New publish instruction
franciscoaguirre Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions bridges/bin/runtime-common/src/messages_benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use frame_support::weights::Weight;
use pallet_bridge_messages::benchmarking::{MessageDeliveryProofParams, MessageProofParams};
use sp_runtime::traits::{Header, Zero};
use sp_std::prelude::*;
use xcm::v3::prelude::*;
use xcm::latest::prelude::*;

/// Prepare inbound bridge message according to given message proof parameters.
fn prepare_inbound_message(
Expand Down Expand Up @@ -266,19 +266,19 @@ where
/// Returns callback which generates `BridgeMessage` from Polkadot XCM builder based on
/// `expected_message_size` for benchmark.
pub fn generate_xcm_builder_bridge_message_sample(
destination: InteriorMultiLocation,
destination: InteriorLocation,
) -> impl Fn(usize) -> MessagePayload {
move |expected_message_size| -> MessagePayload {
// For XCM bridge hubs, it is the message that
// will be pushed further to some XCM queue (XCMP/UMP)
let location = xcm::VersionedInteriorMultiLocation::V3(destination);
let location = xcm::VersionedInteriorLocation::V4(destination.clone());
let location_encoded_size = location.encoded_size();

// we don't need to be super-precise with `expected_size` here
let xcm_size = expected_message_size.saturating_sub(location_encoded_size);
let xcm_data_size = xcm_size.saturating_sub(
// minus empty instruction size
xcm::v3::Instruction::<()>::ExpectPallet {
Instruction::<()>::ExpectPallet {
index: 0,
name: vec![],
module_name: vec![],
Expand All @@ -294,8 +294,8 @@ pub fn generate_xcm_builder_bridge_message_sample(
expected_message_size, location_encoded_size, xcm_size, xcm_data_size,
);

let xcm = xcm::VersionedXcm::<()>::V3(
vec![xcm::v3::Instruction::<()>::ExpectPallet {
let xcm = xcm::VersionedXcm::<()>::V4(
vec![Instruction::<()>::ExpectPallet {
index: 0,
name: vec![42; xcm_data_size],
module_name: vec![],
Expand Down
12 changes: 6 additions & 6 deletions bridges/bin/runtime-common/src/messages_xcm_extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ impl<
/// over the bridge.
pub struct SenderAndLane {
/// Sending chain relative location.
pub location: MultiLocation,
pub location: Location,
/// Message lane, used by the sending chain.
pub lane: LaneId,
}

impl SenderAndLane {
/// Create new object using provided location and lane.
pub fn new(location: MultiLocation, lane: LaneId) -> Self {
pub fn new(location: Location, lane: LaneId) -> Self {
SenderAndLane { location, lane }
}
}
Expand Down Expand Up @@ -321,7 +321,7 @@ impl<H: XcmBlobHauler> LocalXcmQueueManager<H> {
/// Send congested signal to the `sending_chain_location`.
fn send_congested_signal(sender_and_lane: &SenderAndLane) -> Result<(), SendError> {
if let Some(msg) = H::CongestedMessage::get() {
send_xcm::<H::ToSourceChainSender>(sender_and_lane.location, msg)?;
send_xcm::<H::ToSourceChainSender>(sender_and_lane.location.clone(), msg)?;
OutboundLanesCongestedSignals::<H::Runtime, H::MessagesInstance>::insert(
sender_and_lane.lane,
true,
Expand All @@ -333,7 +333,7 @@ impl<H: XcmBlobHauler> LocalXcmQueueManager<H> {
/// Send `uncongested` signal to the `sending_chain_location`.
fn send_uncongested_signal(sender_and_lane: &SenderAndLane) -> Result<(), SendError> {
if let Some(msg) = H::UncongestedMessage::get() {
send_xcm::<H::ToSourceChainSender>(sender_and_lane.location, msg)?;
send_xcm::<H::ToSourceChainSender>(sender_and_lane.location.clone(), msg)?;
OutboundLanesCongestedSignals::<H::Runtime, H::MessagesInstance>::remove(
sender_and_lane.lane,
);
Expand All @@ -353,7 +353,7 @@ mod tests {

parameter_types! {
pub TestSenderAndLane: SenderAndLane = SenderAndLane {
location: MultiLocation::new(1, X1(Parachain(1000))),
location: Location::new(1, [Parachain(1000)]),
lane: TEST_LANE_ID,
};
pub DummyXcmMessage: Xcm<()> = Xcm::new();
Expand All @@ -371,7 +371,7 @@ mod tests {
type Ticket = ();

fn validate(
_destination: &mut Option<MultiLocation>,
_destination: &mut Option<Location>,
_message: &mut Option<Xcm<()>>,
) -> SendResult<Self::Ticket> {
Ok(((), Default::default()))
Expand Down
6 changes: 3 additions & 3 deletions bridges/modules/xcm-bridge-hub-router/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ pub trait Config<I: 'static>: crate::Config<I> {
/// Returns destination which is valid for this router instance.
/// (Needs to pass `T::Bridges`)
/// Make sure that `SendXcm` will pass.
fn ensure_bridged_target_destination() -> MultiLocation {
MultiLocation::new(
fn ensure_bridged_target_destination() -> Location {
Location::new(
Self::UniversalLocation::get().len() as u8,
X1(GlobalConsensus(Self::BridgedNetworkId::get().unwrap())),
[GlobalConsensus(Self::BridgedNetworkId::get().unwrap())],
)
}
}
Expand Down
33 changes: 12 additions & 21 deletions bridges/modules/xcm-bridge-hub-router/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub mod pallet {
type WeightInfo: WeightInfo;

/// Universal location of this runtime.
type UniversalLocation: Get<InteriorMultiLocation>;
type UniversalLocation: Get<InteriorLocation>;
/// The bridged network that this config is for if specified.
/// Also used for filtering `Bridges` by `BridgedNetworkId`.
/// If not specified, allows all networks pass through.
Expand Down Expand Up @@ -233,9 +233,9 @@ type ViaBridgeHubExporter<T, I> = SovereignPaidRemoteExporter<
impl<T: Config<I>, I: 'static> ExporterFor for Pallet<T, I> {
fn exporter_for(
network: &NetworkId,
remote_location: &InteriorMultiLocation,
remote_location: &InteriorLocation,
message: &Xcm<()>,
) -> Option<(MultiLocation, Option<MultiAsset>)> {
) -> Option<(Location, Option<Asset>)> {
// ensure that the message is sent to the expected bridged network (if specified).
if let Some(bridged_network) = T::BridgedNetworkId::get() {
if *network != bridged_network {
Expand Down Expand Up @@ -266,7 +266,7 @@ impl<T: Config<I>, I: 'static> ExporterFor for Pallet<T, I> {
// take `base_fee` from `T::Brides`, but it has to be the same `T::FeeAsset`
let base_fee = match maybe_payment {
Some(payment) => match payment {
MultiAsset { fun: Fungible(amount), id } if id.eq(&T::FeeAsset::get()) => amount,
Asset { fun: Fungible(amount), id } if id.eq(&T::FeeAsset::get()) => amount,
invalid_asset => {
log::error!(
target: LOG_TARGET,
Expand Down Expand Up @@ -316,7 +316,7 @@ impl<T: Config<I>, I: 'static> SendXcm for Pallet<T, I> {
type Ticket = (u32, <T::ToBridgeHubSender as SendXcm>::Ticket);

fn validate(
dest: &mut Option<MultiLocation>,
dest: &mut Option<Location>,
xcm: &mut Option<Xcm<()>>,
) -> SendResult<Self::Ticket> {
// we won't have an access to `dest` and `xcm` in the `delvier` method, so precompute
Expand Down Expand Up @@ -430,7 +430,7 @@ mod tests {
run_test(|| {
assert_eq!(
send_xcm::<XcmBridgeHubRouter>(
MultiLocation::new(2, X2(GlobalConsensus(Rococo), Parachain(1000))),
Location::new(2, [GlobalConsensus(Rococo), Parachain(1000)]),
vec![].into(),
),
Err(SendError::NotApplicable),
Expand All @@ -443,7 +443,7 @@ mod tests {
run_test(|| {
assert_eq!(
send_xcm::<XcmBridgeHubRouter>(
MultiLocation::new(2, X2(GlobalConsensus(Rococo), Parachain(1000))),
Location::new(2, [GlobalConsensus(Rococo), Parachain(1000)]),
vec![ClearOrigin; HARD_MESSAGE_SIZE_LIMIT as usize].into(),
),
Err(SendError::ExceedsMaxMessageSize),
Expand All @@ -454,14 +454,14 @@ mod tests {
#[test]
fn returns_proper_delivery_price() {
run_test(|| {
let dest = MultiLocation::new(2, X1(GlobalConsensus(BridgedNetworkId::get())));
let dest = Location::new(2, [GlobalConsensus(BridgedNetworkId::get())]);
let xcm: Xcm<()> = vec![ClearOrigin].into();
let msg_size = xcm.encoded_size();

// initially the base fee is used: `BASE_FEE + BYTE_FEE * msg_size + HRMP_FEE`
let expected_fee = BASE_FEE + BYTE_FEE * (msg_size as u128) + HRMP_FEE;
assert_eq!(
XcmBridgeHubRouter::validate(&mut Some(dest), &mut Some(xcm.clone()))
XcmBridgeHubRouter::validate(&mut Some(dest.clone()), &mut Some(xcm.clone()))
.unwrap()
.1
.get(0),
Expand Down Expand Up @@ -490,10 +490,7 @@ mod tests {
let old_bridge = XcmBridgeHubRouter::bridge();
assert_eq!(
send_xcm::<XcmBridgeHubRouter>(
MultiLocation::new(
2,
X2(GlobalConsensus(BridgedNetworkId::get()), Parachain(1000))
),
Location::new(2, [GlobalConsensus(BridgedNetworkId::get()), Parachain(1000)]),
vec![ClearOrigin].into(),
)
.map(drop),
Expand All @@ -513,10 +510,7 @@ mod tests {
let old_bridge = XcmBridgeHubRouter::bridge();
assert_eq!(
send_xcm::<XcmBridgeHubRouter>(
MultiLocation::new(
2,
X2(GlobalConsensus(BridgedNetworkId::get()), Parachain(1000))
),
Location::new(2, [GlobalConsensus(BridgedNetworkId::get()), Parachain(1000)]),
vec![ClearOrigin].into(),
)
.map(drop),
Expand All @@ -538,10 +532,7 @@ mod tests {
let old_bridge = XcmBridgeHubRouter::bridge();
assert_eq!(
send_xcm::<XcmBridgeHubRouter>(
MultiLocation::new(
2,
X2(GlobalConsensus(BridgedNetworkId::get()), Parachain(1000))
),
Location::new(2, [GlobalConsensus(BridgedNetworkId::get()), Parachain(1000)]),
vec![ClearOrigin].into(),
)
.map(drop),
Expand Down
8 changes: 4 additions & 4 deletions bridges/modules/xcm-bridge-hub-router/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ construct_runtime! {
parameter_types! {
pub ThisNetworkId: NetworkId = Polkadot;
pub BridgedNetworkId: NetworkId = Kusama;
pub UniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(ThisNetworkId::get()), Parachain(1000));
pub SiblingBridgeHubLocation: MultiLocation = ParentThen(X1(Parachain(1002))).into();
pub BridgeFeeAsset: AssetId = MultiLocation::parent().into();
pub UniversalLocation: InteriorLocation = [GlobalConsensus(ThisNetworkId::get()), Parachain(1000)].into();
pub SiblingBridgeHubLocation: Location = ParentThen([Parachain(1002)].into()).into();
pub BridgeFeeAsset: AssetId = Location::parent().into();
pub BridgeTable: Vec<NetworkExportTableItem>
= vec![
NetworkExportTableItem::new(
Expand Down Expand Up @@ -117,7 +117,7 @@ impl SendXcm for TestToBridgeHubSender {
type Ticket = ();

fn validate(
_destination: &mut Option<MultiLocation>,
_destination: &mut Option<Location>,
_message: &mut Option<Xcm<()>>,
) -> SendResult<Self::Ticket> {
Ok(((), (BridgeFeeAsset::get(), HRMP_FEE).into()))
Expand Down
8 changes: 4 additions & 4 deletions cumulus/pallets/xcmp-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pub mod pallet {
/// The origin that is allowed to resume or suspend the XCMP queue.
type ControllerOrigin: EnsureOrigin<Self::RuntimeOrigin>;

/// The conversion function used to attempt to convert an XCM `MultiLocation` origin to a
/// The conversion function used to attempt to convert an XCM `Location` origin to a
/// superuser origin.
type ControllerOriginConverter: ConvertOrigin<Self::RuntimeOrigin>;

Expand Down Expand Up @@ -913,14 +913,14 @@ impl<T: Config> SendXcm for Pallet<T> {
type Ticket = (ParaId, VersionedXcm<()>);

fn validate(
dest: &mut Option<MultiLocation>,
dest: &mut Option<Location>,
msg: &mut Option<Xcm<()>>,
) -> SendResult<(ParaId, VersionedXcm<()>)> {
let d = dest.take().ok_or(SendError::MissingArgument)?;

match &d {
match d.unpack() {
// An HRMP message for a sibling parachain.
MultiLocation { parents: 1, interior: X1(Parachain(id)) } => {
(1, [Parachain(id)]) => {
let xcm = msg.take().ok_or(SendError::MissingArgument)?;
let id = ParaId::from(*id);
let price = T::PriceForSiblingDelivery::price_for_delivery(id, &xcm);
Expand Down
19 changes: 8 additions & 11 deletions cumulus/pallets/xcmp-queue/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ impl cumulus_pallet_parachain_system::Config for Test {
}

parameter_types! {
pub const RelayChain: MultiLocation = MultiLocation::parent();
pub UniversalLocation: InteriorMultiLocation = X1(Parachain(1u32));
pub const RelayChain: Location = Location::parent();
pub UniversalLocation: InteriorLocation = [Parachain(1u32)].into();
pub UnitWeightCost: Weight = Weight::from_parts(1_000_000, 1024);
pub const MaxInstructions: u32 = 100;
pub const MaxAssetsIntoHolding: u32 = 64;
Expand All @@ -134,7 +134,7 @@ pub type LocalAssetTransactor = CurrencyAdapter<
Balances,
// Use this currency when it is a fungible asset matching the given location or name:
IsConcrete<RelayChain>,
// Do a simple punn to convert an AccountId32 MultiLocation into a native chain account ID:
// Do a simple punn to convert an AccountId32 Location into a native chain account ID:
LocationToAccountId,
// Our chain's account ID type (we can't get away without mentioning it explicitly):
AccountId,
Expand Down Expand Up @@ -183,17 +183,14 @@ impl<RuntimeOrigin: OriginTrait> ConvertOrigin<RuntimeOrigin>
for SystemParachainAsSuperuser<RuntimeOrigin>
{
fn convert_origin(
origin: impl Into<MultiLocation>,
origin: impl Into<Location>,
kind: OriginKind,
) -> Result<RuntimeOrigin, MultiLocation> {
) -> Result<RuntimeOrigin, Location> {
let origin = origin.into();
if kind == OriginKind::Superuser &&
matches!(
origin,
MultiLocation {
parents: 1,
interior: X1(Parachain(id)),
} if ParaId::from(id).is_system(),
origin.unpack(),
(1, [Parachain(id)]) if ParaId::from(*id).is_system(),
) {
Ok(RuntimeOrigin::root())
} else {
Expand Down Expand Up @@ -252,7 +249,7 @@ impl<T: OnQueueChanged<ParaId>> EnqueueMessage<ParaId> for EnqueueToLocalStorage

parameter_types! {
/// The asset ID for the asset that we use to pay for message delivery fees.
pub FeeAssetId: AssetId = Concrete(RelayChain::get());
pub FeeAssetId: AssetId = AssetId(RelayChain::get());
/// The base fee for the message delivery fees.
pub const BaseDeliveryFee: Balance = 300_000_000;
/// The fee per byte
Expand Down