diff --git a/parachains/runtimes/testing/penpal/src/xcm_config.rs b/parachains/runtimes/testing/penpal/src/xcm_config.rs index 314faf38a6..c2ea08a8d3 100644 --- a/parachains/runtimes/testing/penpal/src/xcm_config.rs +++ b/parachains/runtimes/testing/penpal/src/xcm_config.rs @@ -30,7 +30,7 @@ use frame_support::{ log, match_types, parameter_types, traits::{ fungibles::{self, Balanced, CreditOf}, - ConstU32, Contains, Everything, Get, Nothing, + ConstU32, Contains, ContainsPair, Everything, Get, Nothing, }, weights::Weight, }; @@ -49,7 +49,7 @@ use xcm_builder::{ SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, }; use xcm_executor::{ - traits::{FilterAssetLocation, JustTry, ShouldExecute}, + traits::{JustTry, ShouldExecute}, XcmExecutor, }; @@ -164,7 +164,7 @@ where { fn should_execute( origin: &MultiLocation, - message: &mut Xcm, + message: &mut [Instruction], max_weight: Weight, weight_credit: &mut Weight, ) -> Result<(), ()> { @@ -178,11 +178,11 @@ pub struct DenyReserveTransferToRelayChain; impl ShouldExecute for DenyReserveTransferToRelayChain { fn should_execute( origin: &MultiLocation, - message: &mut Xcm, + message: &mut [Instruction], _max_weight: Weight, _weight_credit: &mut Weight, ) -> Result<(), ()> { - if message.0.iter().any(|inst| { + if message.iter().any(|inst| { matches!( inst, InitiateReserveWithdraw { @@ -200,7 +200,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain { // allow reserve transfers to arrive from relay chain if matches!(origin, MultiLocation { parents: 1, interior: Here }) && - message.0.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. })) + message.iter().any(|inst| matches!(inst, ReserveAssetDeposited { .. })) { log::warn!( target: "xcm::barriers", @@ -233,8 +233,8 @@ pub type AccountIdOf = ::AccountId; /// Asset filter that allows all assets from a certain location. pub struct AssetsFrom(PhantomData); -impl> FilterAssetLocation for AssetsFrom { - fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool { +impl> ContainsPair for AssetsFrom { + fn contains(asset: &MultiAsset, origin: &MultiLocation) -> bool { let loc = T::get(); &loc == origin && matches!(asset, MultiAsset { id: AssetId::Concrete(asset_loc), fun: Fungible(_a) } @@ -297,7 +297,7 @@ impl Reserve for MultiAsset { /// A `FilterAssetLocation` implementation. Filters multi native assets whose /// reserve is same with `origin`. pub struct MultiNativeAsset; -impl FilterAssetLocation for MultiNativeAsset { +impl ContainsPair for MultiNativeAsset { fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool { if let Some(ref reserve) = asset.reserve() { if reserve == origin {