SS58 addresses in BFT (#823)

* SS58 addresses in BFT

Closes #590

* Fix wasm compile
This commit is contained in:
Gav Wood
2018-09-27 17:53:57 +01:00
committed by GitHub
parent 2332d6dd04
commit acc83202bc
@@ -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..])
}
}