Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions noir-projects/aztec-nr/aztec/src/macros/aztec.nr
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ comptime fn generate_contract_library_method_compute_note_hash_and_nullifier() -
) -> Option<aztec::messages::discovery::NoteHashAndNullifier> {
$if_note_type_id_match_statements
else {
aztec::protocol::logging::warn_log_format(
"[aztec-nr] Unknown note type id {0}. Skipping note.",
[note_type_id],
);
Option::none()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,20 @@ unconstrained fn returns_none_for_empty_packed_note() {

assert(result.is_none());
}

#[test]
unconstrained fn returns_none_for_unknown_note_type_id() {
let packed_note = BoundedVec::from_array([42]);

let result = NoteHashAndNullifier::test_compute_note_hash_and_nullifier(
packed_note,
AztecAddress::zero(),
0,
0xdeadbeef,
AztecAddress::zero(),
0,
0,
);

assert(result.is_none());
}
Loading