Skip to content

Commit

Permalink
cleanup and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Aug 8, 2024
1 parent f7a1603 commit 20dccfc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/docs/migration_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Token contract diff:
+}
+assert(minuend >= subtrahend, "Balance too low");

Note that the notes are not ensured to be obtained and removed so you have the place checks on the returned notes (e.g. in the example above by checking a sum of balances or by checking that returned note length assert(notes.len() == expected_num_notes)).
Note that the notes are not ensured to be obtained and removed so you have the place checks on the returned notes (e.g. in the example above by checking a sum of balances or by checking the returned notes length assert(notes.len() == expected_num_notes)).



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ The usage is similar to using the `insert` method with the difference that this

### `pop_notes`

This function pops (gets, removes and returns) the notes the account has access to based on the providing filter.
This function pops (gets, removes and returns) the notes the account has access to based on the provided filter.

The kernel circuits are constrained to a maximum number of notes this function can return at a time. Check [here (GitHub link)](https://github.com/AztecProtocol/aztec-packages/blob/#include_aztec_version/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr) and look for `MAX_NOTE_HASH_READ_REQUESTS_PER_CALL` for the up-to-date number.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ impl Deck<&mut PrivateContext> {
}

pub fn remove_cards<N>(&mut self, cards: [Card; N]) {
// TODO(benesjan): try to simplify this func
let options = NoteGetterOptions::with_filter(filter_cards, cards);
let notes = self.set.pop_notes(options);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,8 @@ contract Test {
let secret_hash = compute_secret_hash(secret);
let mut options = NoteGetterOptions::new();
options = options.select(TestNote::properties().value, secret_hash, Option::none()).set_limit(1);
notes_set.pop_notes(options);
let notes = notes_set.pop_notes(options);
assert(notes.len() == 1, "note not popped");
}

unconstrained fn get_constant() -> pub Field {
Expand Down

0 comments on commit 20dccfc

Please sign in to comment.