From f3dfb453df81eee0f7c6d8dc37f998cd14d75004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Fri, 1 Mar 2024 19:55:12 +0000 Subject: [PATCH] Add error messages --- noir/noir-repo/aztec_macros/src/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/noir/noir-repo/aztec_macros/src/lib.rs b/noir/noir-repo/aztec_macros/src/lib.rs index 012995d6ed4..1285dab33ab 100644 --- a/noir/noir-repo/aztec_macros/src/lib.rs +++ b/noir/noir-repo/aztec_macros/src/lib.rs @@ -1875,8 +1875,8 @@ fn generate_compute_note_hash_and_nullifier_source(note_types: &Vec) -> // For now we hardcode it to 20, which is the same as MAX_NOTE_FIELDS_LENGTH. if note_types.is_empty() { - // TODO(#4520): Even if the contract does not include any notes, other parts of the stack expect for this - // function to exist, so we include a dummy version. We likely should error out here instead. + // Even if the contract does not include any notes, other parts of the stack expect for this function to exist, + // so we include a dummy version. " unconstrained fn compute_note_hash_and_nullifier( contract_address: AztecAddress, @@ -1885,6 +1885,7 @@ fn generate_compute_note_hash_and_nullifier_source(note_types: &Vec) -> note_type_id: Field, serialized_note: [Field; 20] ) -> pub [Field; 4] { + assert(false, \"This contract does not use private notes\"); [0, 0, 0, 0] }" .to_string() @@ -1898,10 +1899,10 @@ fn generate_compute_note_hash_and_nullifier_source(note_types: &Vec) -> }}" , note_type)).collect(); - // TODO(#4520): error out on the else instead of returning a zero array let full_if_statement = if_statements.join(" else ") + " else { + assert(false, \"Unknown note type ID\"); [0, 0, 0, 0] }";