Skip to content

Commit

Permalink
fix: quick fix of #6405 by removing context from value note utils (#6509
Browse files Browse the repository at this point in the history
)

Please read [contributing guidelines](CONTRIBUTING.md) and remove this
line.
  • Loading branch information
sklppy88 authored and signorecello committed May 20, 2024
1 parent 60960f0 commit f1c8e31
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions noir-projects/aztec-nr/value-note/src/utils.nr
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,7 @@ pub fn decrement_by_at_most(
let mut decremented = 0;
for i in 0..opt_notes.len() {
if opt_notes[i].is_some() {
let note = opt_notes[i].unwrap_unchecked();

// This is similar to destroy_note, except we only compute the owner_npk_m_hash once instead of doing it in
// each loop iteration.

// Ensure the note is actually owned by the owner (to prevent user from generating a valid proof while
// spending someone else's notes).
// TODO (#6312): This will break with key rotation. Fix this. Will not be able to pass this after rotating keys.
assert(note.npk_m_hash.eq(owner_npk_m_hash));
decremented += note.value;

balance.remove(note);
decremented += destroy_note(balance, owner, opt_notes[i].unwrap_unchecked());
}
}

Expand Down

0 comments on commit f1c8e31

Please sign in to comment.