Skip to content

Commit

Permalink
nicer debug on merkle Tree
Browse files Browse the repository at this point in the history
  • Loading branch information
ralexstokes committed Mar 30, 2024
1 parent a48ef37 commit 033d24c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions ssz-rs/src/merkleization/merkleize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,9 @@ impl Index<GeneralizedIndex> for Tree {

impl std::fmt::Debug for Tree {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
for chunk in self.0.chunks(BYTES_PER_CHUNK) {
let node = hex::encode(chunk);
f.write_str(&node)?;
f.write_str(",\n")?;
}
Ok(())
f.debug_list()
.entries(self.0.chunks(BYTES_PER_CHUNK).map(|chunk| hex::encode(chunk)))
.finish()
}
}

Expand Down

0 comments on commit 033d24c

Please sign in to comment.