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

Fix the surplus weight calculation of the Transact XCM instruction #7620

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion xcm/xcm-executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ impl<Config: config::Config> XcmExecutor<Config> {
},
};
let actual_weight = maybe_actual_weight.unwrap_or(weight);
let surplus = weight.saturating_sub(actual_weight);
let surplus = require_weight_at_most.saturating_sub(actual_weight);
// We assume that the `Config::Weigher` will counts the `require_weight_at_most`
TorstenStueber marked this conversation as resolved.
Show resolved Hide resolved
// for the estimate of how much weight this instruction will take. Now that we know
// that it's less, we credit it.
Expand Down