Skip to content

Commit 75bf6b9

Browse files
Added Debug impl for Hash struct
1 parent f44989f commit 75bf6b9

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/transaction/hash.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub(crate) const HASH_LENGTH: usize = 32;
1414
/// ```plain_text
1515
/// YwVPf35VckF4Yu5XwF18P9VwWwfQVGAQmqDp4bpgtuV
1616
/// ```
17-
#[derive(Debug, Default, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
17+
#[derive(Default, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1818
pub struct Hash([u8; HASH_LENGTH]); //// converge w/ Address using macro
1919

2020
impl Hash {
@@ -36,6 +36,12 @@ impl Hash {
3636
}
3737
}
3838

39+
impl fmt::Debug for Hash {
40+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
41+
write!(f, "{}", self.0.to_base58())
42+
}
43+
}
44+
3945
impl fmt::Display for Hash {
4046
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
4147
write!(f, "{}", self.0.to_base58())

0 commit comments

Comments
 (0)