Skip to content

Commit 37c3d0e

Browse files
committed
use compute_nullifier_existence_request
1 parent f4b6e86 commit 37c3d0e

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

noir-projects/aztec-nr/aztec/src/messages/delivery/constrained_delivery.nr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Sender-side helpers for constrained message delivery.
22

3-
use crate::context::{NullifierExistenceRequest, PrivateContext};
3+
use crate::context::PrivateContext;
4+
use crate::nullifier::utils::compute_nullifier_existence_request;
45
use crate::oracle::{call_utility_function::call_utility_function, notes::get_next_constrained_index};
56

67
use crate::protocol::{
@@ -31,9 +32,10 @@ use crate::protocol::{
3132
/// note.
3233
/// - `index > 0`: asserts the prior nullifier
3334
/// `poseidon2_hash_with_separator([sender, recipient, secret, index - 1], DOM_SEP__CONSTRAINED_MSG_NULLIFIER)`
34-
/// exists in the app's pending set / nullifier tree. The chain transitively constrains back to the
35-
/// index-0 `validate_handshake`. The caller is expected to emit the matching nullifier alongside each
36-
/// constrained send so subsequent calls can prove the chain.
35+
/// exists via [`compute_nullifier_existence_request`](crate::nullifier::utils::compute_nullifier_existence_request).
36+
/// The chain transitively constrains back to the index-0 `validate_handshake`. The caller is expected
37+
/// to emit the matching nullifier alongside each constrained send so subsequent calls can prove the
38+
/// chain.
3739
pub fn calculate_secret_and_index(
3840
context: &mut PrivateContext,
3941
registry: AztecAddress,
@@ -90,10 +92,8 @@ pub fn calculate_secret_and_index(
9092
[sender.to_field(), recipient.to_field(), secret, (index - 1) as Field],
9193
DOM_SEP__CONSTRAINED_MSG_NULLIFIER,
9294
);
93-
context.assert_nullifier_exists(NullifierExistenceRequest::for_pending(
94-
prev_nullifier,
95-
caller,
96-
));
95+
// TODO(F-670): exercise the index > 0 path end-to-end once send_constrained_msg emits nullifiers.
96+
context.assert_nullifier_exists(compute_nullifier_existence_request(prev_nullifier, caller));
9797
}
9898

9999
(secret, index)

0 commit comments

Comments
 (0)