Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more TS tests for pallet-xcm precompile #3107

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 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, 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 @@ -113,7 +111,7 @@ type EthereumPrecompilesChecks = (AcceptDelegateCall, CallableByContract, Callab

// Pallet-xcm precompile types.
// Type that converts AssetId into Location
type AssetIdToLocationManager = AsAssetType<AssetId, AssetType, AssetManager>;
type AssetIdToLocationManager = EvmForeignAssets;

// The pallet-balances address is identified by ERC20_BALANCES_PRECOMPILE const
type SingleAddressMatch = SingleAddressMatcher<AccountId, ERC20_BALANCES_PRECOMPILE, Balances>;
Expand Down Expand Up @@ -280,7 +278,11 @@ type MoonbasePrecompilesAt<R> = (
PrecompileAt<
AddressU64<2074>,
PalletXcmPrecompile<R, (SingleAddressMatch, ForeignAssetMatch, Erc20Match)>,
(CallableByContract, CallableByPrecompile),
(
CallableByContract,
CallableByPrecompile,
SubcallWithMaxNesting<1>,
),
>,
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<1>,
),
>,
);

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<1>,
),
>,
);

Expand Down
Loading
Loading