From ec9fad22f17a390f06304cfc31fd4ba8e84bd657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Thu, 5 Dec 2024 20:24:02 +0000 Subject: [PATCH 1/2] Fix max_note_len computation --- noir-projects/aztec-nr/aztec/src/macros/mod.nr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noir-projects/aztec-nr/aztec/src/macros/mod.nr b/noir-projects/aztec-nr/aztec/src/macros/mod.nr index 883a20283269..8c60a32d39e1 100644 --- a/noir-projects/aztec-nr/aztec/src/macros/mod.nr +++ b/noir-projects/aztec-nr/aztec/src/macros/mod.nr @@ -114,7 +114,7 @@ comptime fn generate_compute_note_hash_and_optionally_a_nullifier() -> Quoted { max_note_length = notes.fold( 0, |acc, (_, (_, len, _, _)): (Type, (StructDefinition, u32, Field, [(Quoted, u32, bool)]))| { - acc + len + if len > acc { len } else { acc } }, ); From 933643eff75929f62e68d2107dbea4ab0264b55d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Fri, 6 Dec 2024 20:33:07 +0000 Subject: [PATCH 2/2] Fix format --- noir-projects/aztec-nr/aztec/src/macros/mod.nr | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/noir-projects/aztec-nr/aztec/src/macros/mod.nr b/noir-projects/aztec-nr/aztec/src/macros/mod.nr index 8c60a32d39e1..aa6884090881 100644 --- a/noir-projects/aztec-nr/aztec/src/macros/mod.nr +++ b/noir-projects/aztec-nr/aztec/src/macros/mod.nr @@ -114,7 +114,11 @@ comptime fn generate_compute_note_hash_and_optionally_a_nullifier() -> Quoted { max_note_length = notes.fold( 0, |acc, (_, (_, len, _, _)): (Type, (StructDefinition, u32, Field, [(Quoted, u32, bool)]))| { - if len > acc { len } else { acc } + if len > acc { + len + } else { + acc + } }, );