From c4d1d21b4bab8ed9eda4b00522cc9d99f89b6d20 Mon Sep 17 00:00:00 2001 From: Herr Seppia Date: Tue, 8 Oct 2024 15:50:59 +0200 Subject: [PATCH] node-data: change `Transaction::hash` to use Sha3 --- node-data/src/ledger/transaction.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node-data/src/ledger/transaction.rs b/node-data/src/ledger/transaction.rs index 1d8b7b4fbd..b26e25edc6 100644 --- a/node-data/src/ledger/transaction.rs +++ b/node-data/src/ledger/transaction.rs @@ -9,8 +9,8 @@ use std::io; use dusk_bytes::Serializable as DuskSerializable; use execution_core::signatures::bls; use execution_core::transfer::Transaction as ProtocolTransaction; -use execution_core::BlsScalar; use serde::Serialize; +use sha3::Digest; use crate::Serializable; @@ -63,7 +63,7 @@ impl Transaction { /// ### Returns /// An array of 32 bytes representing the hash of the transaction. pub fn hash(&self) -> [u8; 32] { - BlsScalar::hash_to_scalar(&self.inner.to_var_bytes()[..]).to_bytes() + sha3::Sha3_256::digest(self.inner.to_var_bytes()).into() } /// Computes the transaction ID.