From acc83202bcb1b3e6a4de15d3c6072fa771b42fa8 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 27 Sep 2018 17:53:57 +0100 Subject: [PATCH] SS58 addresses in BFT (#823) * SS58 addresses in BFT Closes #590 * Fix wasm compile --- substrate/core/primitives/src/authority_id.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/substrate/core/primitives/src/authority_id.rs b/substrate/core/primitives/src/authority_id.rs index c82261bce5..39134530b9 100644 --- a/substrate/core/primitives/src/authority_id.rs +++ b/substrate/core/primitives/src/authority_id.rs @@ -36,14 +36,15 @@ impl AuthorityId { #[cfg(feature = "std")] impl ::std::fmt::Display for AuthorityId { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - write!(f, "{}", ::hexdisplay::HexDisplay::from(&self.0)) + write!(f, "{}", ::ed25519::Public(self.0).to_ss58check()) } } #[cfg(feature = "std")] impl ::std::fmt::Debug for AuthorityId { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { - write!(f, "{}", ::hexdisplay::HexDisplay::from(&self.0)) + let h = format!("{}", ::hexdisplay::HexDisplay::from(&self.0)); + write!(f, "{} ({}…{})", ::ed25519::Public(self.0).to_ss58check(), &h[0..8], &h[60..]) } }