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

better debugging for accountid32 in debug build #2990

Merged
merged 4 commits into from
Jan 19, 2024
Merged
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions substrate/primitives/core/src/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,13 +593,13 @@ impl std::fmt::Display for AccountId32 {
}

impl sp_std::fmt::Debug for AccountId32 {
#[cfg(feature = "std")]
#[cfg(any(feature = "std", debug_assertions))]
liamaharon marked this conversation as resolved.
Show resolved Hide resolved
fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
let s = self.to_ss58check();
write!(f, "{} ({}...)", crate::hexdisplay::HexDisplay::from(&self.0), &s[0..8])
}

#[cfg(not(feature = "std"))]
#[cfg(not(any(feature = "std", debug_assertions)))]
fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
Ok(())
}
Expand Down
Loading