Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix defensive! macro to be used in umbrella crates #7069

Merged
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 10 additions & 0 deletions prdoc/pr_7069.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
title: Fix defensive! macro to be used in umbrella crates
doc:
- audience: Runtime Dev
description: |-
PR for #7054

Replaced frame_support with $crate from @gui1117 's suggestion to fix the dependency issue
crates:
- name: frame-support
bump: patch
6 changes: 3 additions & 3 deletions substrate/frame/support/src/traits/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ impl<T: VariantCount> Get<u32> for VariantCountOf<T> {
#[macro_export]
macro_rules! defensive {
() => {
frame_support::__private::log::error!(
$crate::__private::log::error!(
target: "runtime::defensive",
"{}",
$crate::traits::DEFENSIVE_OP_PUBLIC_ERROR
);
debug_assert!(false, "{}", $crate::traits::DEFENSIVE_OP_INTERNAL_ERROR);
};
($error:expr $(,)?) => {
frame_support::__private::log::error!(
$crate::__private::log::error!(
target: "runtime::defensive",
"{}: {:?}",
$crate::traits::DEFENSIVE_OP_PUBLIC_ERROR,
Expand All @@ -83,7 +83,7 @@ macro_rules! defensive {
debug_assert!(false, "{}: {:?}", $crate::traits::DEFENSIVE_OP_INTERNAL_ERROR, $error);
};
($error:expr, $proof:expr $(,)?) => {
frame_support::__private::log::error!(
$crate::__private::log::error!(
target: "runtime::defensive",
"{}: {:?}: {:?}",
$crate::traits::DEFENSIVE_OP_PUBLIC_ERROR,
Expand Down
Loading