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

Introduce Option<T> type to Noir Contracts stdlib #1020

Closed
iAmMichaelConnor opened this issue Jul 11, 2023 · 1 comment · Fixed by #1272
Closed

Introduce Option<T> type to Noir Contracts stdlib #1020

iAmMichaelConnor opened this issue Jul 11, 2023 · 1 comment · Fixed by #1272
Assignees

Comments

@iAmMichaelConnor
Copy link
Contributor

This would make the syntax for getting dummy notes tidier and uniform across apps and across custom note implementations.
I believe there's a PR in Noir to introduce this type.

@iAmMichaelConnor
Copy link
Contributor Author

noir-lang/noir#1781 (comment) <-- recommendation from Jake

iAmMichaelConnor added a commit that referenced this issue Aug 1, 2023
# Description

closes: #1020

Introduce `Option<T>` type to Noir.

Update `get_notes` logic:
- Remove the `is_real` member of some notes. `Option::is_some()` can now
be used instead.
- Remove the `is_dummy` method of the `NoteInterface`.
- When calling the `get_notes` oracle, a boolean `is_some` is injected
after the `nonce` to convey whether the note is a dummy or not.
- Change contract logic to `unwrap` `Option<Note>` types.

It's slightly more verbose in places, but it makes the notion of a dummy
note more enshrined (and actually aligns more closely to our inital
sketches of what utxo syntax might look like).

Thanks to Jake for the Option implementation!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants