From 2806fcd6862ed80da9e39aed6904fbe737022760 Mon Sep 17 00:00:00 2001 From: Agusrodri Date: Mon, 2 Dec 2024 15:30:52 -0800 Subject: [PATCH] add missing EvmForeignAssets transactor to xcm configs --- runtime/moonbase/src/xcm_config.rs | 9 ++++----- runtime/moonbeam/src/xcm_config.rs | 16 ++++++++-------- runtime/moonriver/src/xcm_config.rs | 16 ++++++++-------- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/runtime/moonbase/src/xcm_config.rs b/runtime/moonbase/src/xcm_config.rs index cf259026a6..d556e4a8e1 100644 --- a/runtime/moonbase/src/xcm_config.rs +++ b/runtime/moonbase/src/xcm_config.rs @@ -286,11 +286,10 @@ impl xcm_executor::Config for XcmExecutorConfig { type UniversalLocation = UniversalLocation; type Barrier = XcmBarrier; type Weigher = XcmWeigher; - // We use two traders - // When we receive the relative representation of the self-reserve asset, - // we use UsingComponents and the local way of handling fees - // When we receive a non-reserve asset, we use AssetManager to fetch how many - // units per second we should charge + // As trader we use the XcmWeightTrader pallet. + // For each foreign asset, the fee is computed based on its relative price (also + // stored in the XcmWeightTrader pallet) against the native asset. + // For the native asset fee is computed using WeightToFee implementation. type Trader = pallet_xcm_weight_trader::Trader; type ResponseHandler = PolkadotXcm; type SubscriptionService = PolkadotXcm; diff --git a/runtime/moonbeam/src/xcm_config.rs b/runtime/moonbeam/src/xcm_config.rs index 9db41732c5..f9a01b255e 100644 --- a/runtime/moonbeam/src/xcm_config.rs +++ b/runtime/moonbeam/src/xcm_config.rs @@ -19,9 +19,9 @@ use super::{ governance, AccountId, AssetId, AssetManager, Balance, Balances, EmergencyParaXcm, - Erc20XcmBridge, MaintenanceMode, MessageQueue, OpenTechCommitteeInstance, ParachainInfo, - ParachainSystem, Perbill, PolkadotXcm, Runtime, RuntimeBlockWeights, RuntimeCall, RuntimeEvent, - RuntimeOrigin, Treasury, XcmpQueue, + Erc20XcmBridge, EvmForeignAssets, MaintenanceMode, MessageQueue, OpenTechCommitteeInstance, + ParachainInfo, ParachainSystem, Perbill, PolkadotXcm, Runtime, RuntimeBlockWeights, + RuntimeCall, RuntimeEvent, RuntimeOrigin, Treasury, XcmpQueue, }; use super::moonbeam_weights; @@ -158,6 +158,7 @@ pub type LocalAssetTransactor = XcmCurrencyAdapter< // We use all transactors pub type AssetTransactors = ( LocalAssetTransactor, + EvmForeignAssets, ForeignFungiblesTransactor, Erc20XcmBridge, ); @@ -275,11 +276,10 @@ impl xcm_executor::Config for XcmExecutorConfig { type UniversalLocation = UniversalLocation; type Barrier = XcmBarrier; type Weigher = XcmWeigher; - // We use two traders - // When we receive the relative representation of the self-reserve asset, - // we use UsingComponents and the local way of handling fees - // When we receive a non-reserve asset, we use AssetManager to fetch how many - // units per second we should charge + // As trader we use the XcmWeightTrader pallet. + // For each foreign asset, the fee is computed based on its relative price (also + // stored in the XcmWeightTrader pallet) against the native asset. + // For the native asset fee is computed using WeightToFee implementation. type Trader = pallet_xcm_weight_trader::Trader; type ResponseHandler = PolkadotXcm; type SubscriptionService = PolkadotXcm; diff --git a/runtime/moonriver/src/xcm_config.rs b/runtime/moonriver/src/xcm_config.rs index 9b639e287e..bdaa8da76b 100644 --- a/runtime/moonriver/src/xcm_config.rs +++ b/runtime/moonriver/src/xcm_config.rs @@ -19,9 +19,9 @@ use super::{ governance, AccountId, AssetId, AssetManager, Balance, Balances, EmergencyParaXcm, - Erc20XcmBridge, MaintenanceMode, MessageQueue, OpenTechCommitteeInstance, ParachainInfo, - ParachainSystem, Perbill, PolkadotXcm, Runtime, RuntimeBlockWeights, RuntimeCall, RuntimeEvent, - RuntimeOrigin, Treasury, XcmpQueue, + Erc20XcmBridge, EvmForeignAssets, MaintenanceMode, MessageQueue, OpenTechCommitteeInstance, + ParachainInfo, ParachainSystem, Perbill, PolkadotXcm, Runtime, RuntimeBlockWeights, + RuntimeCall, RuntimeEvent, RuntimeOrigin, Treasury, XcmpQueue, }; use super::moonriver_weights; @@ -166,6 +166,7 @@ pub type LocalAssetTransactor = XcmCurrencyAdapter< // we import https://github.com/open-web3-stack/open-runtime-module-library/pull/708 pub type AssetTransactors = ( LocalAssetTransactor, + EvmForeignAssets, ForeignFungiblesTransactor, Erc20XcmBridge, ); @@ -283,11 +284,10 @@ impl xcm_executor::Config for XcmExecutorConfig { type UniversalLocation = UniversalLocation; type Barrier = XcmBarrier; type Weigher = XcmWeigher; - // We use two traders - // When we receive the relative representation of the self-reserve asset, - // we use UsingComponents and the local way of handling fees - // When we receive a non-reserve asset, we use AssetManager to fetch how many - // units per second we should charge + // As trader we use the XcmWeightTrader pallet. + // For each foreign asset, the fee is computed based on its relative price (also + // stored in the XcmWeightTrader pallet) against the native asset. + // For the native asset fee is computed using WeightToFee implementation. type Trader = pallet_xcm_weight_trader::Trader; type ResponseHandler = PolkadotXcm; type SubscriptionService = PolkadotXcm;