Skip to content

Commit

Permalink
fix: pallet-xcm-precompile shall allow subcalls
Browse files Browse the repository at this point in the history
  • Loading branch information
RomarQ committed Dec 20, 2024
1 parent 8a3a7fc commit 71edb11
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
14 changes: 8 additions & 6 deletions runtime/moonbase/src/precompiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -280,7 +278,11 @@ type MoonbasePrecompilesAt<R> = (
PrecompileAt<
AddressU64<2074>,
PalletXcmPrecompile<R, (SingleAddressMatch, ForeignAssetMatch, Erc20Match)>,
(CallableByContract, CallableByPrecompile),
(
CallableByContract,
CallableByPrecompile,
SubcallWithMaxNesting<0>,
),
>,
PrecompileAt<AddressU64<2075>, ForeignAssetMigratorPrecompile<R>, ()>,
);
Expand Down
6 changes: 5 additions & 1 deletion runtime/moonbeam/src/precompiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,11 @@ type MoonbeamPrecompilesAt<R> = (
PrecompileAt<
AddressU64<2074>,
PalletXcmPrecompile<R, (SingleAddressMatch, ForeignAssetMatch, Erc20Match)>,
(CallableByContract, CallableByPrecompile),
(
CallableByContract,
CallableByPrecompile,
SubcallWithMaxNesting<0>,
),
>,
);

Expand Down
6 changes: 5 additions & 1 deletion runtime/moonriver/src/precompiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,11 @@ type MoonriverPrecompilesAt<R> = (
PrecompileAt<
AddressU64<2074>,
PalletXcmPrecompile<R, (SingleAddressMatch, ForeignAssetMatch, Erc20Match)>,
(CallableByContract, CallableByPrecompile),
(
CallableByContract,
CallableByPrecompile,
SubcallWithMaxNesting<0>,
),
>,
);

Expand Down

0 comments on commit 71edb11

Please sign in to comment.