HomePhabricator

[Chronik] Add `BlockHash` struct wrapping `Sha256d` to avoid mixing kinds of…

Description

[Chronik] Add BlockHash struct wrapping Sha256d to avoid mixing kinds of hashes

Summary: Unlike Sha256d, BlockHash has a well-defined byte-order (little-endian) and hex representation (big-endian), so we can implement TryFrom<&[u8]>, Display and FromStr.

Test Plan: ninja check-bitcoinsuite

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D11727

Details

Provenance
tobias_ruckAuthored on Jul 5 2022, 20:40
tobias_ruckPushed on Jul 8 2022, 10:54
Reviewer
Restricted Project
Differential Revision
D11727: [Chronik] Add `BlockHash` struct wrapping `Sha256d` to avoid mixing kinds of hashes
Parents
rABC9c5bc52366a6: [avalanche] Get rid of the compact proof cleanup log
Branches
Unknown
Tags
Unknown