From 3899a45e2becfb8c2f868f509a41eb9e80ebcf23 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Thu, 20 Jul 2023 17:18:15 +0100 Subject: [PATCH] We count the teleported assets This brings the `limited_teleport_assets` weight into line with the `teleport_assets` weight. --- xcm/pallet-xcm/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xcm/pallet-xcm/src/lib.rs b/xcm/pallet-xcm/src/lib.rs index 5c19dc5afea4..990871b5c483 100644 --- a/xcm/pallet-xcm/src/lib.rs +++ b/xcm/pallet-xcm/src/lib.rs @@ -1085,10 +1085,11 @@ pub mod pallet { match (maybe_assets, maybe_dest) { (Ok(assets), Ok(dest)) => { use sp_std::vec; + let count = assets.len() as u32; let mut message = Xcm(vec![ WithdrawAsset(assets), SetFeesMode { jit_withdraw: true }, - InitiateTeleport { assets: Wild(All), dest, xcm: Xcm(vec![]) }, + InitiateTeleport { assets: Wild(AllCounted(count)), dest, xcm: Xcm(vec![]) }, ]); T::Weigher::weight(&mut message).map_or(Weight::MAX, |w| T::WeightInfo::teleport_assets().saturating_add(w)) }