|
1 | 1 | //! Sender-side helpers for constrained message delivery. |
2 | 2 |
|
3 | | -use crate::context::{NullifierExistenceRequest, PrivateContext}; |
| 3 | +use crate::context::PrivateContext; |
| 4 | +use crate::nullifier::utils::compute_nullifier_existence_request; |
4 | 5 | use crate::oracle::{call_utility_function::call_utility_function, notes::get_next_constrained_index}; |
5 | 6 |
|
6 | 7 | use crate::protocol::{ |
@@ -31,9 +32,10 @@ use crate::protocol::{ |
31 | 32 | /// note. |
32 | 33 | /// - `index > 0`: asserts the prior nullifier |
33 | 34 | /// `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. |
37 | 39 | pub fn calculate_secret_and_index( |
38 | 40 | context: &mut PrivateContext, |
39 | 41 | registry: AztecAddress, |
@@ -90,10 +92,8 @@ pub fn calculate_secret_and_index( |
90 | 92 | [sender.to_field(), recipient.to_field(), secret, (index - 1) as Field], |
91 | 93 | DOM_SEP__CONSTRAINED_MSG_NULLIFIER, |
92 | 94 | ); |
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)); |
97 | 97 | } |
98 | 98 |
|
99 | 99 | (secret, index) |
|
0 commit comments