From 83dbea9c3e037f93e6cd9fbf24600e9026559ba4 Mon Sep 17 00:00:00 2001 From: EgorPopelyaev Date: Tue, 28 Mar 2023 14:23:46 +0200 Subject: [PATCH 1/5] Revert "[Enhancement] Use XCM V3 for initiate_teleport weight calc (#2102)" This reverts commit 8230ec4773751f2ff9d10b9144deee331d02ffcd. --- .../assets/statemine/src/weights/xcm/mod.rs | 20 ++++++------------- .../assets/statemint/src/weights/xcm/mod.rs | 20 ++++++------------- .../assets/westmint/src/weights/xcm/mod.rs | 20 ++++++------------- .../bridge-hub-kusama/src/weights/xcm/mod.rs | 20 ++++++------------- .../src/weights/xcm/mod.rs | 15 ++------------ .../bridge-hub-rococo/src/weights/xcm/mod.rs | 20 ++++++------------- 6 files changed, 32 insertions(+), 83 deletions(-) diff --git a/parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs b/parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs index 877a54ba848..3aba595481a 100644 --- a/parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs +++ b/parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs @@ -17,7 +17,7 @@ mod pallet_xcm_benchmarks_fungible; mod pallet_xcm_benchmarks_generic; -use crate::{xcm_config::MaxAssetsIntoHolding, Runtime}; +use crate::Runtime; use frame_support::weights::Weight; use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; @@ -35,18 +35,7 @@ impl WeighMultiAssets for MultiAssetFilter { match self { Self::Definite(assets) => weight.saturating_mul(assets.inner().into_iter().count() as u64), - Self::Wild(asset) => match asset { - All => weight.saturating_mul(MAX_ASSETS), - AllOf { fun, .. } => match fun { - WildFungibility::Fungible => weight, - // Magic number 2 has to do with the fact that we could have up to 2 times - // MaxAssetsIntoHolding in the worst-case scenario. - WildFungibility::NonFungible => - weight.saturating_mul((MaxAssetsIntoHolding::get() * 2) as u64), - }, - AllCounted(count) => weight.saturating_mul(MAX_ASSETS.min(*count as u64)), - AllOfCounted { count, .. } => weight.saturating_mul(MAX_ASSETS.min(*count as u64)), - }, + Self::Wild(_) => weight.saturating_mul(MAX_ASSETS as u64), } } } @@ -149,7 +138,10 @@ impl XcmWeightInfo for StatemineXcmWeight { _dest: &MultiLocation, _xcm: &Xcm<()>, ) -> Weight { - assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()) + // Hardcoded till the XCM pallet is fixed + let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64); + let weight = assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()); + hardcoded_weight.min(weight) } fn report_holding(_response_info: &QueryResponseInfo, _assets: &MultiAssetFilter) -> Weight { XcmGeneric::::report_holding() diff --git a/parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs b/parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs index 1b4a2bcfdd7..b862ffe99ce 100644 --- a/parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs +++ b/parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs @@ -17,7 +17,7 @@ mod pallet_xcm_benchmarks_fungible; mod pallet_xcm_benchmarks_generic; -use crate::{xcm_config::MaxAssetsIntoHolding, Runtime}; +use crate::Runtime; use frame_support::weights::Weight; use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; @@ -35,18 +35,7 @@ impl WeighMultiAssets for MultiAssetFilter { match self { Self::Definite(assets) => weight.saturating_mul(assets.inner().into_iter().count() as u64), - Self::Wild(asset) => match asset { - All => weight.saturating_mul(MAX_ASSETS), - AllOf { fun, .. } => match fun { - WildFungibility::Fungible => weight, - // Magic number 2 has to do with the fact that we could have up to 2 times - // MaxAssetsIntoHolding in the worst-case scenario. - WildFungibility::NonFungible => - weight.saturating_mul((MaxAssetsIntoHolding::get() * 2) as u64), - }, - AllCounted(count) => weight.saturating_mul(MAX_ASSETS.min(*count as u64)), - AllOfCounted { count, .. } => weight.saturating_mul(MAX_ASSETS.min(*count as u64)), - }, + Self::Wild(_) => weight.saturating_mul(MAX_ASSETS as u64), } } } @@ -149,7 +138,10 @@ impl XcmWeightInfo for StatemintXcmWeight { _dest: &MultiLocation, _xcm: &Xcm<()>, ) -> Weight { - assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()) + // Hardcoded till the XCM pallet is fixed + let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64); + let weight = assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()); + hardcoded_weight.min(weight) } fn report_holding(_response_info: &QueryResponseInfo, _assets: &MultiAssetFilter) -> Weight { XcmGeneric::::report_holding() diff --git a/parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs b/parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs index 5daa3acbcce..88d9834d823 100644 --- a/parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs +++ b/parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs @@ -17,7 +17,7 @@ mod pallet_xcm_benchmarks_fungible; mod pallet_xcm_benchmarks_generic; -use crate::{xcm_config::MaxAssetsIntoHolding, Runtime}; +use crate::Runtime; use frame_support::weights::Weight; use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; @@ -35,18 +35,7 @@ impl WeighMultiAssets for MultiAssetFilter { match self { Self::Definite(assets) => weight.saturating_mul(assets.inner().into_iter().count() as u64), - Self::Wild(asset) => match asset { - All => weight.saturating_mul(MAX_ASSETS), - AllOf { fun, .. } => match fun { - WildFungibility::Fungible => weight, - // Magic number 2 has to do with the fact that we could have up to 2 times - // MaxAssetsIntoHolding in the worst-case scenario. - WildFungibility::NonFungible => - weight.saturating_mul((MaxAssetsIntoHolding::get() * 2) as u64), - }, - AllCounted(count) => weight.saturating_mul(MAX_ASSETS.min(*count as u64)), - AllOfCounted { count, .. } => weight.saturating_mul(MAX_ASSETS.min(*count as u64)), - }, + Self::Wild(_) => weight.saturating_mul(MAX_ASSETS as u64), } } } @@ -149,7 +138,10 @@ impl XcmWeightInfo for WestmintXcmWeight { _dest: &MultiLocation, _xcm: &Xcm<()>, ) -> Weight { - assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()) + // Hardcoded till the XCM pallet is fixed + let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64); + let weight = assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()); + hardcoded_weight.min(weight) } fn report_holding(_response_info: &QueryResponseInfo, _assets: &MultiAssetFilter) -> Weight { XcmGeneric::::report_holding() diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs index 7cf23e0610b..5e6e0e735fd 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs @@ -17,7 +17,7 @@ mod pallet_xcm_benchmarks_fungible; mod pallet_xcm_benchmarks_generic; -use crate::{xcm_config::MaxAssetsIntoHolding, Runtime}; +use crate::Runtime; use frame_support::weights::Weight; use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; @@ -35,18 +35,7 @@ impl WeighMultiAssets for MultiAssetFilter { match self { Self::Definite(assets) => weight.saturating_mul(assets.inner().into_iter().count() as u64), - Self::Wild(asset) => match asset { - All => weight.saturating_mul(MAX_ASSETS), - AllOf { fun, .. } => match fun { - WildFungibility::Fungible => weight, - // Magic number 2 has to do with the fact that we could have up to 2 times - // MaxAssetsIntoHolding in the worst-case scenario. - WildFungibility::NonFungible => - weight.saturating_mul((MaxAssetsIntoHolding::get() * 2) as u64), - }, - AllCounted(count) => weight.saturating_mul(MAX_ASSETS.min(*count as u64)), - AllOfCounted { count, .. } => weight.saturating_mul(MAX_ASSETS.min(*count as u64)), - }, + Self::Wild(_) => weight.saturating_mul(MAX_ASSETS as u64), } } } @@ -149,7 +138,10 @@ impl XcmWeightInfo for BridgeHubKusamaXcmWeight { _dest: &MultiLocation, _xcm: &Xcm<()>, ) -> Weight { - assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()) + // Hardcoded till the XCM pallet is fixed + let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64); + let weight = assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()); + hardcoded_weight.min(weight) } fn report_holding(_response_info: &QueryResponseInfo, _assets: &MultiAssetFilter) -> Weight { XcmGeneric::::report_holding() diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/mod.rs index e9b1c70bf6a..f74eaf1195a 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/mod.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/mod.rs @@ -17,7 +17,7 @@ mod pallet_xcm_benchmarks_fungible; mod pallet_xcm_benchmarks_generic; -use crate::{xcm_config::MaxAssetsIntoHolding, Runtime}; +use crate::Runtime; use frame_support::weights::Weight; use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; @@ -35,18 +35,7 @@ impl WeighMultiAssets for MultiAssetFilter { match self { Self::Definite(assets) => weight.saturating_mul(assets.inner().into_iter().count() as u64), - Self::Wild(asset) => match asset { - All => weight.saturating_mul(MAX_ASSETS), - AllOf { fun, .. } => match fun { - WildFungibility::Fungible => weight, - // Magic number 2 has to do with the fact that we could have up to 2 times - // MaxAssetsIntoHolding in the worst-case scenario. - WildFungibility::NonFungible => - weight.saturating_mul((MaxAssetsIntoHolding::get() * 2) as u64), - }, - AllCounted(count) => weight.saturating_mul(MAX_ASSETS.min(*count as u64)), - AllOfCounted { count, .. } => weight.saturating_mul(MAX_ASSETS.min(*count as u64)), - }, + Self::Wild(_) => weight.saturating_mul(MAX_ASSETS as u64), } } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/mod.rs index b05c554580d..ad7e45f4bcf 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/mod.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/mod.rs @@ -17,7 +17,7 @@ mod pallet_xcm_benchmarks_fungible; mod pallet_xcm_benchmarks_generic; -use crate::{xcm_config::MaxAssetsIntoHolding, Runtime}; +use crate::Runtime; use frame_support::weights::Weight; use pallet_xcm_benchmarks_fungible::WeightInfo as XcmFungibleWeight; use pallet_xcm_benchmarks_generic::WeightInfo as XcmGeneric; @@ -35,18 +35,7 @@ impl WeighMultiAssets for MultiAssetFilter { match self { Self::Definite(assets) => weight.saturating_mul(assets.inner().into_iter().count() as u64), - Self::Wild(asset) => match asset { - All => weight.saturating_mul(MAX_ASSETS), - AllOf { fun, .. } => match fun { - WildFungibility::Fungible => weight, - // Magic number 2 has to do with the fact that we could have up to 2 times - // MaxAssetsIntoHolding in the worst-case scenario. - WildFungibility::NonFungible => - weight.saturating_mul((MaxAssetsIntoHolding::get() * 2) as u64), - }, - AllCounted(count) => weight.saturating_mul(MAX_ASSETS.min(*count as u64)), - AllOfCounted { count, .. } => weight.saturating_mul(MAX_ASSETS.min(*count as u64)), - }, + Self::Wild(_) => weight.saturating_mul(MAX_ASSETS as u64), } } } @@ -149,7 +138,10 @@ impl XcmWeightInfo for BridgeHubRococoXcmWeight { _dest: &MultiLocation, _xcm: &Xcm<()>, ) -> Weight { - assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()) + // Hardcoded till the XCM pallet is fixed + let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64); + let weight = assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()); + hardcoded_weight.min(weight) } fn report_holding(_response_info: &QueryResponseInfo, _assets: &MultiAssetFilter) -> Weight { XcmGeneric::::report_holding() From ef3fe16dd565f21c9964f57a75e9ae99a3d93eae Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Tue, 28 Mar 2023 16:20:34 +0100 Subject: [PATCH 2/5] updating weight format --- parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs | 2 +- parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs | 2 +- parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs | 2 +- .../bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs | 2 +- .../bridge-hubs/bridge-hub-rococo/src/weights/xcm/mod.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs b/parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs index 3aba595481a..9c457671ed0 100644 --- a/parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs +++ b/parachains/runtimes/assets/statemine/src/weights/xcm/mod.rs @@ -139,7 +139,7 @@ impl XcmWeightInfo for StatemineXcmWeight { _xcm: &Xcm<()>, ) -> Weight { // Hardcoded till the XCM pallet is fixed - let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64); + let hardcoded_weight = Weight::from_parts(200_000_000 as u64, 0); let weight = assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()); hardcoded_weight.min(weight) } diff --git a/parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs b/parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs index b862ffe99ce..5e06dc7e746 100644 --- a/parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs +++ b/parachains/runtimes/assets/statemint/src/weights/xcm/mod.rs @@ -139,7 +139,7 @@ impl XcmWeightInfo for StatemintXcmWeight { _xcm: &Xcm<()>, ) -> Weight { // Hardcoded till the XCM pallet is fixed - let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64); + let hardcoded_weight = Weight::from_parts(200_000_000 as u64, 0); let weight = assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()); hardcoded_weight.min(weight) } diff --git a/parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs b/parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs index 88d9834d823..b30ee424073 100644 --- a/parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs +++ b/parachains/runtimes/assets/westmint/src/weights/xcm/mod.rs @@ -139,7 +139,7 @@ impl XcmWeightInfo for WestmintXcmWeight { _xcm: &Xcm<()>, ) -> Weight { // Hardcoded till the XCM pallet is fixed - let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64); + let hardcoded_weight = Weight::from_parts(200_000_000 as u64, 0); let weight = assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()); hardcoded_weight.min(weight) } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs index 5e6e0e735fd..f3489cf3e48 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/weights/xcm/mod.rs @@ -139,7 +139,7 @@ impl XcmWeightInfo for BridgeHubKusamaXcmWeight { _xcm: &Xcm<()>, ) -> Weight { // Hardcoded till the XCM pallet is fixed - let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64); + let hardcoded_weight = Weight::from_parts(200_000_000 as u64, 0); let weight = assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()); hardcoded_weight.min(weight) } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/mod.rs index ad7e45f4bcf..2bbcb765bfb 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/mod.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/xcm/mod.rs @@ -139,7 +139,7 @@ impl XcmWeightInfo for BridgeHubRococoXcmWeight { _xcm: &Xcm<()>, ) -> Weight { // Hardcoded till the XCM pallet is fixed - let hardcoded_weight = Weight::from_ref_time(200_000_000 as u64); + let hardcoded_weight = Weight::from_parts(200_000_000 as u64, 0); let weight = assets.weigh_multi_assets(XcmFungibleWeight::::initiate_teleport()); hardcoded_weight.min(weight) } From c73134e1a4c1e758c0080d99ba461339d28c07b4 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Wed, 29 Mar 2023 12:58:27 +0100 Subject: [PATCH 3/5] We expect to pay 1bn+ for a teleport at the current weights. --- parachains/runtimes/assets/statemine/tests/tests.rs | 2 +- parachains/runtimes/assets/statemint/tests/tests.rs | 2 +- parachains/runtimes/assets/westmint/tests/tests.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/parachains/runtimes/assets/statemine/tests/tests.rs b/parachains/runtimes/assets/statemine/tests/tests.rs index b696e4ef1e3..8c9c0c152c1 100644 --- a/parachains/runtimes/assets/statemine/tests/tests.rs +++ b/parachains/runtimes/assets/statemine/tests/tests.rs @@ -448,7 +448,7 @@ fn receive_teleported_asset_works() { id: Concrete(MultiLocation { parents: 1, interior: Here }), fun: Fungible(10000000000000), }, - weight_limit: Limited(Weight::from_parts(303531000, 65536)), + weight_limit: Limited(Weight::from_parts(1303531000, 65536)), }, DepositAsset { assets: Wild(AllCounted(1)), diff --git a/parachains/runtimes/assets/statemint/tests/tests.rs b/parachains/runtimes/assets/statemint/tests/tests.rs index 81aa458b476..288aa1b4987 100644 --- a/parachains/runtimes/assets/statemint/tests/tests.rs +++ b/parachains/runtimes/assets/statemint/tests/tests.rs @@ -460,7 +460,7 @@ fn receive_teleported_asset_works() { id: Concrete(MultiLocation { parents: 1, interior: Here }), fun: Fungible(10000000000000), }, - weight_limit: Limited(Weight::from_parts(303531000, 65536)), + weight_limit: Limited(Weight::from_parts(1303531000, 65536)), }, DepositAsset { assets: Wild(AllCounted(1)), diff --git a/parachains/runtimes/assets/westmint/tests/tests.rs b/parachains/runtimes/assets/westmint/tests/tests.rs index 5d7a6187869..f09496f95e6 100644 --- a/parachains/runtimes/assets/westmint/tests/tests.rs +++ b/parachains/runtimes/assets/westmint/tests/tests.rs @@ -448,7 +448,7 @@ fn receive_teleported_asset_works() { id: Concrete(MultiLocation { parents: 1, interior: Here }), fun: Fungible(10000000000000), }, - weight_limit: Limited(Weight::from_parts(303531000, 65536)), + weight_limit: Limited(Weight::from_parts(1303531000, 65536)), }, DepositAsset { assets: Wild(AllCounted(1)), From 8c5abac980d80cfbb6b9ad7d5952f8427e694573 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Wed, 29 Mar 2023 14:11:42 +0100 Subject: [PATCH 4/5] The test isn't needed and hardcoded scale is hand to maintain. --- .../runtimes/assets/westmint/tests/tests.rs | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/parachains/runtimes/assets/westmint/tests/tests.rs b/parachains/runtimes/assets/westmint/tests/tests.rs index f09496f95e6..b16621263fe 100644 --- a/parachains/runtimes/assets/westmint/tests/tests.rs +++ b/parachains/runtimes/assets/westmint/tests/tests.rs @@ -473,31 +473,3 @@ fn receive_teleported_asset_works() { assert_eq!(outcome.ensure_complete(), Ok(())); }) } - -#[test] -fn plain_receive_teleported_asset_works() { - ExtBuilder::::default() - .with_collators(vec![AccountId::from(ALICE)]) - .with_session_keys(vec![( - AccountId::from(ALICE), - AccountId::from(ALICE), - SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) }, - )]) - .build() - .execute_with(|| { - let data = hex_literal::hex!("02100204000100000b00a0724e18090a13000100000b00a0724e180901e20f5e480d010004000101001299557001f55815d3fcb53c74463acb0cf6d14d4639b340982c60877f384609").to_vec(); - let message_id = sp_io::hashing::blake2_256(&data); - - let maybe_msg = VersionedXcm::::decode_all_with_depth_limit( - MAX_XCM_DECODE_DEPTH, - &mut data.as_ref(), - ) - .map(xcm::v3::Xcm::::try_from).expect("failed").expect("failed"); - - let weight_limit = ReservedDmpWeight::get(); - - let outcome = - XcmExecutor::::execute_xcm(Parent, maybe_msg, message_id, weight_limit); - assert_eq!(outcome.ensure_complete(), Ok(())); - }) -} From 2aa3df3f2f1319d9ca83a78f05b7d01b5d085c3e Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Wed, 29 Mar 2023 14:47:47 +0100 Subject: [PATCH 5/5] remove unused imports --- parachains/runtimes/assets/westmint/tests/tests.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/parachains/runtimes/assets/westmint/tests/tests.rs b/parachains/runtimes/assets/westmint/tests/tests.rs index b16621263fe..246ddbadb69 100644 --- a/parachains/runtimes/assets/westmint/tests/tests.rs +++ b/parachains/runtimes/assets/westmint/tests/tests.rs @@ -1,21 +1,20 @@ use asset_test_utils::{ExtBuilder, RuntimeHelper}; -use codec::{DecodeLimit, Encode}; +use codec::Encode; use cumulus_primitives_utility::ChargeWeightInFungibles; use frame_support::{ assert_noop, assert_ok, sp_io, weights::{Weight, WeightToFee as WeightToFeeT}, }; use parachains_common::{AccountId, AuraId, Balance}; +use westmint_runtime::xcm_config::{ + AssetFeeAsExistentialDepositMultiplierFeeCharger, WestendLocation, +}; pub use westmint_runtime::{ constants::fee::WeightToFee, xcm_config::{TrustBackedAssetsPalletLocation, XcmConfig}, Assets, Balances, ExistentialDeposit, ReservedDmpWeight, Runtime, SessionKeys, System, }; -use westmint_runtime::{ - xcm_config::{AssetFeeAsExistentialDepositMultiplierFeeCharger, WestendLocation}, - RuntimeCall, -}; -use xcm::{latest::prelude::*, VersionedXcm, MAX_XCM_DECODE_DEPTH}; +use xcm::latest::prelude::*; use xcm_executor::{ traits::{Convert, WeightTrader}, XcmExecutor,