Skip to content

Commit

Permalink
update AssetIdToLocationManager
Browse files Browse the repository at this point in the history
  • Loading branch information
RomarQ committed Jan 17, 2025
1 parent 7b845f0 commit 3676ec1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
15 changes: 11 additions & 4 deletions runtime/moonbase/src/precompiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@

use super::moonbase_weights;
use crate::{
asset_config::ForeignAssetInstance, xcm_config::XcmExecutorConfig, OpenTechCommitteeInstance,
TreasuryCouncilInstance,
asset_config::ForeignAssetInstance,
xcm_config::{AssetType, 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 @@ -60,6 +63,7 @@ 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 @@ -111,7 +115,10 @@ type EthereumPrecompilesChecks = (AcceptDelegateCall, CallableByContract, Callab

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

// The pallet-balances address is identified by ERC20_BALANCES_PRECOMPILE const
type SingleAddressMatch = SingleAddressMatcher<AccountId, ERC20_BALANCES_PRECOMPILE, Balances>;
Expand Down
9 changes: 6 additions & 3 deletions runtime/moonbeam/src/precompiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ use super::moonbeam_weights;
use crate::{
asset_config::ForeignAssetInstance,
xcm_config::{AssetType, XcmExecutorConfig},
AccountId, AssetId, AssetManager, Balances, Erc20XcmBridge, OpenTechCommitteeInstance, Runtime,
TreasuryCouncilInstance, H160,
AccountId, AssetId, AssetManager, Balances, Erc20XcmBridge, EvmForeignAssets,
OpenTechCommitteeInstance, Runtime, TreasuryCouncilInstance, H160,
};
use frame_support::parameter_types;
use moonkit_xcm_primitives::{
Expand Down Expand Up @@ -111,7 +111,10 @@ type EthereumPrecompilesChecks = (AcceptDelegateCall, CallableByContract, Callab

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

// The pallet-balances address is identified by ERC20_BALANCES_PRECOMPILE const
type SingleAddressMatch = SingleAddressMatcher<AccountId, ERC20_BALANCES_PRECOMPILE, Balances>;
Expand Down
9 changes: 6 additions & 3 deletions runtime/moonriver/src/precompiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ use super::moonriver_weights;
use crate::{
asset_config::ForeignAssetInstance,
xcm_config::{AssetType, XcmExecutorConfig},
AccountId, AssetId, AssetManager, Balances, Erc20XcmBridge, OpenTechCommitteeInstance, Runtime,
TreasuryCouncilInstance,
AccountId, AssetId, AssetManager, Balances, Erc20XcmBridge, EvmForeignAssets,
OpenTechCommitteeInstance, Runtime, TreasuryCouncilInstance,
};
use frame_support::parameter_types;
use moonkit_xcm_primitives::location_matcher::{
Expand Down Expand Up @@ -105,7 +105,10 @@ type EthereumPrecompilesChecks = (AcceptDelegateCall, CallableByContract, Callab

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

// The pallet-balances address is identified by ERC20_BALANCES_PRECOMPILE const
type SingleAddressMatch = SingleAddressMatcher<AccountId, ERC20_BALANCES_PRECOMPILE, Balances>;
Expand Down

0 comments on commit 3676ec1

Please sign in to comment.