diff --git a/objects/src/notes/header.rs b/objects/src/notes/header.rs index b5a9acbfc..4cc7247a2 100644 --- a/objects/src/notes/header.rs +++ b/objects/src/notes/header.rs @@ -44,7 +44,7 @@ impl NoteHeader { /// This value is used primarily for authenticating notes consumed when they are consumed /// in a transaction. pub fn hash(&self) -> Digest { - note_hash(self.id(), self.metadata()) + compute_note_hash(self.id(), self.metadata()) } } @@ -57,7 +57,7 @@ impl NoteHeader { /// /// This value is used primarily for authenticating notes consumed when they are consumed /// in a transaction. -pub fn note_hash(id: NoteId, metadata: &NoteMetadata) -> Digest { +pub fn compute_note_hash(id: NoteId, metadata: &NoteMetadata) -> Digest { Hasher::merge(&[id.inner(), Word::from(metadata).into()]) } diff --git a/objects/src/notes/mod.rs b/objects/src/notes/mod.rs index c087453f3..e7dd6aca6 100644 --- a/objects/src/notes/mod.rs +++ b/objects/src/notes/mod.rs @@ -21,7 +21,7 @@ mod details; pub use details::NoteDetails; mod header; -pub use header::{note_hash, NoteHeader}; +pub use header::{compute_note_hash, NoteHeader}; mod inputs; pub use inputs::NoteInputs; diff --git a/objects/src/transaction/outputs.rs b/objects/src/transaction/outputs.rs index 5613e721a..1e0c04ac8 100644 --- a/objects/src/transaction/outputs.rs +++ b/objects/src/transaction/outputs.rs @@ -6,7 +6,7 @@ use vm_processor::DeserializationError; use crate::{ accounts::AccountStub, - notes::{note_hash, Note, NoteAssets, NoteHeader, NoteId, NoteMetadata, PartialNote}, + notes::{compute_note_hash, Note, NoteAssets, NoteHeader, NoteId, NoteMetadata, PartialNote}, Digest, Felt, Hasher, TransactionOutputError, Word, MAX_OUTPUT_NOTES_PER_TX, }; // TRANSACTION OUTPUTS @@ -208,11 +208,8 @@ impl OutputNote { /// Returns a commitment to the note and its metadata. /// /// > hash(NOTE_ID || NOTE_METADATA) - /// - /// This value is used primarily for authenticating notes consumed when they are consumed - /// in a transaction. pub fn hash(&self) -> Digest { - note_hash(self.id(), self.metadata()) + compute_note_hash(self.id(), self.metadata()) } }