mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-02 21:33:09 +00:00
add TODO to remove unwrap
This commit is contained in:
parent
81b6d34693
commit
e286108bb5
@ -153,6 +153,9 @@ impl ActionData {
|
||||
impl Transaction {
|
||||
/// Computes and returns the SHA-256 hash of the JSON-serialized representation of `self`.
|
||||
pub fn hash(&self) -> TreeHashType {
|
||||
// TODO: Remove `unwrap` by implementing a `to_bytes` method
|
||||
// that deterministically encodes all transaction fields to bytes
|
||||
// and guarantees serialization will succeed.
|
||||
let raw_data = serde_json::to_vec(&self).unwrap();
|
||||
let mut hasher = sha2::Sha256::new();
|
||||
hasher.update(&raw_data);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user