diff --git a/noir-projects/aztec-nr/authwit/src/cheatcodes.nr b/noir-projects/aztec-nr/authwit/src/cheatcodes.nr index 7b2192fefd2..8e1b3909044 100644 --- a/noir-projects/aztec-nr/authwit/src/cheatcodes.nr +++ b/noir-projects/aztec-nr/authwit/src/cheatcodes.nr @@ -47,7 +47,7 @@ where let inner_hash = compute_inner_authwit_hash([caller.to_field(), selector.to_field(), args_hash]); let message_hash = compute_authwit_message_hash(target, chain_id, version, inner_hash); - let mut context = PublicContext::new(|| { panic(f"Provide args hash manually") }); + let mut context = PublicContext::new(|| panic(f"Provide args hash manually")); context.args_hash = Option::some(args_hash); set_authorized(&mut context, message_hash, true); cheatcodes::set_contract_address(current_contract); diff --git a/noir-projects/aztec-nr/aztec/src/macros/dispatch/mod.nr b/noir-projects/aztec-nr/aztec/src/macros/dispatch/mod.nr index e2ac081fb88..200b743ede1 100644 --- a/noir-projects/aztec-nr/aztec/src/macros/dispatch/mod.nr +++ b/noir-projects/aztec-nr/aztec/src/macros/dispatch/mod.nr @@ -120,7 +120,7 @@ comptime fn size_in_fields(typ: Type) -> u32 { comptime fn array_size_in_fields(typ: Type) -> Option { typ.as_array().and_then(|typ: (Type, Type)| { let (typ, element_size) = typ; - element_size.as_constant().map(|x: u32| { x * size_in_fields(typ) }) + element_size.as_constant().map(|x: u32| x * size_in_fields(typ)) }) } diff --git a/noir-projects/aztec-nr/aztec/src/macros/functions/interfaces.nr b/noir-projects/aztec-nr/aztec/src/macros/functions/interfaces.nr index 720ca2179b8..f587c76aa11 100644 --- a/noir-projects/aztec-nr/aztec/src/macros/functions/interfaces.nr +++ b/noir-projects/aztec-nr/aztec/src/macros/functions/interfaces.nr @@ -14,7 +14,7 @@ comptime mut global STUBS: UHashMap Quoted { let name = f.name(); let mut parameters = - f.parameters().map(|(name, typ): (Quoted, Type)| { quote { $name: $typ } }).join(quote {,}); + f.parameters().map(|(name, typ): (Quoted, Type)| quote { $name: $typ }).join(quote {,}); let parameters_struct_name = f"{name}_parameters".quoted_contents(); let parameters = quote { @@ -97,7 +97,7 @@ pub comptime fn stub_fn(f: FunctionDefinition) -> Quoted { }; let fn_parameters_list = - fn_parameters.map(|(name, typ): (Quoted, Type)| { quote { $name: $typ } }).join(quote {,}); + fn_parameters.map(|(name, typ): (Quoted, Type)| quote { $name: $typ }).join(quote {,}); let fn_name_str = fn_name.as_str_quote(); 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 511cf4ec288..4c24f7f5920 100644 --- a/noir-projects/aztec-nr/aztec/src/macros/notes/mod.nr +++ b/noir-projects/aztec-nr/aztec/src/macros/notes/mod.nr @@ -201,7 +201,7 @@ comptime fn generate_note_properties(s: StructDefinition) -> Quoted { let non_header_fields = s.fields().filter(|(_, typ): (Quoted, Type)| typ != note_header_type); let properties_types = non_header_fields - .map(|(name, _): (Quoted, Type)| { quote { $name: $property_selector_type } }) + .map(|(name, _): (Quoted, Type)| quote { $name: $property_selector_type }) .join(quote {,}); // TODO #8694: Properly handle non-field types https://github.com/AztecProtocol/aztec-packages/issues/8694 diff --git a/noir-projects/aztec-nr/aztec/src/macros/utils.nr b/noir-projects/aztec-nr/aztec/src/macros/utils.nr index 7eb80d1c650..2f516e9ffd9 100644 --- a/noir-projects/aztec-nr/aztec/src/macros/utils.nr +++ b/noir-projects/aztec-nr/aztec/src/macros/utils.nr @@ -130,12 +130,12 @@ comptime fn signature_of_type(typ: Type) -> Quoted { } else if typ.as_struct().is_some() { let (s, _) = typ.as_struct().unwrap(); let field_signatures = - s.fields().map(|(_, typ): (Quoted, Type)| { signature_of_type(typ) }).join(quote {,}); + s.fields().map(|(_, typ): (Quoted, Type)| signature_of_type(typ)).join(quote {,}); f"({field_signatures})".quoted_contents() } else if typ.as_tuple().is_some() { // Note that tuples are handled the same way as structs let types = typ.as_tuple().unwrap(); - let field_signatures = types.map(|typ: Type| { signature_of_type(typ) }).join(quote {,}); + let field_signatures = types.map(|typ: Type| signature_of_type(typ)).join(quote {,}); f"({field_signatures})".quoted_contents() } else { panic(f"Unsupported type {typ}") @@ -179,7 +179,7 @@ pub(crate) comptime fn compute_fn_selector(f: FunctionDefinition) -> Field { // The signature will be "foo(Field,AztecAddress)". let fn_name = f.name(); let args_signatures = - f.parameters().map(|(_, typ): (Quoted, Type)| { signature_of_type(typ) }).join(quote {,}); + f.parameters().map(|(_, typ): (Quoted, Type)| signature_of_type(typ)).join(quote {,}); let signature_quote = quote { $fn_name($args_signatures) }; let signature_str_quote = signature_quote.as_str_quote(); diff --git a/noir-projects/aztec-nr/aztec/src/test/helpers/test_environment.nr b/noir-projects/aztec-nr/aztec/src/test/helpers/test_environment.nr index 4c87fb9eddf..2bf3b5ed989 100644 --- a/noir-projects/aztec-nr/aztec/src/test/helpers/test_environment.nr +++ b/noir-projects/aztec-nr/aztec/src/test/helpers/test_environment.nr @@ -48,7 +48,7 @@ impl TestEnvironment { } unconstrained fn public_with_args_hash(_self: Self, args: [Field]) -> PublicContext { - let mut context = PublicContext::new(|| { panic(f"Provide args hash manually") }); + let mut context = PublicContext::new(|| panic(f"Provide args hash manually")); context.args_hash = Option::some(hash_args(args)); context } diff --git a/noir-projects/aztec-nr/aztec/src/test/helpers/utils.nr b/noir-projects/aztec-nr/aztec/src/test/helpers/utils.nr index e8c9734a6e4..5b28a1a1253 100644 --- a/noir-projects/aztec-nr/aztec/src/test/helpers/utils.nr +++ b/noir-projects/aztec-nr/aztec/src/test/helpers/utils.nr @@ -72,7 +72,7 @@ impl Deployer { ); cheatcodes::advance_blocks_by(1); - let mut public_context = PublicContext::new(|| { panic(f"Provide args hash manually") }); + let mut public_context = PublicContext::new(|| panic(f"Provide args hash manually")); public_context .call_public_function( @@ -103,7 +103,7 @@ impl Deployer { ); cheatcodes::advance_blocks_by(1); - let mut public_context = PublicContext::new(|| { panic(f"Provide args hash manually") }); + let mut public_context = PublicContext::new(|| panic(f"Provide args hash manually")); let _: T = public_context .call_public_function( diff --git a/noir-projects/noir-contracts/contracts/card_game_contract/src/cards.nr b/noir-projects/noir-contracts/contracts/card_game_contract/src/cards.nr index e68d155be82..95d03fb377d 100644 --- a/noir-projects/noir-contracts/contracts/card_game_contract/src/cards.nr +++ b/noir-projects/noir-contracts/contracts/card_game_contract/src/cards.nr @@ -181,5 +181,5 @@ pub fn get_pack_cards( } pub fn compute_deck_strength(cards: [Card; N]) -> Field { - cards.fold(0, |acc, card: Card| { acc + card.strength as Field }) + cards.fold(0, |acc, card: Card| acc + card.strength as Field) } diff --git a/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr b/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr index fde9a5d7fca..caa1a107289 100644 --- a/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/docs_example_contract/src/main.nr @@ -73,7 +73,7 @@ contract DocsExample { profiles: Map::new( context, 4, - |context, slot| { PrivateMutable::new(context, slot) }, + |context, slot| PrivateMutable::new(context, slot), ), // docs:end:state_vars-MapPrivateMutable // docs:start:storage-set-init @@ -85,7 +85,7 @@ contract DocsExample { minters: Map::new( context, 8, - |context, slot| { PublicMutable::new(context, slot) }, + |context, slot| PublicMutable::new(context, slot), ), // docs:end:storage-minters-init // docs:start:storage-public-immutable diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/address/aztec_address.nr b/noir-projects/noir-protocol-circuits/crates/types/src/address/aztec_address.nr index d06edd2b70d..1697559f94e 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/address/aztec_address.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/address/aztec_address.nr @@ -1,16 +1,17 @@ use crate::{ abis::function_selector::FunctionSelector, - public_keys::{ToPoint, PublicKeys, NpkM, IvpkM, OvpkM, TpkM}, address::{ partial_address::PartialAddress, public_keys_hash::PublicKeysHash, salted_initialization_hash::SaltedInitializationHash, }, constants::{ - AZTEC_ADDRESS_LENGTH, FUNCTION_TREE_HEIGHT, GENERATOR_INDEX__PUBLIC_KEYS_HASH, - GENERATOR_INDEX__CONTRACT_ADDRESS_V1, MAX_FIELD_VALUE, - }, contract_class_id::ContractClassId, + AZTEC_ADDRESS_LENGTH, FUNCTION_TREE_HEIGHT, GENERATOR_INDEX__CONTRACT_ADDRESS_V1, + GENERATOR_INDEX__PUBLIC_KEYS_HASH, MAX_FIELD_VALUE, + }, + contract_class_id::ContractClassId, hash::{poseidon2_hash_with_separator, private_functions_root_from_siblings}, merkle_tree::membership::MembershipWitness, + public_keys::{IvpkM, NpkM, OvpkM, PublicKeys, ToPoint, TpkM}, traits::{Deserialize, Empty, FromField, Serialize, ToField}, utils, }; @@ -19,8 +20,8 @@ use crate::{ use dep::std::embedded_curve_ops::EmbeddedCurvePoint as Point; use std::{ - ec::{sqrt, pow}, - embedded_curve_ops::{fixed_base_scalar_mul as derive_public_key, EmbeddedCurveScalar}, + ec::{pow, sqrt}, + embedded_curve_ops::{EmbeddedCurveScalar, fixed_base_scalar_mul as derive_public_key}, }; // Aztec address diff --git a/noir/.rebuild_patterns_packages b/noir/.rebuild_patterns_packages index df6e13000bb..5603a4f8813 100644 --- a/noir/.rebuild_patterns_packages +++ b/noir/.rebuild_patterns_packages @@ -10,7 +10,6 @@ ^noir/noir-repo/noir_stdlib ^noir/noir-repo/tooling/noir_codegen ^noir/noir-repo/tooling/noir_js -^noir/noir-repo/tooling/noir_js_backend_barretenberg ^noir/noir-repo/tooling/noir_js_types ^noir/noir-repo/tooling/noirc_abi ^noir/noir-repo/tooling/noirc_abi_wasm diff --git a/noir/noir-repo/docs/docusaurus.config.ts b/noir/noir-repo/docs/docusaurus.config.ts index c7af7e494d1..c53d11e3373 100644 --- a/noir/noir-repo/docs/docusaurus.config.ts +++ b/noir/noir-repo/docs/docusaurus.config.ts @@ -181,37 +181,6 @@ export default { membersWithOwnFile: ['Interface', 'Class', 'TypeAlias', 'Function'], }, ], - [ - 'docusaurus-plugin-typedoc', - { - id: 'noir_js_backend_barretenberg', - entryPoints: ['../tooling/noir_js_backend_barretenberg/src/index.ts'], - tsconfig: '../tooling/noir_js_backend_barretenberg/tsconfig.json', - entryPointStrategy: 'resolve', - out: 'processed-docs/reference/NoirJS/backend_barretenberg', - plugin: ['typedoc-plugin-markdown'], - name: 'backend_barretenberg', - disableSources: true, - excludePrivate: true, - skipErrorChecking: true, - sidebar: { - filteredIds: ['reference/NoirJS/backend_barretenberg/index'], - }, - readme: 'none', - hidePageHeader: true, - hideBreadcrumbs: true, - hideInPageTOC: true, - useCodeBlocks: true, - typeDeclarationFormat: 'table', - propertiesFormat: 'table', - parametersFormat: 'table', - enumMembersFormat: 'table', - indexFormat: 'table', - outputFileStrategy: 'members', - memberPageTitle: '{name}', - membersWithOwnFile: ['Interface', 'Class', 'TypeAlias'], - }, - ], [ 'docusaurus-plugin-typedoc', { diff --git a/noir/scripts/sync-in-fixup.sh b/noir/scripts/sync-in-fixup.sh index 148fdd81a0a..1aa5bd9ff0a 100755 --- a/noir/scripts/sync-in-fixup.sh +++ b/noir/scripts/sync-in-fixup.sh @@ -4,7 +4,7 @@ set -eu cd $(dirname $0)/../noir-repo tmp=$(mktemp) -BACKEND_BARRETENBERG_PACKAGE_JSON=./tooling/noir_js_backend_barretenberg/package.json +BACKEND_BARRETENBERG_PACKAGE_JSON=./compiler/integration-tests/package.json jq -r '.dependencies."@aztec/bb.js"' $BACKEND_BARRETENBERG_PACKAGE_JSON > ../bb-version jq '.dependencies."@aztec/bb.js" = "portal:../../../../barretenberg/ts"' $BACKEND_BARRETENBERG_PACKAGE_JSON > $tmp && mv $tmp $BACKEND_BARRETENBERG_PACKAGE_JSON @@ -15,4 +15,4 @@ YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install # Remove requirement for `wasm-opt` to be installed sed -i "s/^require_command wasm-opt/#require_command wasm-opt/" ./tooling/noirc_abi_wasm/build.sh -sed -i "s/^require_command wasm-opt/#require_command wasm-opt/" ./acvm-repo/acvm_js/build.sh \ No newline at end of file +sed -i "s/^require_command wasm-opt/#require_command wasm-opt/" ./acvm-repo/acvm_js/build.sh diff --git a/noir/scripts/sync-out-fixup.sh b/noir/scripts/sync-out-fixup.sh index b6c519334cf..210e21d3698 100755 --- a/noir/scripts/sync-out-fixup.sh +++ b/noir/scripts/sync-out-fixup.sh @@ -6,7 +6,7 @@ cd $(dirname $0)/../noir-repo BB_VERSION=$(cat ../bb-version) tmp=$(mktemp) -BACKEND_BARRETENBERG_PACKAGE_JSON=./tooling/noir_js_backend_barretenberg/package.json +BACKEND_BARRETENBERG_PACKAGE_JSON=./compiler/integration-tests/package.json jq --arg v $BB_VERSION '.dependencies."@aztec/bb.js" = $v' $BACKEND_BARRETENBERG_PACKAGE_JSON > $tmp && mv $tmp $BACKEND_BARRETENBERG_PACKAGE_JSON # This script runs in CI which enforces immutable installs by default, @@ -15,4 +15,4 @@ YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install # Add requirement for `wasm-opt` to be installed sed -i "s/^#require_command wasm-opt/require_command wasm-opt/" ./tooling/noirc_abi_wasm/build.sh -sed -i "s/^#require_command wasm-opt/require_command wasm-opt/" ./acvm-repo/acvm_js/build.sh \ No newline at end of file +sed -i "s/^#require_command wasm-opt/require_command wasm-opt/" ./acvm-repo/acvm_js/build.sh