From 11596b6d20dc41d2abcfb799ede6203991eccbe3 Mon Sep 17 00:00:00 2001 From: benesjan Date: Thu, 24 Oct 2024 20:42:45 +0000 Subject: [PATCH] fixes after rebase --- .../aztec-nr/aztec/src/macros/notes/mod.nr | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/noir-projects/aztec-nr/aztec/src/macros/notes/mod.nr b/noir-projects/aztec-nr/aztec/src/macros/notes/mod.nr index 32166ce1f51..b8d18b33ef6 100644 --- a/noir-projects/aztec-nr/aztec/src/macros/notes/mod.nr +++ b/noir-projects/aztec-nr/aztec/src/macros/notes/mod.nr @@ -1,8 +1,8 @@ -use crate::note::{note_getter_options::PropertySelector, note_header::NoteHeader}; +use crate::{note::{note_getter_options::PropertySelector, note_header::NoteHeader}, prelude::Point}; use protocol_types::meta::{flatten_to_fields, pack_from_fields}; use std::{ collections::umap::UHashMap, - hash::{BuildHasherDefault, poseidon2::Poseidon2Hasher, derive_generators}, + hash::{BuildHasherDefault, derive_generators, poseidon2::Poseidon2Hasher}, meta::{typ::fresh_type_variable, type_of, unquote}, }; @@ -318,12 +318,17 @@ comptime fn generate_multi_scalar_mul( let flattened_as_field = flattened_field[j]; let generator_index = start_generator_index + j; - let generators: [Point; 1] = derive_generators("aztec_nr_generators".as_bytes(), generator_index); + let generators: [Point; 1] = + derive_generators("aztec_nr_generators".as_bytes(), generator_index); let generator_x = generators[0].x; - let generator_y = generators[1].y; - - generators_list = generators_list.push_back(f"aztec::protocol_types::point::Point {{ x: {generator_x}, y: {generator_y}, is_infinite: false }}".quoted_contents()); - scalars_list = scalars_list.push_back(quote { std::hash::from_field_unsafe($flattened_as_field) }); + let generator_y = generators[0].y; + + generators_list = generators_list.push_back( + f"aztec::protocol_types::point::Point {{ x: {generator_x}, y: {generator_y}, is_infinite: false }}" + .quoted_contents(), + ); + scalars_list = + scalars_list.push_back(quote { std::hash::from_field_unsafe($flattened_as_field) }); } args_list = args_list.push_back(quote { $field_name: $typ }); aux_vars_list = aux_vars_list.append(aux_vars); @@ -615,7 +620,7 @@ comptime fn generate_finalization_payload( comptime fn generate_partial_note_impl( s: StructDefinition, setup_payload_name: Quoted, - finalization_payload_name: Quoted + finalization_payload_name: Quoted, ) -> Quoted { let name = s.name(); quote {