Use new MultiLocation syntax everywhere (#570)

* Use new MultiLocation syntax everywhere

* Make tests compile
This commit is contained in:
Keith Yeung
2021-08-12 11:26:49 +02:00
committed by GitHub
parent 38f7e93d82
commit da5634a712
13 changed files with 358 additions and 324 deletions
+2 -2
View File
@@ -351,7 +351,7 @@ impl<T: Config> Pallet<T> {
log::debug!("Processing XCMP-XCM: {:?}", &hash);
let (result, event) = match Xcm::<T::Call>::try_from(xcm) {
Ok(xcm) => {
let location = (Parent, Parachain(sender.into()));
let location = (1, Parachain(sender.into()));
match T::XcmExecutor::execute_xcm(location.into(), xcm, max_weight) {
Outcome::Error(e) => (Err(e.clone()), Event::Fail(Some(hash), e)),
Outcome::Complete(w) => (Ok(w), Event::Success(Some(hash))),
@@ -777,7 +777,7 @@ impl<T: Config> SendXcm for Pallet<T> {
fn send_xcm(dest: MultiLocation, msg: Xcm<()>) -> Result<(), XcmError> {
match &dest {
// An HRMP message for a sibling parachain.
X2(Parent, Parachain(id)) => {
MultiLocation { parents: 1, interior: X1(Parachain(id)) } => {
let versioned_xcm = T::VersionWrapper::wrap_version(&dest, msg)
.map_err(|()| XcmError::DestinationUnsupported)?;
let hash = T::Hashing::hash_of(&versioned_xcm);
+2 -2
View File
@@ -104,8 +104,8 @@ impl cumulus_pallet_parachain_system::Config for Test {
}
parameter_types! {
pub const RelayChain: MultiLocation = X1(Parent);
pub Ancestry: MultiLocation = X1(Parachain(1u32.into()));
pub const RelayChain: MultiLocation = MultiLocation::parent();
pub Ancestry: MultiLocation = X1(Parachain(1u32.into())).into();
pub UnitWeightCost: Weight = 1_000_000;
}