-
Notifications
You must be signed in to change notification settings - Fork 310
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
feat: generating Noir constants #1066
Conversation
ce96a86
to
5b6e57c
Compare
global ARGS_LENGTH: comptime Field = 16; | ||
global RETURN_VALUES_LENGTH: comptime Field = 4; | ||
global READ_REQUESTS_LENGTH: comptime Field = 4; | ||
global MAX_NEW_COMMITMENTS_PER_CALL: comptime Field = 4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about some of these GENERATOR__ names but looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I felt like prefixing it with enum name is the best solution given that there are no native enums in Noir. Kev told me that enums can be approximated with structs but that seems like unnecessary complexity to me.
Or would you prefer some other prefix?
@@ -50,7 +50,7 @@ impl<Note, N, S, P> NoteGetterOptions<Note, N, S, P> { | |||
} | |||
|
|||
fn with_filter( | |||
filter: fn ([Note; MAX_READ_REQUESTS], P) -> [Note; S], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, this seems like it should still have MAX in the name, not sure how to reconcile that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe if some of the constants went into a limits
crate and we had limits::READ_REQUESTS_LENGTH
Description
Fixes #1065
Checklist: