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

Avoid copying of note's metadata in getter #593

Merged
merged 1 commit into from
Apr 11, 2024
Merged

Conversation

polydez
Copy link
Contributor

@polydez polydez commented Apr 11, 2024

Let user of the getter decide, if they need to copy it.

@polydez polydez requested review from hackaugusto and bobbinth April 11, 2024 07:16
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!

Is this critical for the node? If so, we should merge this into main and I can make another release (e.g., v0.2.1). If not, we can merge this into next and use it in the next version of the node (i.e., v0.3).

@polydez
Copy link
Contributor Author

polydez commented Apr 11, 2024

Is this critical for the node? If so, we should merge this into main and I can make another release (e.g., v0.2.1). If not, we can merge this into next and use it in the next version of the node (i.e., v0.3).

It's not critical, I've added TODO in order to simplify code later:

// TODO: Substitute by using just note.metadata() once this getter returns reference
//       Tracking PR: https://github.com/0xPolygonMiden/miden-base/pull/593
match note {
    OutputNote::Public(note) => note.metadata(),
    OutputNote::Private(note) => note.metadata(),
},

@polydez polydez merged commit b1078f8 into next Apr 11, 2024
9 checks passed
@polydez polydez deleted the polydez-note-metadata-ref branch April 11, 2024 09:21
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