From c96a7bad2439157906a38b4086d8004f0d5e8c47 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Fri, 22 Nov 2024 11:54:59 +0100 Subject: [PATCH 1/2] Fix for Transact v5->v4 decoding --- polkadot/xcm/src/v4/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/polkadot/xcm/src/v4/mod.rs b/polkadot/xcm/src/v4/mod.rs index 9baf58eacfb0..3999be682314 100644 --- a/polkadot/xcm/src/v4/mod.rs +++ b/polkadot/xcm/src/v4/mod.rs @@ -1315,7 +1315,9 @@ impl TryFrom> for Instructi HrmpChannelClosing { initiator, sender, recipient } => Self::HrmpChannelClosing { initiator, sender, recipient }, Transact { origin_kind, mut call } => { - let require_weight_at_most = call.take_decoded()?.get_dispatch_info().call_weight; + let require_weight_at_most = call.take_decoded() + .map(|c| c.get_dispatch_info().call_weight) + .unwrap_or(Weight::MAX); Self::Transact { origin_kind, require_weight_at_most, call: call.into() } }, ReportError(response_info) => Self::ReportError(QueryResponseInfo { From 7cc63a5dc7404061c754121b679cc89d7afe6bae Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 22 Nov 2024 11:14:29 +0000 Subject: [PATCH 2/2] Update from bkontur running command 'fmt' --- polkadot/xcm/src/v4/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/polkadot/xcm/src/v4/mod.rs b/polkadot/xcm/src/v4/mod.rs index 3999be682314..b627fd02ccf7 100644 --- a/polkadot/xcm/src/v4/mod.rs +++ b/polkadot/xcm/src/v4/mod.rs @@ -1315,7 +1315,8 @@ impl TryFrom> for Instructi HrmpChannelClosing { initiator, sender, recipient } => Self::HrmpChannelClosing { initiator, sender, recipient }, Transact { origin_kind, mut call } => { - let require_weight_at_most = call.take_decoded() + let require_weight_at_most = call + .take_decoded() .map(|c| c.get_dispatch_info().call_weight) .unwrap_or(Weight::MAX); Self::Transact { origin_kind, require_weight_at_most, call: call.into() }