Skip to content

Commit

Permalink
fix: review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
polydez committed Jul 2, 2024
1 parent 4978633 commit 45eb98f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions objects/src/notes/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}

Expand All @@ -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()])
}

Expand Down
2 changes: 1 addition & 1 deletion objects/src/notes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 2 additions & 5 deletions objects/src/transaction/outputs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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())
}
}

Expand Down

0 comments on commit 45eb98f

Please sign in to comment.