From f45a5b42327391816ba7eaee8a1560e95486fb14 Mon Sep 17 00:00:00 2001 From: Squirrel Date: Thu, 30 Mar 2023 17:24:55 +0100 Subject: [PATCH] Tighter bound on asset types teleported so that weight is cheaper (#6980) * Tighter bound on asset types so that weight is cheaper * cargo fmt --- xcm/pallet-xcm/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xcm/pallet-xcm/src/lib.rs b/xcm/pallet-xcm/src/lib.rs index f84c94a063e8..e8e164140fcc 100644 --- a/xcm/pallet-xcm/src/lib.rs +++ b/xcm/pallet-xcm/src/lib.rs @@ -1203,8 +1203,10 @@ impl Pallet { BuyExecution { fees, weight_limit }, DepositAsset { assets: Wild(AllCounted(max_assets)), beneficiary }, ]); - let mut message = - Xcm(vec![WithdrawAsset(assets), InitiateTeleport { assets: Wild(All), dest, xcm }]); + let mut message = Xcm(vec![ + WithdrawAsset(assets), + InitiateTeleport { assets: Wild(AllCounted(max_assets)), dest, xcm }, + ]); let weight = T::Weigher::weight(&mut message).map_err(|()| Error::::UnweighableMessage)?; let hash = message.using_encoded(sp_io::hashing::blake2_256);