Tighter bound on asset types teleported so that weight is cheaper (#6980)

* Tighter bound on asset types so that weight is cheaper

* cargo fmt
This commit is contained in:
Squirrel
2023-03-30 17:24:55 +01:00
committed by GitHub
parent bf8559a37c
commit 4bc867cd45
+4 -2
View File
@@ -1203,8 +1203,10 @@ impl<T: Config> Pallet<T> {
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::<T>::UnweighableMessage)?;
let hash = message.using_encoded(sp_io::hashing::blake2_256);