1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
use crate::*; /// Wrapper of a block hash. #[derive(Copy, Clone, Default, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)] pub struct BlockHash(pub Hash); impl Display for BlockHash { fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { write!(f, "{}", self.0.to_hex()) } } impl Debug for BlockHash { fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { write!(f, "BlockHash({})", self) } }