From 71edb1120b28bd5abe9742215c740ab59134b1c4 Mon Sep 17 00:00:00 2001 From: Rodrigo Quelhas Date: Fri, 20 Dec 2024 16:36:21 +0000 Subject: [PATCH] fix: pallet-xcm-precompile shall allow subcalls --- runtime/moonbase/src/precompiles.rs | 14 ++++++++------ runtime/moonbeam/src/precompiles.rs | 6 +++++- runtime/moonriver/src/precompiles.rs | 6 +++++- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/runtime/moonbase/src/precompiles.rs b/runtime/moonbase/src/precompiles.rs index 3f33991ef2..51868fb6e3 100644 --- a/runtime/moonbase/src/precompiles.rs +++ b/runtime/moonbase/src/precompiles.rs @@ -16,11 +16,10 @@ use super::moonbase_weights; use crate::{ - asset_config::ForeignAssetInstance, - xcm_config::{AssetType, XcmExecutorConfig}, - OpenTechCommitteeInstance, TreasuryCouncilInstance, + asset_config::ForeignAssetInstance, xcm_config::XcmExecutorConfig, OpenTechCommitteeInstance, + TreasuryCouncilInstance, }; -use crate::{AccountId, AssetId, AssetManager, Balances, Erc20XcmBridge, EvmForeignAssets, Runtime, H160}; +use crate::{AccountId, AssetId, Balances, Erc20XcmBridge, EvmForeignAssets, Runtime, H160}; use frame_support::parameter_types; use moonkit_xcm_primitives::{ location_matcher::{Erc20PalletMatcher, ForeignAssetMatcher, SingleAddressMatcher}, @@ -61,7 +60,6 @@ use pallet_precompile_benchmarks::WeightInfo; use precompile_foreign_asset_migrator::ForeignAssetMigratorPrecompile; use precompile_utils::precompile_set::*; use sp_std::prelude::*; -use xcm_primitives::AsAssetType; parameter_types! { pub P256VerifyWeight: frame_support::weights::Weight = @@ -280,7 +278,11 @@ type MoonbasePrecompilesAt = ( PrecompileAt< AddressU64<2074>, PalletXcmPrecompile, - (CallableByContract, CallableByPrecompile), + ( + CallableByContract, + CallableByPrecompile, + SubcallWithMaxNesting<0>, + ), >, PrecompileAt, ForeignAssetMigratorPrecompile, ()>, ); diff --git a/runtime/moonbeam/src/precompiles.rs b/runtime/moonbeam/src/precompiles.rs index 21062733f4..b6f47c1d25 100644 --- a/runtime/moonbeam/src/precompiles.rs +++ b/runtime/moonbeam/src/precompiles.rs @@ -277,7 +277,11 @@ type MoonbeamPrecompilesAt = ( PrecompileAt< AddressU64<2074>, PalletXcmPrecompile, - (CallableByContract, CallableByPrecompile), + ( + CallableByContract, + CallableByPrecompile, + SubcallWithMaxNesting<0>, + ), >, ); diff --git a/runtime/moonriver/src/precompiles.rs b/runtime/moonriver/src/precompiles.rs index 801cf6e346..e2fe6d3da3 100644 --- a/runtime/moonriver/src/precompiles.rs +++ b/runtime/moonriver/src/precompiles.rs @@ -271,7 +271,11 @@ type MoonriverPrecompilesAt = ( PrecompileAt< AddressU64<2074>, PalletXcmPrecompile, - (CallableByContract, CallableByPrecompile), + ( + CallableByContract, + CallableByPrecompile, + SubcallWithMaxNesting<0>, + ), >, );