Skip to content

Commit

Permalink
fix test_executor_send and some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Agusrodri committed Oct 30, 2024
1 parent d2f1bcb commit ff4d850
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
7 changes: 1 addition & 6 deletions precompiles/pallet-xcm/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions precompiles/xcm-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 8 additions & 6 deletions precompiles/xcm-utils/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 = (
Expand All @@ -418,7 +420,7 @@ impl xcm_executor::Config for XcmConfig {
type XcmSender = TestSendXcm;
type AssetTransactor = DummyAssetTransactor;
type OriginConverter = XcmOriginToTransactDispatchOrigin;
type IsReserve = ();
type IsReserve = Case<RelayForeignAsset>;
type IsTeleporter = ();
type UniversalLocation = UniversalLocation;
type Barrier = Barrier;
Expand Down

0 comments on commit ff4d850

Please sign in to comment.