Skip to content
Snippets Groups Projects
Unverified Commit f2336d32 authored by PG Herveou's avatar PG Herveou Committed by GitHub
Browse files

better debugging for accountid32 in debug build (#2990)

parent 4fb2a559
Branches
No related merge requests found
Pipeline #436279 passed with stages
in 57 minutes and 48 seconds
......@@ -593,14 +593,16 @@ impl std::fmt::Display for AccountId32 {
}
impl sp_std::fmt::Debug for AccountId32 {
#[cfg(feature = "std")]
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(feature = "serde")]
{
let s = self.to_ss58check();
write!(f, "{} ({}...)", crate::hexdisplay::HexDisplay::from(&self.0), &s[0..8])?;
}
#[cfg(not(feature = "serde"))]
write!(f, "{}", crate::hexdisplay::HexDisplay::from(&self.0))?;
#[cfg(not(feature = "std"))]
fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
Ok(())
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment