mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-08-01 12:51:30 +00:00
add hash of the node method
This commit is contained in:
@@ -193,6 +193,14 @@ impl NodeData {
|
|||||||
let mut cursor = std::io::Cursor::new(buf);
|
let mut cursor = std::io::Cursor::new(buf);
|
||||||
Self::read(consensus_branch_id, &mut cursor)
|
Self::read(consensus_branch_id, &mut cursor)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn hash(&self) -> [u8; 32] {
|
||||||
|
let mut buf = [0u8; 32];
|
||||||
|
|
||||||
|
let bytes = self.to_bytes();
|
||||||
|
|
||||||
|
blake2b_personal(&personalization(self.consensus_branch_id), &bytes)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
Reference in New Issue
Block a user