Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
We count the teleported assets (#7528)
Browse files Browse the repository at this point in the history
This brings the `limited_teleport_assets` weight into line with the
`teleport_assets` weight.
  • Loading branch information
gilescope committed Jul 24, 2023
1 parent b4413e8 commit 4776230
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xcm/pallet-xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit 4776230

Please sign in to comment.