From f798111afc15f464a772cd7ed37910cc6208b713 Mon Sep 17 00:00:00 2001
From: Sebastian Kunert <skunert49@gmail.com>
Date: Wed, 15 Jan 2025 11:08:49 +0100
Subject: [PATCH] Fix reversed error message in DispatchInfo (#7170)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fix error message in `DispatchInfo` where post-dispatch and pre-dispatch
weight was reversed.

---------

Co-authored-by: command-bot <>
Co-authored-by: Bastian Köcher <git@kchr.de>
---
 prdoc/pr_7170.prdoc                     | 8 ++++++++
 substrate/frame/support/src/dispatch.rs | 6 ++----
 2 files changed, 10 insertions(+), 4 deletions(-)
 create mode 100644 prdoc/pr_7170.prdoc

diff --git a/prdoc/pr_7170.prdoc b/prdoc/pr_7170.prdoc
new file mode 100644
index 00000000000..fae908f7407
--- /dev/null
+++ b/prdoc/pr_7170.prdoc
@@ -0,0 +1,8 @@
+title: Fix reversed error message in DispatchInfo
+doc:
+- audience: Runtime Dev
+  description: "Fix error message in `DispatchInfo` where post-dispatch and pre-dispatch\
+    \ weight was reversed.\r\n"
+crates:
+- name: frame-support
+  bump: patch
diff --git a/substrate/frame/support/src/dispatch.rs b/substrate/frame/support/src/dispatch.rs
index 99099683003..14bc2667def 100644
--- a/substrate/frame/support/src/dispatch.rs
+++ b/substrate/frame/support/src/dispatch.rs
@@ -315,10 +315,8 @@ impl PostDispatchInfo {
 					"Post dispatch weight is greater than pre dispatch weight. \
 					Pre dispatch weight may underestimating the actual weight. \
 					Greater post dispatch weight components are ignored.
-					Pre dispatch weight: {:?},
-					Post dispatch weight: {:?}",
-					actual_weight,
-					info_total_weight,
+					Pre dispatch weight: {info_total_weight:?},
+					Post dispatch weight: {actual_weight:?}",
 				);
 			}
 			actual_weight.min(info.total_weight())
-- 
GitLab