Skip to content

Commit

Permalink
node-data: change Transaction::hash to use Sha3
Browse files Browse the repository at this point in the history
  • Loading branch information
herr-seppia committed Oct 8, 2024
1 parent 410012e commit c4d1d21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions node-data/src/ledger/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit c4d1d21

Please sign in to comment.