diff --git a/yarn-project/noir-contracts/src/contracts/native_token_contract/src/main.nr b/yarn-project/noir-contracts/src/contracts/native_token_contract/src/main.nr index 0f140b06731..ba2bc64737a 100644 --- a/yarn-project/noir-contracts/src/contracts/native_token_contract/src/main.nr +++ b/yarn-project/noir-contracts/src/contracts/native_token_contract/src/main.nr @@ -351,7 +351,7 @@ contract NativeToken { let public_note = TransparentNote::new_from_secret(amount, secret); // Ensure that the note exists in the tree and remove it. - pending_shields.assert_contains_and_remove(public_note); + pending_shields.assert_contains_and_remove_publicly_created(public_note); // Mint the tokens let balance = storage.balances.at(owner); diff --git a/yarn-project/noir-contracts/src/contracts/non_native_token_contract/src/main.nr b/yarn-project/noir-contracts/src/contracts/non_native_token_contract/src/main.nr index c19f4ca5a3c..75aca44a9f7 100644 --- a/yarn-project/noir-contracts/src/contracts/non_native_token_contract/src/main.nr +++ b/yarn-project/noir-contracts/src/contracts/non_native_token_contract/src/main.nr @@ -247,7 +247,7 @@ contract NonNativeToken { let public_note = TransparentNote::new_from_secret(amount, secret); // Ensure that the note exists in the tree and remove it. - pending_shields.assert_contains_and_remove(public_note); + pending_shields.assert_contains_and_remove_publicly_created(public_note); // Mint the tokens let balance = storage.balances.at(owner); diff --git a/yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/src/main.nr b/yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/src/main.nr index da67fc0bb4f..2216e36ecba 100644 --- a/yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/src/main.nr +++ b/yarn-project/noir-contracts/src/contracts/private_token_airdrop_contract/src/main.nr @@ -166,7 +166,7 @@ contract PrivateTokenAirdrop { // Remove the claim note if it exists in the set. let note = ClaimNote::new(amount, secret); - storage.claims.assert_contains_note_and_remove(note); + storage.claims.assert_contains_and_remove(note); // Send the value note. let balance = storage.balances.at(owner); diff --git a/yarn-project/noir-libs/aztec-noir/src/state_vars/set.nr b/yarn-project/noir-libs/aztec-noir/src/state_vars/set.nr index 69685deeee4..c14eebb770d 100644 --- a/yarn-project/noir-libs/aztec-noir/src/state_vars/set.nr +++ b/yarn-project/noir-libs/aztec-noir/src/state_vars/set.nr @@ -49,10 +49,10 @@ impl Set { ); } - // TODO(#1386) - // Should be replaced by `assert_contains_and_remove`. - fn assert_contains_note_and_remove(self, note: Note) { + fn assert_contains_and_remove(self, note: Note) { let mut note_with_header = note; + // TODO(1386): replace with `ensure_note_hash_exists` + // once `get_commitment` works for privately created note hashes ensure_note_exists( self.context.private.unwrap(), self.storage_slot, @@ -67,10 +67,10 @@ impl Set { ); } - // TODO(https://github.com/AztecProtocol/aztec-packages/issues/1386): - // replace function above ^ once public kernel injects - // nonces to note hashes. - fn assert_contains_and_remove(self, note: Note) { + // NOTE: this function should ONLY be used for PUBLICLY-CREATED note hashes! + // WARNING: function will be deprecated/removed eventually once `assert_contains_and_remove` + // works for publicly-created note hashes as well. + fn assert_contains_and_remove_publicly_created(self, note: Note) { let mut note_with_header = note; // Modifies note with the header which is necessary for the next step (remove). ensure_note_hash_exists(