Skip to content

Commit

Permalink
Add fallback_weight to the log (#6782)
Browse files Browse the repository at this point in the history
Co-authored-by: Francisco Aguirre <[email protected]>
  • Loading branch information
2 people authored and Ank4n committed Dec 15, 2024
1 parent 8cfc536 commit 9a2f756
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions polkadot/xcm/src/v4/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1320,12 +1320,14 @@ impl<Call: Decode + GetDispatchInfo> TryFrom<NewInstruction<Call>> for Instructi
let require_weight_at_most = match call.take_decoded() {
Ok(decoded) => decoded.get_dispatch_info().call_weight,
Err(error) => {
log::error!(
let fallback_weight = fallback_max_weight.unwrap_or(Weight::MAX);
log::debug!(
target: "xcm::versions::v5Tov4",
"Couldn't decode call in Transact: {:?}, using fallback weight.",
"Couldn't decode call in Transact: {:?}, using fallback weight: {:?}",
error,
fallback_weight,
);
fallback_max_weight.unwrap_or(Weight::MAX)
fallback_weight
},
};
Self::Transact { origin_kind, require_weight_at_most, call: call.into() }
Expand Down

0 comments on commit 9a2f756

Please sign in to comment.