This commit is contained in:
Gav Wood
2022-03-11 23:38:23 +01:00
parent 865839a180
commit 6462dd9e0d
3 changed files with 11 additions and 19 deletions
+2 -15
View File
@@ -438,23 +438,10 @@ mod tests {
fn execute( fn execute(
_origin: impl Into<MultiLocation>, _origin: impl Into<MultiLocation>,
_: Weightless, _: Weightless,
message: &Xcm,
_hash: XcmHash, _hash: XcmHash,
weight_limit: Weight, _weight_limit: Weight,
) -> Outcome { ) -> Outcome {
let o = match (message.0.len(), &message.0.first()) { unreachable!()
(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
} }
fn charge_fees(_location: impl Into<MultiLocation>, _fees: MultiAssets) -> XcmResult { fn charge_fees(_location: impl Into<MultiLocation>, _fees: MultiAssets) -> XcmResult {
+7 -2
View File
@@ -17,7 +17,7 @@ use super::*;
use crate as xcmp_queue; use crate as xcmp_queue;
use core::marker::PhantomData; use core::marker::PhantomData;
use cumulus_primitives_core::{IsSystem, ParaId}; 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 frame_system::EnsureRoot;
use sp_core::H256; use sp_core::H256;
use sp_runtime::{ use sp_runtime::{
@@ -152,8 +152,13 @@ impl xcm_executor::Config for XcmConfig {
type AssetTrap = (); type AssetTrap = ();
type AssetClaims = (); type AssetClaims = ();
type SubscriptionService = (); type SubscriptionService = ();
type PalletInstancesInfo = AllPallets; type PalletInstancesInfo = AllPalletsWithSystem;
type MaxAssetsIntoHolding = MaxAssetsIntoHolding; type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
type AssetLocker = ();
type AssetExchanger = ();
type FeeManager = ();
type MessageExporter = ();
type UniversalAliases = Nothing;
} }
pub type XcmRouter = ( pub type XcmRouter = (
@@ -269,9 +269,9 @@ mod tests {
.clone() .clone()
.pushed_with_interior(GeneralIndex(42)) .pushed_with_interior(GeneralIndex(42))
.expect("multilocation will only have 2 junctions; qed"); .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!( assert!(
AssetsFrom::<SomeSiblingParachain>::filter_asset_location( AssetsFrom::<SomeSiblingParachain>::contains(
&asset, &asset,
&SomeSiblingParachain::get() &SomeSiblingParachain::get()
), ),