From 42381d16c1a9ed59994c41b9b5abafa9e90e5f0e Mon Sep 17 00:00:00 2001 From: benesjan Date: Thu, 24 Oct 2024 16:29:26 +0000 Subject: [PATCH] fmt --- .../encrypted_event_emission.nr | 5 +- .../encrypted_logs/encrypted_note_emission.nr | 19 +++++-- .../aztec/src/encrypted_logs/payload.nr | 27 +++++++-- .../aztec-nr/aztec/src/macros/notes/mod.nr | 12 ++-- noir-projects/aztec-nr/aztec/src/prelude.nr | 9 ++- .../aztec-nr/aztec/src/utils/bytes.nr | 55 +++++++++++++------ .../contracts/nft_contract/src/main.nr | 34 ++++++++---- .../contracts/token_contract/src/main.nr | 50 +++++++++-------- .../crates/types/src/meta/mod.nr | 2 +- 9 files changed, 138 insertions(+), 75 deletions(-) diff --git a/noir-projects/aztec-nr/aztec/src/encrypted_logs/encrypted_event_emission.nr b/noir-projects/aztec-nr/aztec/src/encrypted_logs/encrypted_event_emission.nr index 71d7fd6c238b..e8c0e800ddb9 100644 --- a/noir-projects/aztec-nr/aztec/src/encrypted_logs/encrypted_event_emission.nr +++ b/noir-projects/aztec-nr/aztec/src/encrypted_logs/encrypted_event_emission.nr @@ -1,7 +1,7 @@ use crate::{ context::PrivateContext, event::event_interface::EventInterface, encrypted_logs::payload::compute_encrypted_event_log, keys::getters::get_ovsk_app, - oracle::random::random + oracle::random::random, }; fn compute_raw_event_log( @@ -18,7 +18,8 @@ where { let contract_address: AztecAddress = context.this_address(); let plaintext = event.private_to_be_bytes(randomness); - let encrypted_log: [u8; 416 + N * 32] = compute_encrypted_event_log(contract_address, ovsk_app, ovpk, ivpk, recipient, plaintext); + let encrypted_log: [u8; 416 + N * 32] = + compute_encrypted_event_log(contract_address, ovsk_app, ovpk, ivpk, recipient, plaintext); let log_hash = sha256_to_field(encrypted_log); (encrypted_log, log_hash) } diff --git a/noir-projects/aztec-nr/aztec/src/encrypted_logs/encrypted_note_emission.nr b/noir-projects/aztec-nr/aztec/src/encrypted_logs/encrypted_note_emission.nr index 2214905922a5..3b261ddd30d0 100644 --- a/noir-projects/aztec-nr/aztec/src/encrypted_logs/encrypted_note_emission.nr +++ b/noir-projects/aztec-nr/aztec/src/encrypted_logs/encrypted_note_emission.nr @@ -1,7 +1,7 @@ use crate::{ context::PrivateContext, note::{note_emission::NoteEmission, note_interface::NoteInterface}, keys::getters::get_ovsk_app, encrypted_logs::payload::compute_encrypted_note_log, - utils::bytes::bytes_to_fields + utils::bytes::bytes_to_fields, }; use dep::protocol_types::{ address::AztecAddress, public_keys::{PublicKeys, OvpkM, IvpkM}, hash::sha256_to_field, @@ -14,8 +14,11 @@ fn compute_raw_note_log( ovsk_app: Field, ovpk: OvpkM, ivpk: IvpkM, - recipient: AztecAddress -) -> (u32, [u8; 417 + N * 32], Field) where Note: NoteInterface { + recipient: AztecAddress, +) -> (u32, [u8; 417 + N * 32], Field) +where + Note: NoteInterface, +{ let note_header = note.get_header(); let note_hash_counter = note_header.note_hash_counter; let storage_slot = note_header.storage_slot; @@ -27,7 +30,8 @@ fn compute_raw_note_log( let contract_address: AztecAddress = context.this_address(); let plaintext = note.to_be_bytes(storage_slot); - let encrypted_log: [u8; 417 + N * 32] = compute_encrypted_note_log(contract_address, ovsk_app, ovpk, ivpk, recipient, plaintext); + let encrypted_log: [u8; 417 + N * 32] = + compute_encrypted_note_log(contract_address, ovsk_app, ovpk, ivpk, recipient, plaintext); let log_hash = sha256_to_field(encrypted_log); (note_hash_counter, encrypted_log, log_hash) @@ -38,8 +42,11 @@ unconstrained fn compute_raw_note_log_unconstrained( note: Note, ovpk: OvpkM, ivpk: IvpkM, - recipient: AztecAddress -) -> (u32, [u8; 417 + N * 32], Field) where Note: NoteInterface { + recipient: AztecAddress, +) -> (u32, [u8; 417 + N * 32], Field) +where + Note: NoteInterface, +{ let ovsk_app = get_ovsk_app(ovpk.hash()); compute_raw_note_log(context, note, ovsk_app, ovpk, ivpk, recipient) } diff --git a/noir-projects/aztec-nr/aztec/src/encrypted_logs/payload.nr b/noir-projects/aztec-nr/aztec/src/encrypted_logs/payload.nr index b5fffe52930b..fb98240fc733 100644 --- a/noir-projects/aztec-nr/aztec/src/encrypted_logs/payload.nr +++ b/noir-projects/aztec-nr/aztec/src/encrypted_logs/payload.nr @@ -21,7 +21,15 @@ pub fn compute_encrypted_note_log( recipient: AztecAddress, plaintext: [u8; P], ) -> [u8; M] { - compute_encrypted_log(contract_address, ovsk_app, ovpk, ivpk, recipient, plaintext, 1) + compute_encrypted_log( + contract_address, + ovsk_app, + ovpk, + ivpk, + recipient, + plaintext, + 1, + ) } pub fn compute_encrypted_event_log( @@ -30,9 +38,17 @@ pub fn compute_encrypted_event_log( ovpk: OvpkM, ivpk: IvpkM, recipient: AztecAddress, - plaintext: [u8; P] + plaintext: [u8; P], ) -> [u8; M] { - compute_encrypted_log(contract_address, ovsk_app, ovpk, ivpk, recipient, plaintext, 0) + compute_encrypted_log( + contract_address, + ovsk_app, + ovpk, + ivpk, + recipient, + plaintext, + 0, + ) } fn compute_encrypted_log( @@ -42,7 +58,7 @@ fn compute_encrypted_log( ivpk: IvpkM, recipient: AztecAddress, plaintext: [u8; P], - mut offset: u32 + mut offset: u32, ) -> [u8; M] { let (eph_sk, eph_pk) = generate_ephemeral_key_pair(); @@ -56,7 +72,6 @@ fn compute_encrypted_log( let mut encrypted_bytes: [u8; M] = [0; M]; // @todo We ignore the tags for now - offset += 64; let eph_pk_bytes = point_to_bytes(eph_pk); @@ -236,7 +251,7 @@ mod test { ivpk_m, recipient, plaintext, - 0 + 0, ); // The following value was generated by `tagged_log.test.ts` 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 006a602459f8..165d9ec8fe72 100644 --- a/noir-projects/aztec-nr/aztec/src/macros/notes/mod.nr +++ b/noir-projects/aztec-nr/aztec/src/macros/notes/mod.nr @@ -432,7 +432,8 @@ comptime fn generate_setup_payload( // --> we achieve rouding by adding 30 and then dividing without remainder let encrypted_log_field_length = (encrypted_log_byte_length + 30) / 31; - (quote { + ( + quote { struct $setup_payload_name { log_plaintext: [u8; $log_plaintext_length], hiding_point: aztec::protocol_types::point::Point @@ -630,12 +631,14 @@ comptime fn generate_finalization_payload( let fields = fields_list.join(quote {,}); // Now we compute quotes relevant to the multi-scalar multiplication. - let (generators_list, _, args_list, msm_aux_vars) = generate_multi_scalar_mul(indexed_nullable_fields); + let (generators_list, _, args_list, msm_aux_vars) = + generate_multi_scalar_mul(indexed_nullable_fields); // We generate scalars_list manually as we need it to refer self.public_values let mut scalars_list: [Quoted] = &[]; for i in 0..public_values_length { - scalars_list = scalars_list.push_back(quote { std::hash::from_field_unsafe(self.public_values[$i]) }); + scalars_list = + scalars_list.push_back(quote { std::hash::from_field_unsafe(self.public_values[$i]) }); } let generators = generators_list.join(quote {,}); @@ -651,7 +654,8 @@ comptime fn generate_finalization_payload( let setup_log_field_length = (setup_log_byte_length + 30) / 31; let finalization_log_byte_length = setup_log_byte_length + public_values_length * 32; - (quote { + ( + quote { struct $finalization_payload_name { context: &mut aztec::prelude::PublicContext, hiding_point_slot: Field, diff --git a/noir-projects/aztec-nr/aztec/src/prelude.nr b/noir-projects/aztec-nr/aztec/src/prelude.nr index 4eaed773154e..bfa103d66f8b 100644 --- a/noir-projects/aztec-nr/aztec/src/prelude.nr +++ b/noir-projects/aztec-nr/aztec/src/prelude.nr @@ -5,11 +5,10 @@ pub use dep::protocol_types::{ }; pub use crate::{ state_vars::{ - map::Map, private_immutable::PrivateImmutable, private_mutable::PrivateMutable, - public_immutable::PublicImmutable, public_mutable::PublicMutable, private_set::PrivateSet, - shared_immutable::SharedImmutable, shared_mutable::SharedMutable, storage::Storable -}, - context::{PrivateContext, PackedReturns, FunctionReturns, PublicContext}, + map::Map, private_immutable::PrivateImmutable, private_mutable::PrivateMutable, + public_immutable::PublicImmutable, public_mutable::PublicMutable, private_set::PrivateSet, + shared_immutable::SharedImmutable, shared_mutable::SharedMutable, storage::Storable, + }, context::{PrivateContext, PackedReturns, FunctionReturns, PublicContext}, note::{ note_header::NoteHeader, note_interface::{NoteInterface, NullifiableNote}, note_getter_options::NoteGetterOptions, note_viewer_options::NoteViewerOptions, diff --git a/noir-projects/aztec-nr/aztec/src/utils/bytes.nr b/noir-projects/aztec-nr/aztec/src/utils/bytes.nr index 58bbd2330659..355ddad2b57c 100644 --- a/noir-projects/aztec-nr/aztec/src/utils/bytes.nr +++ b/noir-projects/aztec-nr/aztec/src/utils/bytes.nr @@ -75,7 +75,8 @@ mod test { #[test] fn test_bytes_to_1_field() { let input = [ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, ]; let output = bytes_to_fields::<31, 1>(input); @@ -88,9 +89,11 @@ mod test { let output = fields_to_bytes::<31, 1>(input); assert_eq( - output, [ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 - ] + output, + [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, + ], ); } @@ -101,9 +104,13 @@ mod test { // Each field should occupy 31 bytes with the non-zero value being placed in the last one. assert_eq( - output, [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 - ] + output, + [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3, + ], ); } @@ -116,16 +123,21 @@ mod test { // field should occupy 1 byte. There is not information destruction here because the last field fits into // 1 byte. assert_eq( - output, [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3 - ] + output, + [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 2, 3, + ], ); } #[test] fn test_bytes_to_2_fields() { let input = [ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, ]; let output = bytes_to_fields::<59, 2>(input); @@ -136,14 +148,18 @@ mod test { #[test] fn test_2_fields_to_bytes() { let input = [ - 0x0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f, 0x202122232425262728292a2b2c2d2e2f303132333435363738393a3b + 0x0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f, + 0x202122232425262728292a2b2c2d2e2f303132333435363738393a3b, ]; let output = fields_to_bytes::<62, 2>(input); assert_eq( - output, [ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 0, 0, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59 - ] + output, + [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 0, 0, 0, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + ], ); } @@ -165,11 +181,16 @@ mod test { input3: [u64; 5], input4: [u32; 5], input5: [u16; 5], - input6: [u8; 5] + input6: [u8; 5], ) { let mut input = [0; 5]; for i in 0..5 { - input[i] = (input1[i] as Field * 2.pow_32(184)) + (input2[i] as Field * 2.pow_32(120)) + (input3[i] as Field * 2.pow_32(56)) + (input4[i] as Field * 2.pow_32(24)) + (input5[i] as Field * 2.pow_32(8)) + input6[i] as Field; + input[i] = (input1[i] as Field * 2.pow_32(184)) + + (input2[i] as Field * 2.pow_32(120)) + + (input3[i] as Field * 2.pow_32(56)) + + (input4[i] as Field * 2.pow_32(24)) + + (input5[i] as Field * 2.pow_32(8)) + + input6[i] as Field; } let output = fields_to_bytes::<155, 5>(input); diff --git a/noir-projects/noir-contracts/contracts/nft_contract/src/main.nr b/noir-projects/noir-contracts/contracts/nft_contract/src/main.nr index 95ec6a866de6..7b406fdf4244 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/main.nr @@ -11,14 +11,16 @@ contract NFT { use dep::aztec::{ oracle::random::random, prelude::{ - NoteGetterOptions, NoteViewerOptions, Map, PublicMutable, SharedImmutable, PrivateContext, - PrivateSet, AztecAddress, PublicContext - }, - encrypted_logs::encrypted_note_emission::encode_and_encrypt_note, + NoteGetterOptions, NoteViewerOptions, Map, PublicMutable, SharedImmutable, + PrivateContext, PrivateSet, AztecAddress, PublicContext, + }, encrypted_logs::encrypted_note_emission::encode_and_encrypt_note, keys::getters::get_public_keys, note::constants::MAX_NOTES_PER_PAGE, utils::comparison::Comparator, protocol_types::{point::Point, traits::Serialize}, utils::bytes::fields_to_bytes, - macros::{storage::storage, events::event, functions::{private, public, view, internal, initializer}} + macros::{ + storage::storage, events::event, + functions::{private, public, view, internal, initializer}, + }, }; use dep::authwit::auth::{ assert_current_call_valid_authwit, assert_current_call_valid_authwit_public, @@ -203,7 +205,13 @@ contract NFT { // We don't need to perform a check that the value overwritten by `_store_point_in_transient_storage_unsafe` // is zero because the slot is the x-coordinate of the hiding point and hence we could only overwrite // the value in the slot with the same value. This makes usage of the `unsafe` method safe. - NFT::at(context.this_address())._store_payload_in_transient_storage_unsafe(hiding_point_slot, note_setup_payload.hiding_point, setup_log).enqueue(context); + NFT::at(context.this_address()) + ._store_payload_in_transient_storage_unsafe( + hiding_point_slot, + note_setup_payload.hiding_point, + setup_log, + ) + .enqueue(context); hiding_point_slot } @@ -213,12 +221,13 @@ contract NFT { // as it is an entrypoint function. #[public] #[internal] - fn _store_payload_in_transient_storage_unsafe(slot: Field, point: Point, setup_log: [Field; 16]) { + fn _store_payload_in_transient_storage_unsafe( + slot: Field, + point: Point, + setup_log: [Field; 16], + ) { context.storage_write(slot, point); - context.storage_write( - slot + aztec::protocol_types::point::POINT_LENGTH as Field, - setup_log - ); + context.storage_write(slot + aztec::protocol_types::point::POINT_LENGTH as Field, setup_log); } /// Finalizes a transfer of NFT with `token_id` from public balance of `from` to a private balance of `to`. @@ -255,7 +264,8 @@ contract NFT { public_owners_storage.write(AztecAddress::zero()); // Finalize the partial note with the `token_id` - let finalization_payload = NFTNote::finalization_payload().new(context, note_transient_storage_slot, token_id); + let finalization_payload = + NFTNote::finalization_payload().new(context, note_transient_storage_slot, token_id); // At last we emit the note hash and the final log finalization_payload.emit(); diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/main.nr b/noir-projects/noir-contracts/contracts/token_contract/src/main.nr index 96b15b6efd30..cf0d7cb91e3a 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/main.nr @@ -572,29 +572,32 @@ contract Token { let user_point_slot = user_setup_payload.hiding_point.x; // 6. We compute setup logs - let fee_payer_setup_log = fee_payer_setup_payload.encrypt_log(&mut context, fee_payer_keys, fee_payer); + let fee_payer_setup_log = + fee_payer_setup_payload.encrypt_log(&mut context, fee_payer_keys, fee_payer); let user_setup_log = user_setup_payload.encrypt_log(&mut context, user_keys, user); // 7. We store the hiding points an logs in transients storage - Token::at(context.this_address())._store_payload_in_transient_storage_unsafe( - fee_payer_point_slot, - fee_payer_setup_payload.hiding_point, - fee_payer_setup_log - ).enqueue(&mut context); - Token::at(context.this_address())._store_payload_in_transient_storage_unsafe( - user_point_slot, - user_setup_payload.hiding_point, - user_setup_log - ).enqueue(&mut context); + Token::at(context.this_address()) + ._store_payload_in_transient_storage_unsafe( + fee_payer_point_slot, + fee_payer_setup_payload.hiding_point, + fee_payer_setup_log, + ) + .enqueue(&mut context); + Token::at(context.this_address()) + ._store_payload_in_transient_storage_unsafe( + user_point_slot, + user_setup_payload.hiding_point, + user_setup_log, + ) + .enqueue(&mut context); // 8. Set the public teardown function to `complete_refund(...)`. Public teardown is the only time when a public // function has access to the final transaction fee, which is needed to compute the actual refund amount. context.set_public_teardown_function( context.this_address(), - comptime { - FunctionSelector::from_signature("complete_refund(Field,Field,Field)") - }, - [fee_payer_point_slot, user_point_slot, funded_amount] + comptime { FunctionSelector::from_signature("complete_refund(Field,Field,Field)") }, + [fee_payer_point_slot, user_point_slot, funded_amount], ); } // docs:end:setup_refund @@ -604,12 +607,13 @@ contract Token { // as it is an entrypoint function. #[public] #[internal] - fn _store_payload_in_transient_storage_unsafe(slot: Field, point: Point, setup_log: [Field; 16]) { + fn _store_payload_in_transient_storage_unsafe( + slot: Field, + point: Point, + setup_log: [Field; 16], + ) { context.storage_write(slot, point); - context.storage_write( - slot + aztec::protocol_types::point::POINT_LENGTH as Field, - setup_log - ); + context.storage_write(slot + aztec::protocol_types::point::POINT_LENGTH as Field, setup_log); } // TODO(#7728): even though the funded_amount should be a U128, we can't have that type in a contract interface due @@ -631,8 +635,10 @@ contract Token { // 3. We construct the note finalization payloads with the correct amounts and hiding points to get the note // hashes and unencrypted logs. - let fee_payer_finalization_payload = TokenNote::finalization_payload().new(&mut context, fee_payer_slot, tx_fee); - let user_finalization_payload = TokenNote::finalization_payload().new(&mut context, user_slot, refund_amount); + let fee_payer_finalization_payload = + TokenNote::finalization_payload().new(&mut context, fee_payer_slot, tx_fee); + let user_finalization_payload = + TokenNote::finalization_payload().new(&mut context, user_slot, refund_amount); // 4. At last we emit the note hashes and the final note logs. fee_payer_finalization_payload.emit(); diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/meta/mod.nr b/noir-projects/noir-protocol-circuits/crates/types/src/meta/mod.nr index dc3aad75760e..7b3fa1022287 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/meta/mod.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/meta/mod.nr @@ -96,7 +96,7 @@ pub comptime fn flatten_to_fields(name: Quoted, typ: Type, omit: [Quoted]) -> ([ let mut fields = &[]; let mut aux_vars = &[]; - if omit.all(| to_omit | to_omit != name) { + if omit.all(|to_omit| to_omit != name) { if typ.is_field() { // For field we just add the value to fields fields = fields.push_back(name);