Skip to content

Commit

Permalink
execution-core: Add hash method for Transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
moCello committed Jul 23, 2024
1 parent fdfb0bd commit f548b93
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions execution-core/src/transfer/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@ impl Transaction {
Self::Moonlight(tx) => tx.to_hash_input_bytes(),
}
}

/// Create the unique transaction hash.
#[must_use]
pub fn hash(&self) -> BlsScalar {
match self {
Self::Phoenix(tx) => tx.hash(),
Self::Moonlight(tx) => tx.hash(),
}
}
}

impl From<PhoenixTransaction> for Transaction {
Expand Down

0 comments on commit f548b93

Please sign in to comment.