We count the teleported assets (#7528)

This brings the `limited_teleport_assets` weight into line with the
`teleport_assets` weight.
This commit is contained in:
Squirrel
2023-07-24 10:42:10 +02:00
committed by GitHub
parent 79341dd40f
commit 1f54333732
+2 -1
View File
@@ -1085,10 +1085,11 @@ pub mod pallet {
match (maybe_assets, maybe_dest) { match (maybe_assets, maybe_dest) {
(Ok(assets), Ok(dest)) => { (Ok(assets), Ok(dest)) => {
use sp_std::vec; use sp_std::vec;
let count = assets.len() as u32;
let mut message = Xcm(vec![ let mut message = Xcm(vec![
WithdrawAsset(assets), WithdrawAsset(assets),
SetFeesMode { jit_withdraw: true }, 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)) T::Weigher::weight(&mut message).map_or(Weight::MAX, |w| T::WeightInfo::teleport_assets().saturating_add(w))
} }