Skip to content

Commit

Permalink
Fix reversed error message in DispatchInfo (#7170)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
skunert and bkchr authored Jan 15, 2025
1 parent 0d660a4 commit f798111
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 8 additions & 0 deletions prdoc/pr_7170.prdoc
Original file line number Diff line number Diff line change
@@ -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
6 changes: 2 additions & 4 deletions substrate/frame/support/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit f798111

Please sign in to comment.