From dbb863e6e140bc2b76f3ab89816380baeb871577 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Wed, 14 Feb 2024 17:38:47 +0100 Subject: [PATCH] be more tolerant of MultiLocation synonyms --- polkadot-parachains/integritee-runtime/src/xcm_config.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/polkadot-parachains/integritee-runtime/src/xcm_config.rs b/polkadot-parachains/integritee-runtime/src/xcm_config.rs index 82aaf4c2..9c1652d8 100644 --- a/polkadot-parachains/integritee-runtime/src/xcm_config.rs +++ b/polkadot-parachains/integritee-runtime/src/xcm_config.rs @@ -142,10 +142,12 @@ impl Convert> for CurrencyIdConvert { X2(Parachain(para_id), junction) if junction == TEER_GENERAL_KEY && para_id == self_para_id => Some(CurrencyId::TEER), + X1(Parachain(para_id)) if para_id == self_para_id => Some(CurrencyId::TEER), _ => None, }, MultiLocation { parents, interior } if parents == 0 => match interior { X1(junction) if junction == TEER_GENERAL_KEY => Some(CurrencyId::TEER), + Here => Some(CurrencyId::TEER), _ => None, }, _ => None, @@ -372,6 +374,7 @@ impl> ContainsPair for ReserveA pub struct OnlyTeleportNative; impl Contains<(MultiLocation, Vec)> for OnlyTeleportNative { fn contains(t: &(MultiLocation, Vec)) -> bool { + let self_para_id: u32 = ParachainInfo::parachain_id().into(); t.1.iter().any(|asset| { log::trace!(target: "xcm::OnlyTeleportNative", "Asset to be teleported: {:?}", asset); @@ -382,6 +385,9 @@ impl Contains<(MultiLocation, Vec)> for OnlyTeleportNative { { match asset_loc { MultiLocation { parents: 0, interior: Here } => true, + MultiLocation { parents: 1, interior: X1(Parachain(para_id)) } + if *para_id == self_para_id => + true, _ => false, } } else {