Format subtree roots in little-endian order (#7466)
This commit is contained in:
parent
243ae9a0c2
commit
99c6dfb23f
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue