diff --git a/src/consensus.rs b/src/consensus.rs index b2b5d4c..c7d32d5 100644 --- a/src/consensus.rs +++ b/src/consensus.rs @@ -1,4 +1,12 @@ +use std::fmt; + pub struct ChainIndex { pub height: u64, pub id: [u8; 32], +} + +impl fmt::Display for ChainIndex { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}:{}", self.height, hex::encode(&self.id)) + } } \ No newline at end of file