From 0a1878d9c349344338173ef07c28d6db50dfca59 Mon Sep 17 00:00:00 2001 From: Henry de Valence Date: Fri, 4 Sep 2020 13:40:35 -0700 Subject: [PATCH] chain: add docs about transaction and block hashes. --- zebra-chain/src/block/hash.rs | 3 +++ zebra-chain/src/transaction/hash.rs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/zebra-chain/src/block/hash.rs b/zebra-chain/src/block/hash.rs index 1c40cb97..f3163dfe 100644 --- a/zebra-chain/src/block/hash.rs +++ b/zebra-chain/src/block/hash.rs @@ -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]); diff --git a/zebra-chain/src/transaction/hash.rs b/zebra-chain/src/transaction/hash.rs index 38ffdc98..a919c13c 100644 --- a/zebra-chain/src/transaction/hash.rs +++ b/zebra-chain/src/transaction/hash.rs @@ -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]);