From ff4d8502ed2a121d6d6b7c5b1458a19d394bc569 Mon Sep 17 00:00:00 2001 From: Agusrodri Date: Wed, 30 Oct 2024 08:17:08 -0700 Subject: [PATCH] fix test_executor_send and some cleanup --- precompiles/pallet-xcm/src/mock.rs | 7 +------ precompiles/xcm-utils/Cargo.toml | 5 +++-- precompiles/xcm-utils/src/mock.rs | 14 ++++++++------ 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/precompiles/pallet-xcm/src/mock.rs b/precompiles/pallet-xcm/src/mock.rs index 533fb429..ec3cad6e 100644 --- a/precompiles/pallet-xcm/src/mock.rs +++ b/precompiles/pallet-xcm/src/mock.rs @@ -481,14 +481,9 @@ parameter_types! { pub RelayLocation: Location = Location::parent(); - pub RelayAsset: Asset = Asset { - fun: Fungible(10000000), - id: AssetId(Location::parent()), - }; - pub LocalAsset: (AssetFilter, Location) = (All.into(), Location::here()); pub TrustedForeignAsset: (AssetFilter, Location) = (ForeignAsset::get().into(), ForeignReserveLocation::get()); - pub RelayForeignAsset: (AssetFilter, Location) = (RelayAsset::get().into(), RelayLocation::get()); + pub RelayForeignAsset: (AssetFilter, Location) = (All.into(), RelayLocation::get()); } pub struct XcmConfig; diff --git a/precompiles/xcm-utils/Cargo.toml b/precompiles/xcm-utils/Cargo.toml index bf76d169..49ebde04 100644 --- a/precompiles/xcm-utils/Cargo.toml +++ b/precompiles/xcm-utils/Cargo.toml @@ -54,16 +54,17 @@ xcm-builder = { workspace = true } [features] default = [ "std" ] std = [ + "cumulus-primitives-core/std", "frame-support/std", "frame-system/std", - "pallet-balances/std", "pallet-evm/std", - "pallet-timestamp/std", + "pallet-xcm/std", "parity-scale-codec/std", "precompile-utils/std", "sp-core/std", "sp-io/std", "sp-std/std", + "xcm/std", "xcm-builder/std", "xcm-executor/std", "xcm-primitives/std", diff --git a/precompiles/xcm-utils/src/mock.rs b/precompiles/xcm-utils/src/mock.rs index fbc8687b..1b32c305 100644 --- a/precompiles/xcm-utils/src/mock.rs +++ b/precompiles/xcm-utils/src/mock.rs @@ -31,11 +31,10 @@ use sp_core::{H256, U256}; use sp_io; use sp_runtime::traits::{BlakeTwo256, IdentityLookup, TryConvert}; use sp_runtime::BuildStorage; -use xcm::latest::Error as XcmError; -use xcm_builder::AllowUnpaidExecutionFrom; -use xcm_builder::FixedWeightBounds; -use xcm_builder::IsConcrete; -use xcm_builder::SovereignSignedViaLocation; +use xcm::latest::{Error as XcmError, WildAsset::All}; +use xcm_builder::{ + AllowUnpaidExecutionFrom, Case, FixedWeightBounds, IsConcrete, SovereignSignedViaLocation, +}; use xcm_executor::{ traits::{ConvertLocation, TransactAsset, WeightTrader}, AssetsInHolding, @@ -404,6 +403,9 @@ parameter_types! { [GlobalConsensus(RelayNetwork::get()), Parachain(ParachainId::get().into()).into()].into(); pub const MaxAssetsIntoHolding: u32 = 64; + + pub RelayLocation: Location = Location::parent(); + pub RelayForeignAsset: (AssetFilter, Location) = (All.into(), RelayLocation::get()); } pub type XcmOriginToTransactDispatchOrigin = ( @@ -418,7 +420,7 @@ impl xcm_executor::Config for XcmConfig { type XcmSender = TestSendXcm; type AssetTransactor = DummyAssetTransactor; type OriginConverter = XcmOriginToTransactDispatchOrigin; - type IsReserve = (); + type IsReserve = Case; type IsTeleporter = (); type UniversalLocation = UniversalLocation; type Barrier = Barrier;