chain: add docs about transaction and block hashes.

This commit is contained in:
Henry de Valence 2020-09-04 13:40:35 -07:00 committed by Deirdre Connolly
parent 2a50298b2e
commit 0a1878d9c3
2 changed files with 6 additions and 0 deletions

View File

@ -15,6 +15,9 @@ use super::Header;
/// Technically, this is the (SHA256d) hash of a block *header*, but since the
/// block header includes the Merkle root of the transaction Merkle tree, it
/// binds the entire contents of the block and is used to identify entire blocks.
///
/// Note: Zebra displays transaction and block hashes in their actual byte-order,
/// not in reversed byte-order.
#[derive(Copy, Clone, Eq, PartialEq, Hash, Serialize, Deserialize)]
#[cfg_attr(test, derive(Arbitrary))]
pub struct Hash(pub [u8; 32]);

View File

@ -10,6 +10,9 @@ use crate::serialization::{sha256d, SerializationError, ZcashSerialize};
use super::Transaction;
/// A transaction hash.
///
/// Note: Zebra displays transaction and block hashes in their actual byte-order,
/// not in reversed byte-order.
#[derive(Copy, Clone, Eq, PartialEq, Serialize, Deserialize, Hash)]
#[cfg_attr(test, derive(Arbitrary))]
pub struct Hash(pub [u8; 32]);