-
Notifications
You must be signed in to change notification settings - Fork 240
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
refactor: singleton redesign #3753
Labels
C-aztec.nr
Component: Aztec smart contract framework
Comments
One option is to make replace like this: pub fn replace<Env>(
self,
new_note_builder: fn[Env](old_note: Note) -> Note, // closure
broadcast: bool,
) -> Note { So it can still be safe and be used like let new_note = singleton.replace(|old_note| {
assert(old_note.foo == 27);
MyNewNote::new(old_note.whatever)
}, true); |
Referring to #3123 for completeness |
This have been covered through the ordering and squashing work |
This was referenced Jan 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Singletons currently have
get_note
andreplace
functions that both emit nullifiers to ensure that the old value is "up to date". This means that updating the note such that the value at t' is dependent on the value at t is quite a mess.A description and pointers to where this is encountered can be seen in #3689.
The text was updated successfully, but these errors were encountered: