Add Display for PublicKey
@@ -7,6 +7,7 @@ use ssz::{
decode_ssz_list, hash, ssz_encode, Decodable, DecodeError, Encodable, SszStream, TreeHash,
};
use std::default;
+use std::fmt;
use std::hash::{Hash, Hasher};
/// A single BLS signature.
@@ -54,6 +55,12 @@ impl PublicKey {
}
}
+impl fmt::Display for PublicKey {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ write!(f, "{}", self.concatenated_hex_id())
+ }
+}
+
impl default::Default for PublicKey {
fn default() -> Self {
let secret_key = SecretKey::random();
