Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented OutputNote::hash #782

Merged
merged 2 commits into from
Jul 2, 2024
Merged

Implemented OutputNote::hash #782

merged 2 commits into from
Jul 2, 2024

Conversation

polydez
Copy link
Contributor

@polydez polydez commented Jul 2, 2024

We need this method in order to easily calculate hash for output notes. Related to 0xPolygonMiden/miden-node#396

@polydez polydez requested a review from bobbinth July 2, 2024 13:26
Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you! I left two minor comments inline. Once these are addressed, we can merge.

///
/// 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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I would rename this into build_note_hash() or compute_note_hash().

Comment on lines 212 to 214
/// This value is used primarily for authenticating notes consumed when they are consumed
/// in a transaction.
pub fn hash(&self) -> Digest {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably get rid of this part of the comment since here we are in an output note.

@polydez polydez merged commit c29d1de into next Jul 2, 2024
12 checks passed
@polydez polydez deleted the polydez-output-note-hash branch July 2, 2024 14:44
bobbinth pushed a commit that referenced this pull request Jul 4, 2024
* feat: implement `OutputNote::hash`

* fix: review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants