From 9d646f64c5574f8ea6b4e61d7893c9216bb31a8d Mon Sep 17 00:00:00 2001 From: bogdanS98 Date: Fri, 27 Oct 2023 18:23:45 +0300 Subject: [PATCH] Add PEN token to MultiLocation (and viceversa) conversions in XCM config --- runtime/pendulum/src/xcm_config.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/runtime/pendulum/src/xcm_config.rs b/runtime/pendulum/src/xcm_config.rs index a6d68269b..57f4e5d96 100644 --- a/runtime/pendulum/src/xcm_config.rs +++ b/runtime/pendulum/src/xcm_config.rs @@ -17,7 +17,7 @@ use polkadot_parachain::primitives::Sibling; use polkadot_runtime_common::impls::ToAuthor; use runtime_common::parachains::polkadot::asset_hub; use sp_runtime::traits::Convert; -use xcm::latest::{prelude::*, Weight as XCMWeight}; +use xcm::{latest::{prelude::*, Weight as XCMWeight}}; use xcm_builder::{ AccountId32Aliases, AllowUnpaidExecutionFrom, ConvertedConcreteId, EnsureXcmOrigin, FixedWeightBounds, FungiblesAdapter, NoChecking, ParentIsPreset, RelayChainAsNative, @@ -76,6 +76,7 @@ impl Convert> for CurrencyIdConvert { )), _ => None, }, + CurrencyId::Native => Some(MultiLocation::new(1, X2(Parachain(ParachainInfo::parachain_id().into()), PalletInstance(10)))), _ => None, } } @@ -95,6 +96,14 @@ impl Convert> for CurrencyIdConvert { GeneralIndex(asset_hub::USDT_ASSET_ID), ), } => Some(CurrencyId::XCM(XCM_ASSET_ASSETHUB_USDT)), + MultiLocation { + parents: 1, + interior: + X2( + Parachain(id), + PalletInstance(10), + ), + } if id == u32::from(ParachainInfo::parachain_id()) => Some(CurrencyId::Native), _ => None, } }