|
1 | 1 | use aztec::{ |
2 | | - context::{PrivateContext, PublicContext}, |
3 | | - history::nullifier::assert_nullifier_existed_by, |
| 2 | + context::{NullifierExistenceRequest, PrivateContext, PublicContext}, |
4 | 3 | keys::getters::{get_nhk_app, get_public_keys, try_get_public_keys}, |
5 | 4 | macros::notes::custom_note, |
6 | 5 | messages::{ |
@@ -216,14 +215,11 @@ impl PartialUintNote { |
216 | 215 | // We verify that the partial note we're completing is valid (i.e. completer is correct, it uses the correct |
217 | 216 | // state variable's storage slot, and it is internally consistent). |
218 | 217 | let validity_commitment = self.compute_validity_commitment(completer); |
219 | | - // `assert_nullifier_existed_by` function expects the nullifier to be siloed (hashed with the address of the |
220 | | - // contract that emitted the nullifier) as it checks the value directly against the nullifier tree and all the |
221 | | - // nullifiers in the tree are siloed by the protocol. |
| 218 | + |
222 | 219 | let siloed_validity_commitment = compute_siloed_nullifier(context.this_address(), validity_commitment); |
223 | | - assert_nullifier_existed_by( |
224 | | - context.get_anchor_block_header(), |
225 | | - siloed_validity_commitment, |
226 | | - ); |
| 220 | + // Note that this means we don't support scenarios in which the validity commitment was created in the same |
| 221 | + // transaction. |
| 222 | + context.assert_nullifier_exists(NullifierExistenceRequest::for_settled(siloed_validity_commitment)); |
227 | 223 |
|
228 | 224 | // We need to do two things: |
229 | 225 | // - emit an unencrypted log containing the public fields (the storage slot and value) via the private log |
|
0 commit comments