diff --git a/zebra-chain/src/orchard/tree.rs b/zebra-chain/src/orchard/tree.rs index e6848ecc0..205493ca6 100644 --- a/zebra-chain/src/orchard/tree.rs +++ b/zebra-chain/src/orchard/tree.rs @@ -182,12 +182,9 @@ impl Node { /// Return the node bytes in big-endian byte-order suitable for printing out byte by byte. /// - /// Zebra displays note commitment tree nodes in big-endian byte-order, - /// following the u256 convention set by Bitcoin and zcashd. + /// `zcashd`'s `z_getsubtreesbyindex` does not reverse the byte order of subtree roots. pub fn bytes_in_display_order(&self) -> [u8; 32] { - let mut reversed_bytes = self.0.to_repr(); - reversed_bytes.reverse(); - reversed_bytes + self.to_repr() } } diff --git a/zebra-chain/src/sapling/tree.rs b/zebra-chain/src/sapling/tree.rs index 2c6606cfc..698596216 100644 --- a/zebra-chain/src/sapling/tree.rs +++ b/zebra-chain/src/sapling/tree.rs @@ -190,14 +190,11 @@ impl fmt::Debug for Node { } impl Node { - /// Return the node bytes in big-endian byte-order suitable for printing out byte by byte. + /// Return the node bytes in little-endian byte order suitable for printing out byte by byte. /// - /// Zebra displays note commitment tree nodes in big-endian byte-order, - /// following the u256 convention set by Bitcoin and zcashd. + /// `zcashd`'s `z_getsubtreesbyindex` does not reverse the byte order of subtree roots. pub fn bytes_in_display_order(&self) -> [u8; 32] { - let mut reversed_bytes = self.0; - reversed_bytes.reverse(); - reversed_bytes + self.0 } }