From 6462dd9e0da79f3fef593fd01163a3dbaa6e0375 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 11 Mar 2022 23:38:23 +0100 Subject: [PATCH] Fixes --- pallets/dmp-queue/src/lib.rs | 17 ++--------------- pallets/xcmp-queue/src/mock.rs | 9 +++++++-- .../parachains-common/src/impls.rs | 4 ++-- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/pallets/dmp-queue/src/lib.rs b/pallets/dmp-queue/src/lib.rs index c25b56a84d..b1b12cf18d 100644 --- a/pallets/dmp-queue/src/lib.rs +++ b/pallets/dmp-queue/src/lib.rs @@ -438,23 +438,10 @@ mod tests { fn execute( _origin: impl Into, _: Weightless, - message: &Xcm, _hash: XcmHash, - weight_limit: Weight, + _weight_limit: Weight, ) -> Outcome { - let o = match (message.0.len(), &message.0.first()) { - (1, Some(Transact { require_weight_at_most, .. })) => { - if *require_weight_at_most <= weight_limit { - Outcome::Complete(*require_weight_at_most) - } else { - Outcome::Error(XcmError::WeightLimitReached(*require_weight_at_most)) - } - }, - // use 1000 to decide that it's not supported. - _ => Outcome::Incomplete(1000.min(weight_limit), XcmError::Unimplemented), - }; - TRACE.with(|q| q.borrow_mut().push((message, o.clone()))); - o + unreachable!() } fn charge_fees(_location: impl Into, _fees: MultiAssets) -> XcmResult { diff --git a/pallets/xcmp-queue/src/mock.rs b/pallets/xcmp-queue/src/mock.rs index 18a099e5ab..4b7fbc895b 100644 --- a/pallets/xcmp-queue/src/mock.rs +++ b/pallets/xcmp-queue/src/mock.rs @@ -17,7 +17,7 @@ use super::*; use crate as xcmp_queue; use core::marker::PhantomData; use cumulus_primitives_core::{IsSystem, ParaId}; -use frame_support::{parameter_types, traits::OriginTrait}; +use frame_support::{parameter_types, traits::{OriginTrait, Nothing}}; use frame_system::EnsureRoot; use sp_core::H256; use sp_runtime::{ @@ -152,8 +152,13 @@ impl xcm_executor::Config for XcmConfig { type AssetTrap = (); type AssetClaims = (); type SubscriptionService = (); - type PalletInstancesInfo = AllPallets; + type PalletInstancesInfo = AllPalletsWithSystem; type MaxAssetsIntoHolding = MaxAssetsIntoHolding; + type AssetLocker = (); + type AssetExchanger = (); + type FeeManager = (); + type MessageExporter = (); + type UniversalAliases = Nothing; } pub type XcmRouter = ( diff --git a/polkadot-parachains/parachains-common/src/impls.rs b/polkadot-parachains/parachains-common/src/impls.rs index 2b66cd416d..d511593c76 100644 --- a/polkadot-parachains/parachains-common/src/impls.rs +++ b/polkadot-parachains/parachains-common/src/impls.rs @@ -269,9 +269,9 @@ mod tests { .clone() .pushed_with_interior(GeneralIndex(42)) .expect("multilocation will only have 2 junctions; qed"); - let asset = MultiAsset { id: Concrete(asset_location), fun: 1_000_000.into() }; + let asset = MultiAsset { id: Concrete(asset_location), fun: 1_000_000u128.into() }; assert!( - AssetsFrom::::filter_asset_location( + AssetsFrom::::contains( &asset, &SomeSiblingParachain::get() ),