From 9ca9b94691cd63293b917567b34a37dcefb582c5 Mon Sep 17 00:00:00 2001 From: Tom French Date: Fri, 25 Oct 2024 10:09:55 +0100 Subject: [PATCH 1/4] chore: fix sync scripts --- noir/.rebuild_patterns_packages | 1 - noir/noir-repo/docs/docusaurus.config.ts | 31 ------------------------ noir/scripts/sync-in-fixup.sh | 4 +-- noir/scripts/sync-out-fixup.sh | 4 +-- 4 files changed, 4 insertions(+), 36 deletions(-) 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 From 771287728df3a6d1738639b150fa9dfdf59a970f Mon Sep 17 00:00:00 2001 From: Tom French Date: Fri, 25 Oct 2024 11:33:11 +0100 Subject: [PATCH 2/4] . --- .../aztec-nr/address-note/src/address_note.nr | 7 +-- noir-projects/aztec-nr/authwit/src/account.nr | 3 +- noir-projects/aztec-nr/authwit/src/auth.nr | 6 +-- .../aztec-nr/authwit/src/cheatcodes.nr | 6 +-- .../aztec-nr/authwit/src/entrypoint/app.nr | 3 +- .../aztec-nr/authwit/src/entrypoint/fee.nr | 3 +- .../aztec/src/context/private_context.nr | 31 ++++------- .../encrypted_event_emission.nr | 4 +- .../encrypted_logs/encrypted_note_emission.nr | 10 ++-- .../aztec/src/encrypted_logs/header.nr | 5 +- .../aztec/src/encrypted_logs/payload.nr | 13 ++--- noir-projects/aztec-nr/aztec/src/hash.nr | 6 +-- .../src/history/nullifier_non_inclusion.nr | 3 +- .../aztec/src/macros/functions/interfaces.nr | 3 +- .../aztec-nr/aztec/src/macros/notes/mod.nr | 3 +- .../aztec-nr/aztec/src/macros/storage/mod.nr | 3 +- noir-projects/aztec-nr/aztec/src/messaging.nr | 3 +- .../aztec-nr/aztec/src/note/lifecycle.nr | 3 +- .../aztec/src/note/note_getter/mod.nr | 3 +- .../aztec/src/note/note_getter/test.nr | 3 +- .../aztec-nr/aztec/src/note/utils.nr | 3 +- .../src/oracle/get_membership_witness.nr | 3 +- .../get_nullifier_membership_witness.nr | 3 +- .../aztec-nr/aztec/src/oracle/keys.nr | 3 +- noir-projects/aztec-nr/aztec/src/prelude.nr | 10 ++-- .../aztec/src/state_vars/private_immutable.nr | 7 +-- .../aztec/src/state_vars/private_mutable.nr | 6 +-- .../aztec/src/state_vars/private_set.nr | 9 ++-- .../aztec/src/state_vars/public_immutable.nr | 3 +- .../aztec/src/state_vars/shared_immutable.nr | 6 +-- .../shared_mutable/shared_mutable.nr | 9 ++-- .../src/state_vars/shared_mutable/test.nr | 3 +- .../src/test/helpers/test_environment.nr | 3 +- .../aztec-nr/aztec/src/test/helpers/utils.nr | 6 +-- .../aztec/src/test/mocks/mock_note.nr | 3 +- .../aztec-nr/uint-note/src/uint_note.nr | 4 +- .../aztec-nr/value-note/src/value_note.nr | 7 +-- .../src/dapp_payload.nr | 3 +- .../app_subscription_contract/src/main.nr | 3 +- .../src/subscription_note.nr | 7 +-- .../contracts/auth_contract/src/main.nr | 3 +- .../auth_registry_contract/src/main.nr | 3 +- .../avm_initializer_test_contract/src/main.nr | 3 +- .../contracts/avm_test_contract/src/main.nr | 4 +- .../contracts/card_game_contract/src/cards.nr | 12 ++--- .../contracts/child_contract/src/main.nr | 3 +- .../contracts/claim_contract/src/main.nr | 3 +- .../src/events/class_registered.nr | 4 +- .../events/private_function_broadcasted.nr | 4 +- .../unconstrained_function_broadcasted.nr | 4 +- .../src/main.nr | 3 +- .../src/main.nr | 13 ++--- .../crowdfunding_contract/src/main.nr | 11 ++-- .../src/types/card_note.nr | 4 +- .../ecdsa_k_account_contract/src/main.nr | 3 +- .../ecdsa_r_account_contract/src/main.nr | 3 +- .../contracts/lending_contract/src/main.nr | 3 +- .../contracts/nft_contract/src/main.nr | 14 ++--- .../src/test/transfer_to_private.nr | 4 +- .../contracts/nft_contract/src/test/utils.nr | 10 ++-- .../nft_contract/src/types/nft_note.nr | 9 ++-- .../schnorr_account_contract/src/main.nr | 9 ++-- .../src/public_key_note.nr | 4 +- .../src/main.nr | 3 +- .../src/auth_oracle.nr | 4 +- .../contracts/spam_contract/src/main.nr | 3 +- .../spam_contract/src/types/balance_set.nr | 3 +- .../spam_contract/src/types/token_note.nr | 7 +-- .../static_child_contract/src/main.nr | 3 +- .../contracts/test_contract/src/main.nr | 7 +-- .../contracts/test_contract/src/test_note.nr | 3 +- .../token_blacklist_contract/src/main.nr | 4 +- .../src/types/balances_map.nr | 3 +- .../src/types/token_note.nr | 7 +-- .../token_bridge_contract/src/main.nr | 3 +- .../contracts/token_contract/src/main.nr | 14 ++--- .../token_contract/src/test/utils.nr | 8 +-- .../token_contract/src/types/balance_set.nr | 6 +-- .../token_contract/src/types/token_note.nr | 6 +-- .../src/types/transparent_note.nr | 3 +- .../contracts/uniswap_contract/src/main.nr | 3 +- .../parity-lib/src/root/root_parity_input.nr | 6 +-- .../src/root/root_rollup_parity_input.nr | 6 +-- .../components/previous_kernel_validator.nr | 4 +- .../previous_kernel_validator_hints.nr | 4 +- .../components/private_call_data_validator.nr | 14 ++--- ...private_kernel_circuit_output_validator.nr | 8 +-- ...e_kernel_circuit_public_inputs_composer.nr | 9 +--- .../src/components/reset_output_composer.nr | 9 ++-- .../reset_output_hints.nr | 3 +- ...r_propagated_note_hash_indexes_for_logs.nr | 3 +- .../src/components/reset_output_validator.nr | 7 +-- .../src/components/tail_output_composer.nr | 6 +-- .../tail_output_composer/meter_gas_used.nr | 3 +- .../src/components/tail_output_validator.nr | 4 +- .../tail_to_public_output_composer.nr | 3 +- .../meter_gas_used.nr | 3 +- .../tail_to_public_output_validator.nr | 10 ++-- .../tail_to_public_output_hints.nr | 3 +- .../src/private_kernel_empty.nr | 9 ++-- .../src/private_kernel_init.nr | 3 +- .../src/private_kernel_inner.nr | 3 +- .../src/private_kernel_reset.nr | 16 ++---- .../src/private_kernel_tail.nr | 7 +-- .../src/private_kernel_tail_to_public.nr | 11 ++-- .../mod.nr | 4 +- .../mod.nr | 4 +- .../mod.nr | 4 +- .../reset_output_validator_builder/mod.nr | 3 +- .../meter_gas_used.nr | 3 +- .../tail_output_validator_builder/mod.nr | 3 +- .../meter_gas_used.nr | 3 +- .../tail_to_public_output_composer.nr | 5 +- .../src/main.nr | 3 +- .../crates/private-kernel-reset/src/main.nr | 3 +- .../enqueued_call_data_validator.nr | 4 +- .../public_kernel_output_composer.nr | 6 +-- .../public_kernel_output_validator.nr | 6 +-- .../components/public_tail_output_composer.nr | 4 +- .../combine_data.nr | 6 +-- .../generate_output_hints.nr | 7 +-- ...generate_overridable_public_data_writes.nr | 4 +- .../generate_public_data_leaves.nr | 3 +- .../public_tail_output_validator.nr | 8 +-- .../validate_linked_public_data_writes.nr | 4 +- .../validate_unique_leaf_slots.nr | 3 +- .../components/vm_circuit_output_composer.nr | 10 ++-- .../propagate_accumulated_data.nr | 3 +- .../src/public_kernel_merge.nr | 9 ++-- .../src/public_kernel_tail.nr | 33 ++++-------- .../src/note_hash_read_request_reset.nr | 8 +-- ...llifier_non_existent_read_request_reset.nr | 3 +- .../src/nullifier_read_request_reset.nr | 8 +-- .../private_validation_request_processor.nr | 6 +-- .../src/public_data_read_request_hints.nr | 3 +- .../public_validation_request_processor.nr | 7 +-- .../src/reset/mutable_data_read_request.nr | 13 ++--- .../src/reset/non_existent_read_request.nr | 3 +- .../src/reset/read_request.nr | 6 +-- .../src/reset/transient_data.nr | 6 +-- ...non_existent_read_request_hints_builder.nr | 4 +- .../base_or_merge_rollup_public_inputs.nr | 6 +-- ...block_root_or_block_merge_public_inputs.nr | 4 +- .../src/abis/constant_rollup_data.nr | 3 +- .../src/abis/previous_rollup_block_data.nr | 7 +-- .../src/abis/previous_rollup_data.nr | 7 +-- .../rollup-lib/src/base/base_rollup_inputs.nr | 34 ++++-------- .../rollup-lib/src/base/state_diff_hints.nr | 3 +- .../block_root/block_root_rollup_inputs.nr | 10 ++-- .../crates/rollup-lib/src/components.nr | 9 ++-- .../src/tests/block_root_rollup_inputs.nr | 3 +- .../combined_accumulated_data.nr | 7 +-- .../private_accumulated_data.nr | 10 ++-- .../private_accumulated_data_builder.nr | 10 ++-- .../public_accumulated_data.nr | 11 ++-- .../public_accumulated_data_builder.nr | 14 ++--- .../crates/types/src/abis/call_context.nr | 7 +-- .../crates/types/src/abis/function_data.nr | 3 +- .../crates/types/src/abis/gas.nr | 3 +- .../crates/types/src/abis/gas_settings.nr | 4 +- .../crates/types/src/abis/global_variables.nr | 6 +-- .../kernel_circuit_public_inputs.nr | 7 +-- .../private_kernel_circuit_public_inputs.nr | 7 +-- ...te_kernel_circuit_public_inputs_builder.nr | 4 +- .../public_kernel_circuit_public_inputs.nr | 7 +-- ...ic_kernel_circuit_public_inputs_builder.nr | 4 +- .../vm_circuit_public_inputs.nr | 12 ++--- .../crates/types/src/abis/kernel_data.nr | 6 +-- .../crates/types/src/abis/log_hash.nr | 7 +-- .../crates/types/src/abis/note_hash.nr | 6 +-- .../types/src/abis/note_hash_leaf_preimage.nr | 6 +-- .../crates/types/src/abis/nullifier.nr | 6 +-- .../types/src/abis/nullifier_leaf_preimage.nr | 6 +-- .../types/src/abis/private_call_request.nr | 3 +- .../src/abis/private_circuit_public_inputs.nr | 20 +++---- .../abis/private_kernel/private_call_data.nr | 3 +- .../types/src/abis/private_kernel_data.nr | 3 +- .../types/src/abis/public_call_request.nr | 6 +-- .../src/abis/public_circuit_public_inputs.nr | 12 ++--- .../crates/types/src/abis/public_data_read.nr | 4 +- .../src/abis/public_data_update_request.nr | 7 +-- .../types/src/abis/public_data_write.nr | 6 +-- .../src/abis/public_inner_call_request.nr | 3 +- .../types/src/abis/public_kernel_data.nr | 6 +-- .../crates/types/src/abis/read_request.nr | 6 +-- .../key_validation_request_and_generator.nr | 7 +-- .../private_validation_requests.nr | 4 +- .../private_validation_requests_builder.nr | 6 +-- .../public_validation_requests.nr | 4 +- .../public_validation_requests_builder.nr | 10 ++-- .../rollup_validation_requests.nr | 6 +-- ...ed_key_validation_request_and_generator.nr | 7 +-- .../crates/types/src/address/aztec_address.nr | 3 +- .../types/src/address/partial_address.nr | 6 +-- .../crates/types/src/contract_instance.nr | 7 +-- .../src/contrakt/storage_update_request.nr | 3 +- .../crates/types/src/data/public_data_hint.nr | 3 +- .../types/src/data/public_data_tree_leaf.nr | 3 +- .../crates/types/src/hash.nr | 12 ++--- .../crates/types/src/header.nr | 7 +-- .../types/src/merkle_tree/indexed_tree.nr | 4 +- .../types/src/merkle_tree/membership.nr | 6 +-- .../types/src/messaging/l2_to_l1_message.nr | 6 +-- .../types/src/partial_state_reference.nr | 3 +- .../crates/types/src/public_keys.nr | 4 +- .../types/src/recursion/verification_key.nr | 3 +- .../crates/types/src/state_reference.nr | 3 +- .../crates/types/src/tests/fixture_builder.nr | 54 ++++++------------- .../types/src/tests/fixtures/contracts.nr | 6 +-- .../types/src/tests/merkle_tree_utils.nr | 3 +- .../types/src/transaction/tx_context.nr | 6 +-- .../types/src/transaction/tx_request.nr | 13 ++--- .../src/utils/arrays/assert_array_appended.nr | 4 +- ...combined_sorted_transformed_value_array.nr | 9 ++-- .../get_combined_order_hints.nr | 3 +- .../src/utils/arrays/assert_deduped_array.nr | 6 +-- ..._exposed_sorted_transformed_value_array.nr | 3 +- .../get_order_hints.nr | 3 +- ...t_split_sorted_transformed_value_arrays.nr | 3 +- .../get_split_order_hints.nr | 3 +- 220 files changed, 415 insertions(+), 947 deletions(-) diff --git a/noir-projects/aztec-nr/address-note/src/address_note.nr b/noir-projects/aztec-nr/address-note/src/address_note.nr index a1207e21603..a1202c46fe6 100644 --- a/noir-projects/aztec-nr/address-note/src/address_note.nr +++ b/noir-projects/aztec-nr/address-note/src/address_note.nr @@ -1,12 +1,9 @@ use dep::aztec::{ - context::PrivateContext, - keys::getters::get_nsk_app, - macros::notes::note, + context::PrivateContext, keys::getters::get_nsk_app, macros::notes::note, note::{ note_header::NoteHeader, note_interface::NullifiableNote, utils::compute_note_hash_for_nullify, - }, - oracle::random::random, + }, oracle::random::random, protocol_types::{ address::AztecAddress, constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, diff --git a/noir-projects/aztec-nr/authwit/src/account.nr b/noir-projects/aztec-nr/authwit/src/account.nr index 93c8ce72666..d9f6f49f74d 100644 --- a/noir-projects/aztec-nr/authwit/src/account.nr +++ b/noir-projects/aztec-nr/authwit/src/account.nr @@ -1,6 +1,5 @@ use dep::aztec::{ - context::PrivateContext, - hash::poseidon2_hash_with_separator, + context::PrivateContext, hash::poseidon2_hash_with_separator, protocol_types::constants::{GENERATOR_INDEX__COMBINED_PAYLOAD, GENERATOR_INDEX__TX_NULLIFIER}, }; diff --git a/noir-projects/aztec-nr/authwit/src/auth.nr b/noir-projects/aztec-nr/authwit/src/auth.nr index a3f15076f98..a4ff281cb6d 100644 --- a/noir-projects/aztec-nr/authwit/src/auth.nr +++ b/noir-projects/aztec-nr/authwit/src/auth.nr @@ -1,12 +1,10 @@ use dep::aztec::{context::{gas::GasOpts, PrivateContext, PublicContext}, hash::hash_args_array}; use dep::aztec::protocol_types::{ - abis::function_selector::FunctionSelector, - address::AztecAddress, + abis::function_selector::FunctionSelector, address::AztecAddress, constants::{ CANONICAL_AUTH_REGISTRY_ADDRESS, GENERATOR_INDEX__AUTHWIT_INNER, GENERATOR_INDEX__AUTHWIT_NULLIFIER, GENERATOR_INDEX__AUTHWIT_OUTER, - }, - hash::poseidon2_hash_with_separator, + }, hash::poseidon2_hash_with_separator, }; /** diff --git a/noir-projects/aztec-nr/authwit/src/cheatcodes.nr b/noir-projects/aztec-nr/authwit/src/cheatcodes.nr index 7b2192fefd2..5fbd1875d26 100644 --- a/noir-projects/aztec-nr/authwit/src/cheatcodes.nr +++ b/noir-projects/aztec-nr/authwit/src/cheatcodes.nr @@ -1,9 +1,7 @@ use dep::aztec::{ - context::{call_interfaces::CallInterface, public_context::PublicContext}, - hash::hash_args, + context::{call_interfaces::CallInterface, public_context::PublicContext}, hash::hash_args, oracle::execution::{get_block_number, get_contract_address}, - protocol_types::address::AztecAddress, - test::helpers::cheatcodes, + protocol_types::address::AztecAddress, test::helpers::cheatcodes, }; use crate::auth::{compute_authwit_message_hash, compute_inner_authwit_hash, set_authorized}; diff --git a/noir-projects/aztec-nr/authwit/src/entrypoint/app.nr b/noir-projects/aztec-nr/authwit/src/entrypoint/app.nr index 3b1c1be2b53..1aac89e567f 100644 --- a/noir-projects/aztec-nr/authwit/src/entrypoint/app.nr +++ b/noir-projects/aztec-nr/authwit/src/entrypoint/app.nr @@ -1,7 +1,6 @@ use dep::aztec::prelude::PrivateContext; use dep::aztec::protocol_types::{ - constants::GENERATOR_INDEX__SIGNATURE_PAYLOAD, - hash::poseidon2_hash_with_separator, + constants::GENERATOR_INDEX__SIGNATURE_PAYLOAD, hash::poseidon2_hash_with_separator, traits::{Hash, Serialize}, }; diff --git a/noir-projects/aztec-nr/authwit/src/entrypoint/fee.nr b/noir-projects/aztec-nr/authwit/src/entrypoint/fee.nr index 2adddbff69b..f2e1d4748c7 100644 --- a/noir-projects/aztec-nr/authwit/src/entrypoint/fee.nr +++ b/noir-projects/aztec-nr/authwit/src/entrypoint/fee.nr @@ -1,8 +1,7 @@ use crate::entrypoint::function_call::FunctionCall; use dep::aztec::prelude::PrivateContext; use dep::aztec::protocol_types::{ - constants::GENERATOR_INDEX__FEE_PAYLOAD, - hash::poseidon2_hash_with_separator, + constants::GENERATOR_INDEX__FEE_PAYLOAD, hash::poseidon2_hash_with_separator, traits::{Hash, Serialize}, }; diff --git a/noir-projects/aztec-nr/aztec/src/context/private_context.nr b/noir-projects/aztec-nr/aztec/src/context/private_context.nr index 1465b61e8c6..b073ce989e1 100644 --- a/noir-projects/aztec-nr/aztec/src/context/private_context.nr +++ b/noir-projects/aztec-nr/aztec/src/context/private_context.nr @@ -4,33 +4,23 @@ use crate::{ keys::constants::{NULLIFIER_INDEX, NUM_KEY_TYPES, OUTGOING_INDEX, sk_generators}, messaging::process_l1_to_l2_message, oracle::{ - arguments, - call_private_function::call_private_function_internal, + arguments, call_private_function::call_private_function_internal, enqueue_public_function_call::{ enqueue_public_function_call_internal, notify_set_min_revertible_side_effect_counter, set_public_teardown_function_call_internal, - }, - header::get_header_at, - key_validation_request::get_key_validation_request, - logs::{emit_encrypted_event_log, emit_encrypted_note_log}, - returns::pack_returns, + }, header::get_header_at, key_validation_request::get_key_validation_request, + logs::{emit_encrypted_event_log, emit_encrypted_note_log}, returns::pack_returns, }, }; use dep::protocol_types::{ abis::{ - call_context::CallContext, - function_selector::FunctionSelector, - log_hash::{EncryptedLogHash, LogHash, NoteLogHash}, - max_block_number::MaxBlockNumber, - note_hash::NoteHash, - nullifier::Nullifier, - private_call_request::PrivateCallRequest, + call_context::CallContext, function_selector::FunctionSelector, + log_hash::{EncryptedLogHash, LogHash, NoteLogHash}, max_block_number::MaxBlockNumber, + note_hash::NoteHash, nullifier::Nullifier, private_call_request::PrivateCallRequest, private_circuit_public_inputs::PrivateCircuitPublicInputs, - public_call_request::PublicCallRequest, - read_request::ReadRequest, + public_call_request::PublicCallRequest, read_request::ReadRequest, validation_requests::{KeyValidationRequest, KeyValidationRequestAndGenerator}, - }, - address::{AztecAddress, EthAddress}, + }, address::{AztecAddress, EthAddress}, constants::{ MAX_ENCRYPTED_LOGS_PER_CALL, MAX_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_L2_TO_L1_MSGS_PER_CALL, MAX_NOTE_ENCRYPTED_LOGS_PER_CALL, @@ -38,10 +28,7 @@ use dep::protocol_types::{ MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIERS_PER_CALL, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, MAX_UNENCRYPTED_LOGS_PER_CALL, PUBLIC_DISPATCH_SELECTOR, - }, - header::Header, - messaging::l2_to_l1_message::L2ToL1Message, - traits::Empty, + }, header::Header, messaging::l2_to_l1_message::L2ToL1Message, traits::Empty, }; // When finished, one can call .finish() to convert back to the abi 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 5cccd74799b..fd1d4ce2d8c 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 @@ -3,9 +3,7 @@ use crate::{ event::event_interface::EventInterface, keys::getters::get_ovsk_app, oracle::random::random, }; use dep::protocol_types::{ - address::AztecAddress, - hash::sha256_to_field, - public_keys::{IvpkM, OvpkM}, + address::AztecAddress, hash::sha256_to_field, public_keys::{IvpkM, OvpkM}, }; fn compute_raw_event_log( 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 5239418d7b9..76a35bc70be 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,13 +1,9 @@ use crate::{ - context::PrivateContext, - encrypted_logs::payload::compute_encrypted_log, - keys::getters::get_ovsk_app, - note::{note_emission::NoteEmission, note_interface::NoteInterface}, + context::PrivateContext, encrypted_logs::payload::compute_encrypted_log, + keys::getters::get_ovsk_app, note::{note_emission::NoteEmission, note_interface::NoteInterface}, }; use dep::protocol_types::{ - abis::note_hash::NoteHash, - address::AztecAddress, - hash::sha256_to_field, + abis::note_hash::NoteHash, address::AztecAddress, hash::sha256_to_field, public_keys::{IvpkM, OvpkM, PublicKeys}, }; diff --git a/noir-projects/aztec-nr/aztec/src/encrypted_logs/header.nr b/noir-projects/aztec-nr/aztec/src/encrypted_logs/header.nr index 54850470e1c..36c522766a2 100644 --- a/noir-projects/aztec-nr/aztec/src/encrypted_logs/header.nr +++ b/noir-projects/aztec-nr/aztec/src/encrypted_logs/header.nr @@ -1,8 +1,5 @@ use dep::protocol_types::{ - address::AztecAddress, - point::Point, - public_keys::{IvpkM, PublicKeys, ToPoint}, - scalar::Scalar, + address::AztecAddress, point::Point, public_keys::{IvpkM, PublicKeys, ToPoint}, scalar::Scalar, }; use crate::keys::point_to_symmetric_key::point_to_symmetric_key; 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 9831127a58c..725fffc5ce8 100644 --- a/noir-projects/aztec-nr/aztec/src/encrypted_logs/payload.nr +++ b/noir-projects/aztec-nr/aztec/src/encrypted_logs/payload.nr @@ -1,10 +1,6 @@ use dep::protocol_types::{ - address::AztecAddress, - constants::GENERATOR_INDEX__SYMMETRIC_KEY, - hash::poseidon2_hash_with_separator, - point::Point, - public_keys::{IvpkM, OvpkM}, - scalar::Scalar, + address::AztecAddress, constants::GENERATOR_INDEX__SYMMETRIC_KEY, + hash::poseidon2_hash_with_separator, point::Point, public_keys::{IvpkM, OvpkM}, scalar::Scalar, }; use std::{ aes128::aes128_encrypt, embedded_curve_ops::fixed_base_scalar_mul as derive_public_key, @@ -163,10 +159,7 @@ mod test { compute_encrypted_log, compute_incoming_body_ciphertext, compute_outgoing_body_ciphertext, }; use dep::protocol_types::{ - address::AztecAddress, - point::Point, - public_keys::{IvpkM, OvpkM}, - scalar::Scalar, + address::AztecAddress, point::Point, public_keys::{IvpkM, OvpkM}, scalar::Scalar, }; use std::embedded_curve_ops::fixed_base_scalar_mul as derive_public_key; use std::test::OracleMock; diff --git a/noir-projects/aztec-nr/aztec/src/hash.nr b/noir-projects/aztec-nr/aztec/src/hash.nr index 4e5b9111463..ba0b9943517 100644 --- a/noir-projects/aztec-nr/aztec/src/hash.nr +++ b/noir-projects/aztec-nr/aztec/src/hash.nr @@ -4,10 +4,8 @@ use dep::protocol_types::{ constants::{ GENERATOR_INDEX__FUNCTION_ARGS, GENERATOR_INDEX__MESSAGE_NULLIFIER, GENERATOR_INDEX__SECRET_HASH, - }, - hash::{poseidon2_hash_with_separator, poseidon2_hash_with_separator_slice, sha256_to_field}, - point::Point, - traits::Hash, + }, hash::{poseidon2_hash_with_separator, poseidon2_hash_with_separator_slice, sha256_to_field}, + point::Point, traits::Hash, }; pub use dep::protocol_types::hash::{compute_siloed_nullifier, pedersen_hash}; diff --git a/noir-projects/aztec-nr/aztec/src/history/nullifier_non_inclusion.nr b/noir-projects/aztec-nr/aztec/src/history/nullifier_non_inclusion.nr index 95a43086b2b..31f1e63f006 100644 --- a/noir-projects/aztec-nr/aztec/src/history/nullifier_non_inclusion.nr +++ b/noir-projects/aztec-nr/aztec/src/history/nullifier_non_inclusion.nr @@ -4,8 +4,7 @@ use crate::{ oracle::get_nullifier_membership_witness::get_low_nullifier_membership_witness, }; use dep::protocol_types::{ - header::Header, - utils::field::{full_field_greater_than, full_field_less_than}, + header::Header, utils::field::{full_field_greater_than, full_field_less_than}, }; use dep::protocol_types::merkle_tree::root::root_from_sibling_path; 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..328c218926b 100644 --- a/noir-projects/aztec-nr/aztec/src/macros/functions/interfaces.nr +++ b/noir-projects/aztec-nr/aztec/src/macros/functions/interfaces.nr @@ -3,8 +3,7 @@ use crate::macros::utils::{ is_fn_view, }; use std::{ - collections::umap::UHashMap, - hash::{BuildHasherDefault, poseidon2::Poseidon2Hasher}, + collections::umap::UHashMap, hash::{BuildHasherDefault, poseidon2::Poseidon2Hasher}, meta::{type_of, unquote}, }; 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..0e327112135 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,7 @@ use crate::note::{note_getter_options::PropertySelector, note_header::NoteHeader}; use protocol_types::meta::{flatten_to_fields, pack_from_fields}; use std::{ - collections::umap::UHashMap, - hash::{BuildHasherDefault, poseidon2::Poseidon2Hasher}, + collections::umap::UHashMap, hash::{BuildHasherDefault, poseidon2::Poseidon2Hasher}, meta::{typ::fresh_type_variable, type_of, unquote}, }; diff --git a/noir-projects/aztec-nr/aztec/src/macros/storage/mod.nr b/noir-projects/aztec-nr/aztec/src/macros/storage/mod.nr index 5d1e27c7a49..c9535db0716 100644 --- a/noir-projects/aztec-nr/aztec/src/macros/storage/mod.nr +++ b/noir-projects/aztec-nr/aztec/src/macros/storage/mod.nr @@ -1,6 +1,5 @@ use std::{ - collections::umap::UHashMap, - hash::{BuildHasherDefault, poseidon2::Poseidon2Hasher}, + collections::umap::UHashMap, hash::{BuildHasherDefault, poseidon2::Poseidon2Hasher}, meta::unquote, }; diff --git a/noir-projects/aztec-nr/aztec/src/messaging.nr b/noir-projects/aztec-nr/aztec/src/messaging.nr index 6679fe0671e..6353ce6d4fd 100644 --- a/noir-projects/aztec-nr/aztec/src/messaging.nr +++ b/noir-projects/aztec-nr/aztec/src/messaging.nr @@ -4,8 +4,7 @@ use crate::{ }; use dep::protocol_types::{ - address::{AztecAddress, EthAddress}, - merkle_tree::root::root_from_sibling_path, + address::{AztecAddress, EthAddress}, merkle_tree::root::root_from_sibling_path, }; pub fn process_l1_to_l2_message( diff --git a/noir-projects/aztec-nr/aztec/src/note/lifecycle.nr b/noir-projects/aztec-nr/aztec/src/note/lifecycle.nr index d07e61e8b6b..ca5f5a78be6 100644 --- a/noir-projects/aztec-nr/aztec/src/note/lifecycle.nr +++ b/noir-projects/aztec-nr/aztec/src/note/lifecycle.nr @@ -1,7 +1,6 @@ use crate::context::{PrivateContext, PublicContext}; use crate::note::{ - note_emission::NoteEmission, - note_header::NoteHeader, + note_emission::NoteEmission, note_header::NoteHeader, note_interface::{NoteInterface, NullifiableNote}, utils::{compute_note_hash_for_nullify_internal, compute_note_hash_for_read_request}, }; diff --git a/noir-projects/aztec-nr/aztec/src/note/note_getter/mod.nr b/noir-projects/aztec-nr/aztec/src/note/note_getter/mod.nr index 52e8a14b64b..597176bd132 100644 --- a/noir-projects/aztec-nr/aztec/src/note/note_getter/mod.nr +++ b/noir-projects/aztec-nr/aztec/src/note/note_getter/mod.nr @@ -2,8 +2,7 @@ use crate::context::PrivateContext; use crate::note::{ constants::{GET_NOTE_ORACLE_RETURN_LENGTH, VIEW_NOTE_ORACLE_RETURN_LENGTH}, note_getter_options::{NoteGetterOptions, NoteStatus, PropertySelector, Select, Sort, SortOrder}, - note_interface::{NoteInterface, NullifiableNote}, - note_viewer_options::NoteViewerOptions, + note_interface::{NoteInterface, NullifiableNote}, note_viewer_options::NoteViewerOptions, utils::compute_note_hash_for_read_request, }; use crate::oracle; diff --git a/noir-projects/aztec-nr/aztec/src/note/note_getter/test.nr b/noir-projects/aztec-nr/aztec/src/note/note_getter/test.nr index 48728210d4b..6e805ef07f4 100644 --- a/noir-projects/aztec-nr/aztec/src/note/note_getter/test.nr +++ b/noir-projects/aztec-nr/aztec/src/note/note_getter/test.nr @@ -2,8 +2,7 @@ use crate::{ note::{ note_getter::constrain_get_notes_internal, note_getter_options::{NoteGetterOptions, PropertySelector, SortOrder}, - }, - oracle::execution::get_contract_address, + }, oracle::execution::get_contract_address, }; use dep::protocol_types::constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL; diff --git a/noir-projects/aztec-nr/aztec/src/note/utils.nr b/noir-projects/aztec-nr/aztec/src/note/utils.nr index 6f3031f0384..59e805cd06f 100644 --- a/noir-projects/aztec-nr/aztec/src/note/utils.nr +++ b/noir-projects/aztec-nr/aztec/src/note/utils.nr @@ -8,8 +8,7 @@ use dep::protocol_types::{ compute_siloed_note_hash as compute_siloed_note_hash, compute_siloed_nullifier as compute_siloed_nullifier_from_preimage, compute_unique_note_hash, - }, - utils::arr_copy_slice, + }, utils::arr_copy_slice, }; pub fn compute_siloed_nullifier( diff --git a/noir-projects/aztec-nr/aztec/src/oracle/get_membership_witness.nr b/noir-projects/aztec-nr/aztec/src/oracle/get_membership_witness.nr index fed4c3b66b7..3987fab937a 100644 --- a/noir-projects/aztec-nr/aztec/src/oracle/get_membership_witness.nr +++ b/noir-projects/aztec-nr/aztec/src/oracle/get_membership_witness.nr @@ -1,6 +1,5 @@ use dep::protocol_types::{ - constants::{ARCHIVE_HEIGHT, NOTE_HASH_TREE_HEIGHT}, - utils::arr_copy_slice, + constants::{ARCHIVE_HEIGHT, NOTE_HASH_TREE_HEIGHT}, utils::arr_copy_slice, }; global NOTE_HASH_TREE_ID = 1; diff --git a/noir-projects/aztec-nr/aztec/src/oracle/get_nullifier_membership_witness.nr b/noir-projects/aztec-nr/aztec/src/oracle/get_nullifier_membership_witness.nr index bfdf6a6d759..00805d190a7 100644 --- a/noir-projects/aztec-nr/aztec/src/oracle/get_nullifier_membership_witness.nr +++ b/noir-projects/aztec-nr/aztec/src/oracle/get_nullifier_membership_witness.nr @@ -1,7 +1,6 @@ use dep::protocol_types::{ abis::nullifier_leaf_preimage::{NULLIFIER_LEAF_PREIMAGE_LENGTH, NullifierLeafPreimage}, - constants::NULLIFIER_TREE_HEIGHT, - utils::arr_copy_slice, + constants::NULLIFIER_TREE_HEIGHT, utils::arr_copy_slice, }; // INDEX_LENGTH + NULLIFIER_LEAF_PREIMAGE_LENGTH + NULLIFIER_TREE_HEIGHT diff --git a/noir-projects/aztec-nr/aztec/src/oracle/keys.nr b/noir-projects/aztec-nr/aztec/src/oracle/keys.nr index f29c0e8b2f7..84646ab2595 100644 --- a/noir-projects/aztec-nr/aztec/src/oracle/keys.nr +++ b/noir-projects/aztec-nr/aztec/src/oracle/keys.nr @@ -1,6 +1,5 @@ use dep::protocol_types::{ - address::{AztecAddress, PartialAddress}, - point::Point, + address::{AztecAddress, PartialAddress}, point::Point, public_keys::{IvpkM, NpkM, OvpkM, PublicKeys, TpkM}, }; diff --git a/noir-projects/aztec-nr/aztec/src/prelude.nr b/noir-projects/aztec-nr/aztec/src/prelude.nr index 04dee82bf14..ba2f4d10655 100644 --- a/noir-projects/aztec-nr/aztec/src/prelude.nr +++ b/noir-projects/aztec-nr/aztec/src/prelude.nr @@ -2,10 +2,8 @@ pub use crate::{ context::{FunctionReturns, PackedReturns, PrivateContext, PublicContext}, note::{ - note_getter_options::NoteGetterOptions, - note_header::NoteHeader, - note_interface::{NoteInterface, NullifiableNote}, - note_viewer_options::NoteViewerOptions, + note_getter_options::NoteGetterOptions, note_header::NoteHeader, + note_interface::{NoteInterface, NullifiableNote}, note_viewer_options::NoteViewerOptions, utils::compute_note_hash_and_optionally_a_nullifier as utils_compute_note_hash_and_optionally_a_nullifier, }, state_vars::{ @@ -15,9 +13,7 @@ pub use crate::{ }, }; pub use dep::protocol_types::{ - abis::function_selector::FunctionSelector, - address::{AztecAddress, EthAddress}, - point::Point, + abis::function_selector::FunctionSelector, address::{AztecAddress, EthAddress}, point::Point, traits::{Deserialize, Serialize}, }; // docs:end:prelude diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/private_immutable.nr b/noir-projects/aztec-nr/aztec/src/state_vars/private_immutable.nr index 81bb6e42e6f..1f111b5a6e3 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/private_immutable.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/private_immutable.nr @@ -4,11 +4,8 @@ use dep::protocol_types::{ use crate::context::{PrivateContext, UnconstrainedContext}; use crate::note::{ - lifecycle::create_note, - note_emission::NoteEmission, - note_getter::{get_note, view_notes}, - note_interface::{NoteInterface, NullifiableNote}, - note_viewer_options::NoteViewerOptions, + lifecycle::create_note, note_emission::NoteEmission, note_getter::{get_note, view_notes}, + note_interface::{NoteInterface, NullifiableNote}, note_viewer_options::NoteViewerOptions, }; use crate::oracle::notes::check_nullifier_exists; use crate::state_vars::storage::Storage; diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/private_mutable.nr b/noir-projects/aztec-nr/aztec/src/state_vars/private_mutable.nr index 7b144d1302a..55c7b10ccec 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/private_mutable.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/private_mutable.nr @@ -4,10 +4,8 @@ use dep::protocol_types::{ use crate::context::{PrivateContext, UnconstrainedContext}; use crate::note::{ - lifecycle::{create_note, destroy_note_unsafe}, - note_emission::NoteEmission, - note_getter::{get_note, view_notes}, - note_interface::{NoteInterface, NullifiableNote}, + lifecycle::{create_note, destroy_note_unsafe}, note_emission::NoteEmission, + note_getter::{get_note, view_notes}, note_interface::{NoteInterface, NullifiableNote}, note_viewer_options::NoteViewerOptions, }; use crate::oracle::notes::check_nullifier_exists; diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/private_set.nr b/noir-projects/aztec-nr/aztec/src/state_vars/private_set.nr index b63638fc33f..a46d8a6f0db 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/private_set.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/private_set.nr @@ -2,12 +2,9 @@ use crate::context::{PrivateContext, PublicContext, UnconstrainedContext}; use crate::note::{ constants::MAX_NOTES_PER_PAGE, lifecycle::{create_note, create_note_hash_from_public, destroy_note_unsafe}, - note_emission::NoteEmission, - note_getter::{get_notes, view_notes}, - note_getter_options::NoteGetterOptions, - note_interface::{NoteInterface, NullifiableNote}, - note_viewer_options::NoteViewerOptions, - utils::compute_note_hash_for_read_request, + note_emission::NoteEmission, note_getter::{get_notes, view_notes}, + note_getter_options::NoteGetterOptions, note_interface::{NoteInterface, NullifiableNote}, + note_viewer_options::NoteViewerOptions, utils::compute_note_hash_for_read_request, }; use crate::state_vars::storage::Storage; use dep::protocol_types::{ diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/public_immutable.nr b/noir-projects/aztec-nr/aztec/src/state_vars/public_immutable.nr index 1e9afe1de55..4fac882d8a9 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/public_immutable.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/public_immutable.nr @@ -1,7 +1,6 @@ use crate::{context::{PublicContext, UnconstrainedContext}, state_vars::storage::Storage}; use dep::protocol_types::{ - constants::INITIALIZATION_SLOT_SEPARATOR, - traits::{Deserialize, Serialize}, + constants::INITIALIZATION_SLOT_SEPARATOR, traits::{Deserialize, Serialize}, }; // Just like SharedImmutable but without the ability to read from private functions. diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/shared_immutable.nr b/noir-projects/aztec-nr/aztec/src/state_vars/shared_immutable.nr index 00add0afb26..8c6f3ecb9ab 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/shared_immutable.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/shared_immutable.nr @@ -1,10 +1,8 @@ use crate::{ - context::{PrivateContext, PublicContext, UnconstrainedContext}, - state_vars::storage::Storage, + context::{PrivateContext, PublicContext, UnconstrainedContext}, state_vars::storage::Storage, }; use dep::protocol_types::{ - constants::INITIALIZATION_SLOT_SEPARATOR, - traits::{Deserialize, Serialize}, + constants::INITIALIZATION_SLOT_SEPARATOR, traits::{Deserialize, Serialize}, }; // Just like PublicImmutable but with the ability to read from private functions. diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/shared_mutable.nr b/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/shared_mutable.nr index 0a499c40c70..69bdb6f7fe7 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/shared_mutable.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/shared_mutable.nr @@ -1,8 +1,6 @@ use dep::protocol_types::{ - address::AztecAddress, - hash::{poseidon2_hash, poseidon2_hash_with_separator}, - traits::{FromField, ToField}, - utils::arrays::array_concat, + address::AztecAddress, hash::{poseidon2_hash, poseidon2_hash_with_separator}, + traits::{FromField, ToField}, utils::arrays::array_concat, }; use crate::context::{PrivateContext, PublicContext, UnconstrainedContext}; @@ -10,8 +8,7 @@ use crate::oracle::storage::storage_read; use crate::state_vars::{ shared_mutable::{ scheduled_delay_change::ScheduledDelayChange, scheduled_value_change::ScheduledValueChange, - }, - storage::Storage, + }, storage::Storage, }; use dep::std::mem::zeroed; diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/test.nr b/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/test.nr index cdf5414ec83..22ce91f389c 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/test.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/test.nr @@ -3,8 +3,7 @@ use crate::{ state_vars::shared_mutable::{ scheduled_delay_change::ScheduledDelayChange, scheduled_value_change::ScheduledValueChange, shared_mutable::SharedMutable, - }, - test::helpers::test_environment::TestEnvironment, + }, test::helpers::test_environment::TestEnvironment, }; use dep::std::{mem::zeroed, test::OracleMock}; 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..4c322d77592 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 @@ -9,8 +9,7 @@ use crate::test::helpers::{cheatcodes, utils::Deployer}; use crate::note::{note_header::NoteHeader, note_interface::{NoteInterface, NullifiableNote}}; use crate::oracle::{ - execution::{get_block_number, get_contract_address}, - notes::notify_created_note, + execution::{get_block_number, get_contract_address}, notes::notify_created_note, }; use protocol_types::constants::PUBLIC_DISPATCH_SELECTOR; 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..e4518510b38 100644 --- a/noir-projects/aztec-nr/aztec/src/test/helpers/utils.nr +++ b/noir-projects/aztec-nr/aztec/src/test/helpers/utils.nr @@ -1,8 +1,6 @@ use dep::protocol_types::{ - abis::function_selector::FunctionSelector, - address::AztecAddress, - contract_instance::ContractInstance, - public_keys::{PUBLIC_KEYS_LENGTH, PublicKeys}, + abis::function_selector::FunctionSelector, address::AztecAddress, + contract_instance::ContractInstance, public_keys::{PUBLIC_KEYS_LENGTH, PublicKeys}, traits::{Deserialize, Serialize}, }; diff --git a/noir-projects/aztec-nr/aztec/src/test/mocks/mock_note.nr b/noir-projects/aztec-nr/aztec/src/test/mocks/mock_note.nr index 299204688a0..2ec80c7fc5d 100644 --- a/noir-projects/aztec-nr/aztec/src/test/mocks/mock_note.nr +++ b/noir-projects/aztec-nr/aztec/src/test/mocks/mock_note.nr @@ -1,6 +1,5 @@ use crate::{ - context::PrivateContext, - generators::Ga1 as G_val, + context::PrivateContext, generators::Ga1 as G_val, note::{ note_header::NoteHeader, note_interface::NoteInterface, utils::compute_note_hash_for_nullify, diff --git a/noir-projects/aztec-nr/uint-note/src/uint_note.nr b/noir-projects/aztec-nr/uint-note/src/uint_note.nr index 44ab33c7201..2a28cc9687c 100644 --- a/noir-projects/aztec-nr/uint-note/src/uint_note.nr +++ b/noir-projects/aztec-nr/uint-note/src/uint_note.nr @@ -1,7 +1,5 @@ use dep::aztec::{ - keys::getters::get_nsk_app, - macros::notes::note, - note::utils::compute_note_hash_for_nullify, + keys::getters::get_nsk_app, macros::notes::note, note::utils::compute_note_hash_for_nullify, prelude::{NullifiableNote, PrivateContext}, protocol_types::{ constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, diff --git a/noir-projects/aztec-nr/value-note/src/value_note.nr b/noir-projects/aztec-nr/value-note/src/value_note.nr index c243dbea25c..bc64e6e8e61 100644 --- a/noir-projects/aztec-nr/value-note/src/value_note.nr +++ b/noir-projects/aztec-nr/value-note/src/value_note.nr @@ -1,12 +1,9 @@ use dep::aztec::{ - context::PrivateContext, - keys::getters::get_nsk_app, - macros::notes::note, + context::PrivateContext, keys::getters::get_nsk_app, macros::notes::note, note::{ note_header::NoteHeader, note_interface::NullifiableNote, utils::compute_note_hash_for_nullify, - }, - oracle::random::random, + }, oracle::random::random, protocol_types::{ constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, traits::Serialize, diff --git a/noir-projects/noir-contracts/contracts/app_subscription_contract/src/dapp_payload.nr b/noir-projects/noir-contracts/contracts/app_subscription_contract/src/dapp_payload.nr index af2919e229e..67021fef75e 100644 --- a/noir-projects/noir-contracts/contracts/app_subscription_contract/src/dapp_payload.nr +++ b/noir-projects/noir-contracts/contracts/app_subscription_contract/src/dapp_payload.nr @@ -1,7 +1,6 @@ use dep::aztec::prelude::{AztecAddress, PrivateContext}; use dep::aztec::protocol_types::{ - constants::GENERATOR_INDEX__SIGNATURE_PAYLOAD, - hash::poseidon2_hash_with_separator, + constants::GENERATOR_INDEX__SIGNATURE_PAYLOAD, hash::poseidon2_hash_with_separator, traits::{Hash, Serialize}, }; diff --git a/noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr b/noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr index e9077096fe8..a148ff6d4bd 100644 --- a/noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr @@ -13,8 +13,7 @@ contract AppSubscription { keys::getters::get_public_keys, macros::{functions::{initializer, private, public}, storage::storage}, prelude::{AztecAddress, Map, PrivateMutable, SharedImmutable}, - protocol_types::constants::MAX_FIELD_VALUE, - utils::comparison::Comparator, + protocol_types::constants::MAX_FIELD_VALUE, utils::comparison::Comparator, }; use router::utils::privately_check_block_number; use token::Token; diff --git a/noir-projects/noir-contracts/contracts/app_subscription_contract/src/subscription_note.nr b/noir-projects/noir-contracts/contracts/app_subscription_contract/src/subscription_note.nr index c8ce2bc8184..28076a47829 100644 --- a/noir-projects/noir-contracts/contracts/app_subscription_contract/src/subscription_note.nr +++ b/noir-projects/noir-contracts/contracts/app_subscription_contract/src/subscription_note.nr @@ -1,9 +1,6 @@ use dep::aztec::{ - hash::poseidon2_hash_with_separator, - keys::getters::get_nsk_app, - macros::notes::note, - note::utils::compute_note_hash_for_nullify, - oracle::random::random, + hash::poseidon2_hash_with_separator, keys::getters::get_nsk_app, macros::notes::note, + note::utils::compute_note_hash_for_nullify, oracle::random::random, prelude::{NoteHeader, NullifiableNote, PrivateContext}, protocol_types::constants::GENERATOR_INDEX__NOTE_NULLIFIER, }; diff --git a/noir-projects/noir-contracts/contracts/auth_contract/src/main.nr b/noir-projects/noir-contracts/contracts/auth_contract/src/main.nr index e14deb2bf2e..dfb8420c9c4 100644 --- a/noir-projects/noir-contracts/contracts/auth_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/auth_contract/src/main.nr @@ -8,8 +8,7 @@ use dep::aztec::macros::aztec; contract Auth { use dep::aztec::{ macros::{functions::{initializer, private, public, view}, storage::storage}, - protocol_types::address::AztecAddress, - state_vars::{PublicImmutable, SharedMutable}, + protocol_types::address::AztecAddress, state_vars::{PublicImmutable, SharedMutable}, }; // Authorizing a new address has a certain block delay before it goes into effect. diff --git a/noir-projects/noir-contracts/contracts/auth_registry_contract/src/main.nr b/noir-projects/noir-contracts/contracts/auth_registry_contract/src/main.nr index 74423e063e0..68a08406c74 100644 --- a/noir-projects/noir-contracts/contracts/auth_registry_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/auth_registry_contract/src/main.nr @@ -7,8 +7,7 @@ contract AuthRegistry { }; use dep::aztec::{ macros::{functions::{internal, private, public, view}, storage::storage}, - protocol_types::address::AztecAddress, - state_vars::{Map, PublicMutable}, + protocol_types::address::AztecAddress, state_vars::{Map, PublicMutable}, }; #[storage] diff --git a/noir-projects/noir-contracts/contracts/avm_initializer_test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/avm_initializer_test_contract/src/main.nr index 8051e89933a..ee1971ed733 100644 --- a/noir-projects/noir-contracts/contracts/avm_initializer_test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/avm_initializer_test_contract/src/main.nr @@ -4,8 +4,7 @@ use dep::aztec::macros::aztec; contract AvmInitializerTest { // Libs use dep::aztec::{ - macros::{functions::{initializer, public}, storage::storage}, - state_vars::PublicImmutable, + macros::{functions::{initializer, public}, storage::storage}, state_vars::PublicImmutable, }; #[storage] diff --git a/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr index ee524904896..bd246246b4b 100644 --- a/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr @@ -39,9 +39,7 @@ contract AvmTest { abis::function_selector::FunctionSelector, storage::map::derive_storage_slot_in_map, }; use dep::aztec::protocol_types::{ - address::{AztecAddress, EthAddress}, - point::Point, - scalar::Scalar, + address::{AztecAddress, EthAddress}, point::Point, scalar::Scalar, }; use dep::aztec::protocol_types::constants::CONTRACT_INSTANCE_LENGTH; use dep::aztec::state_vars::PublicMutable; 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..0fe77090139 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 @@ -1,15 +1,11 @@ use dep::aztec::prelude::{AztecAddress, NoteGetterOptions, NoteViewerOptions, PrivateContext}; use dep::aztec::{ - context::UnconstrainedContext, - encrypted_logs::encrypted_note_emission::encode_and_encrypt_note, - keys::getters::get_public_keys, - note::constants::MAX_NOTES_PER_PAGE, + context::UnconstrainedContext, encrypted_logs::encrypted_note_emission::encode_and_encrypt_note, + keys::getters::get_public_keys, note::constants::MAX_NOTES_PER_PAGE, protocol_types::{ - constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, - traits::{FromField, Serialize, ToField}, - }, - state_vars::PrivateSet, + constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, traits::{FromField, Serialize, ToField}, + }, state_vars::PrivateSet, }; use dep::value_note::value_note::ValueNote; diff --git a/noir-projects/noir-contracts/contracts/child_contract/src/main.nr b/noir-projects/noir-contracts/contracts/child_contract/src/main.nr index 178516f0e9b..ed45ceb317b 100644 --- a/noir-projects/noir-contracts/contracts/child_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/child_contract/src/main.nr @@ -9,8 +9,7 @@ contract Child { encrypted_logs::encrypted_note_emission::encode_and_encrypt_note, keys::getters::get_public_keys, macros::{functions::{internal, private, public}, storage::storage}, - note::note_getter_options::NoteGetterOptions, - utils::comparison::Comparator, + note::note_getter_options::NoteGetterOptions, utils::comparison::Comparator, }; use dep::value_note::value_note::ValueNote; diff --git a/noir-projects/noir-contracts/contracts/claim_contract/src/main.nr b/noir-projects/noir-contracts/contracts/claim_contract/src/main.nr index 668c2c86e31..cbe8c98a2b0 100644 --- a/noir-projects/noir-contracts/contracts/claim_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/claim_contract/src/main.nr @@ -4,8 +4,7 @@ use dep::aztec::macros::aztec; contract Claim { use dep::aztec::{ macros::{functions::{initializer, private, public}, storage::storage}, - note::utils::compute_note_hash_for_nullify, - protocol_types::address::AztecAddress, + note::utils::compute_note_hash_for_nullify, protocol_types::address::AztecAddress, state_vars::SharedImmutable, }; use dep::value_note::value_note::ValueNote; diff --git a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/class_registered.nr b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/class_registered.nr index 3a5e11515ed..5e5b0b67024 100644 --- a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/class_registered.nr +++ b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/class_registered.nr @@ -1,9 +1,7 @@ use dep::aztec::protocol_types::{ constants::{ MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS, REGISTERER_CONTRACT_CLASS_REGISTERED_MAGIC_VALUE, - }, - contract_class_id::ContractClassId, - traits::Serialize, + }, contract_class_id::ContractClassId, traits::Serialize, }; // #[event] diff --git a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/private_function_broadcasted.nr b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/private_function_broadcasted.nr index 8ffcef81f51..9beb08df7e1 100644 --- a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/private_function_broadcasted.nr +++ b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/private_function_broadcasted.nr @@ -5,9 +5,7 @@ use dep::aztec::protocol_types::{ MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS, REGISTERER_PRIVATE_FUNCTION_BROADCASTED_ADDITIONAL_FIELDS, REGISTERER_PRIVATE_FUNCTION_BROADCASTED_MAGIC_VALUE, - }, - contract_class_id::ContractClassId, - traits::Serialize, + }, contract_class_id::ContractClassId, traits::Serialize, }; pub struct InnerPrivateFunction { diff --git a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/unconstrained_function_broadcasted.nr b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/unconstrained_function_broadcasted.nr index f81da27fb8c..89de5af946c 100644 --- a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/unconstrained_function_broadcasted.nr +++ b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/unconstrained_function_broadcasted.nr @@ -5,9 +5,7 @@ use dep::aztec::protocol_types::{ MAX_PACKED_BYTECODE_SIZE_PER_UNCONSTRAINED_FUNCTION_IN_FIELDS, REGISTERER_UNCONSTRAINED_FUNCTION_BROADCASTED_ADDITIONAL_FIELDS, REGISTERER_UNCONSTRAINED_FUNCTION_BROADCASTED_MAGIC_VALUE, - }, - contract_class_id::ContractClassId, - traits::Serialize, + }, contract_class_id::ContractClassId, traits::Serialize, }; pub struct InnerUnconstrainedFunction { diff --git a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr index f268b7d3318..22a6b6b241e 100644 --- a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr @@ -12,8 +12,7 @@ contract ContractClassRegisterer { MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS, MAX_PACKED_BYTECODE_SIZE_PER_UNCONSTRAINED_FUNCTION_IN_FIELDS, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS, - }, - contract_class_id::ContractClassId, + }, contract_class_id::ContractClassId, }; use dep::aztec::{ diff --git a/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/main.nr b/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/main.nr index 7a990b386dc..5e84e5deae8 100644 --- a/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/main.nr @@ -3,18 +3,13 @@ use dep::aztec::macros::aztec; #[aztec] contract ContractInstanceDeployer { use dep::aztec::{ - hash::compute_unencrypted_log_hash, - macros::{events::event, functions::private}, - oracle::logs::emit_unencrypted_log_private, - utils::to_bytes::arr_to_be_bytes_arr, + hash::compute_unencrypted_log_hash, macros::{events::event, functions::private}, + oracle::logs::emit_unencrypted_log_private, utils::to_bytes::arr_to_be_bytes_arr, }; use dep::aztec::protocol_types::{ - abis::log_hash::LogHash, - address::{AztecAddress, PartialAddress, PublicKeysHash}, + abis::log_hash::LogHash, address::{AztecAddress, PartialAddress, PublicKeysHash}, constants::DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_MAGIC_VALUE, - contract_class_id::ContractClassId, - public_keys::PublicKeys, - traits::Serialize, + contract_class_id::ContractClassId, public_keys::PublicKeys, traits::Serialize, }; use std::meta::derive; diff --git a/noir-projects/noir-contracts/contracts/crowdfunding_contract/src/main.nr b/noir-projects/noir-contracts/contracts/crowdfunding_contract/src/main.nr index 654ca2e39c1..0d151935f87 100644 --- a/noir-projects/noir-contracts/contracts/crowdfunding_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/crowdfunding_contract/src/main.nr @@ -10,14 +10,9 @@ contract Crowdfunding { encrypted_logs::encrypted_note_emission::encode_and_encrypt_note, keys::getters::get_public_keys, macros::{ - events::event, - functions::{initializer, internal, private, public}, - storage::storage, - }, - prelude::{AztecAddress, PrivateSet, SharedImmutable}, - protocol_types::traits::Serialize, - unencrypted_logs::unencrypted_event_emission::encode_event, - utils::comparison::Comparator, + events::event, functions::{initializer, internal, private, public}, storage::storage, + }, prelude::{AztecAddress, PrivateSet, SharedImmutable}, protocol_types::traits::Serialize, + unencrypted_logs::unencrypted_event_emission::encode_event, utils::comparison::Comparator, }; use std::meta::derive; // docs:start:import_valuenote diff --git a/noir-projects/noir-contracts/contracts/docs_example_contract/src/types/card_note.nr b/noir-projects/noir-contracts/contracts/docs_example_contract/src/types/card_note.nr index 219a098ac06..88119054e0a 100644 --- a/noir-projects/noir-contracts/contracts/docs_example_contract/src/types/card_note.nr +++ b/noir-projects/noir-contracts/contracts/docs_example_contract/src/types/card_note.nr @@ -1,7 +1,5 @@ use dep::aztec::{ - keys::getters::get_nsk_app, - macros::notes::note, - note::utils::compute_note_hash_for_nullify, + keys::getters::get_nsk_app, macros::notes::note, note::utils::compute_note_hash_for_nullify, protocol_types::{ constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, traits::Serialize, diff --git a/noir-projects/noir-contracts/contracts/ecdsa_k_account_contract/src/main.nr b/noir-projects/noir-contracts/contracts/ecdsa_k_account_contract/src/main.nr index 3c7ad72c92d..1405daf0889 100644 --- a/noir-projects/noir-contracts/contracts/ecdsa_k_account_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/ecdsa_k_account_contract/src/main.nr @@ -12,8 +12,7 @@ contract EcdsaKAccount { use dep::aztec::prelude::{PrivateContext, PrivateImmutable}; use dep::authwit::{ - account::AccountActions, - auth_witness::get_auth_witness, + account::AccountActions, auth_witness::get_auth_witness, entrypoint::{app::AppPayload, fee::FeePayload}, }; diff --git a/noir-projects/noir-contracts/contracts/ecdsa_r_account_contract/src/main.nr b/noir-projects/noir-contracts/contracts/ecdsa_r_account_contract/src/main.nr index c166ef2aa9c..b5db5e0d897 100644 --- a/noir-projects/noir-contracts/contracts/ecdsa_r_account_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/ecdsa_r_account_contract/src/main.nr @@ -11,8 +11,7 @@ contract EcdsaRAccount { use dep::aztec::prelude::{PrivateContext, PrivateImmutable}; use dep::authwit::{ - account::AccountActions, - auth_witness::get_auth_witness, + account::AccountActions, auth_witness::get_auth_witness, entrypoint::{app::AppPayload, fee::FeePayload}, }; diff --git a/noir-projects/noir-contracts/contracts/lending_contract/src/main.nr b/noir-projects/noir-contracts/contracts/lending_contract/src/main.nr index 077be6fea40..8a1b602818a 100644 --- a/noir-projects/noir-contracts/contracts/lending_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/lending_contract/src/main.nr @@ -24,8 +24,7 @@ contract Lending { use dep::token::Token; use dep::aztec::macros::{ - functions::{initializer, internal, private, public, view}, - storage::storage, + functions::{initializer, internal, private, public, view}, storage::storage, }; // Storage structure, containing all storage, and specifying what slots they use. 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 f5d83db36a4..59fa53b20f3 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/main.nr @@ -15,21 +15,15 @@ contract NFT { use dep::aztec::{ encrypted_logs::encrypted_note_emission::{ encode_and_encrypt_note, encrypt_and_emit_partial_log, - }, - hash::pedersen_hash, - keys::getters::get_public_keys, + }, hash::pedersen_hash, keys::getters::get_public_keys, macros::{ - events::event, - functions::{initializer, internal, private, public, view}, + events::event, functions::{initializer, internal, private, public, view}, storage::storage, - }, - note::constants::MAX_NOTES_PER_PAGE, - oracle::random::random, + }, note::constants::MAX_NOTES_PER_PAGE, oracle::random::random, prelude::{ AztecAddress, Map, NoteGetterOptions, NoteViewerOptions, PrivateContext, PrivateSet, PublicContext, PublicMutable, SharedImmutable, - }, - protocol_types::{point::Point, traits::{is_empty, Serialize}}, + }, protocol_types::{point::Point, traits::{is_empty, Serialize}}, utils::comparison::Comparator, }; use dep::compressed_string::FieldCompressedString; diff --git a/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_private.nr b/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_private.nr index e70b66e8ab6..efa8fc6b15d 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_private.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_private.nr @@ -1,8 +1,6 @@ use crate::{NFT, test::utils, types::nft_note::NFTNote}; use dep::aztec::{ - keys::getters::get_public_keys, - oracle::random::random, - prelude::{AztecAddress, NoteHeader}, + keys::getters::get_public_keys, oracle::random::random, prelude::{AztecAddress, NoteHeader}, protocol_types::storage::map::derive_storage_slot_in_map, }; use std::test::OracleMock; diff --git a/noir-projects/noir-contracts/contracts/nft_contract/src/test/utils.nr b/noir-projects/noir-contracts/contracts/nft_contract/src/test/utils.nr index 429844e7f59..c06d48a7c66 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/test/utils.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/test/utils.nr @@ -1,13 +1,9 @@ use crate::{NFT, types::nft_note::NFTNote}; use dep::aztec::{ - hash::pedersen_hash, - keys::getters::get_public_keys, + hash::pedersen_hash, keys::getters::get_public_keys, oracle::{ - execution::{get_block_number, get_contract_address}, - random::random, - storage::storage_read, - }, - prelude::{AztecAddress, NoteHeader}, + execution::{get_block_number, get_contract_address}, random::random, storage::storage_read, + }, prelude::{AztecAddress, NoteHeader}, protocol_types::storage::map::derive_storage_slot_in_map, test::helpers::{cheatcodes, test_environment::TestEnvironment}, }; diff --git a/noir-projects/noir-contracts/contracts/nft_contract/src/types/nft_note.nr b/noir-projects/noir-contracts/contracts/nft_contract/src/types/nft_note.nr index e055e32c983..3bc1fa66371 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/types/nft_note.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/types/nft_note.nr @@ -1,12 +1,9 @@ use dep::aztec::{ - keys::getters::get_nsk_app, - macros::notes::partial_note, - note::utils::compute_note_hash_for_nullify, - oracle::random::random, + keys::getters::get_nsk_app, macros::notes::partial_note, + note::utils::compute_note_hash_for_nullify, oracle::random::random, prelude::{NoteHeader, NullifiableNote, PrivateContext}, protocol_types::{ - constants::GENERATOR_INDEX__NOTE_NULLIFIER, - hash::poseidon2_hash_with_separator, + constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, traits::{Empty, Eq}, }, }; diff --git a/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr b/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr index 1356b3aec67..c78169cfdcd 100644 --- a/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr @@ -9,16 +9,13 @@ contract SchnorrAccount { use dep::std; use dep::authwit::{ - account::AccountActions, - auth::{compute_authwit_message_hash, compute_authwit_nullifier}, - auth_witness::get_auth_witness, - entrypoint::{app::AppPayload, fee::FeePayload}, + account::AccountActions, auth::{compute_authwit_message_hash, compute_authwit_nullifier}, + auth_witness::get_auth_witness, entrypoint::{app::AppPayload, fee::FeePayload}, }; use dep::aztec::encrypted_logs::encrypted_note_emission::encode_and_encrypt_note; use dep::aztec::{hash::compute_siloed_nullifier, keys::getters::get_public_keys}; use dep::aztec::macros::{ - functions::{initializer, noinitcheck, private, view}, - storage::storage, + functions::{initializer, noinitcheck, private, view}, storage::storage, }; use dep::aztec::oracle::get_nullifier_membership_witness::get_low_nullifier_membership_witness; use dep::aztec::prelude::{AztecAddress, PrivateContext, PrivateImmutable}; diff --git a/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/public_key_note.nr b/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/public_key_note.nr index 2e48a31ac8d..a052a65eecb 100644 --- a/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/public_key_note.nr +++ b/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/public_key_note.nr @@ -1,7 +1,5 @@ use dep::aztec::{ - keys::getters::get_nsk_app, - macros::notes::note, - note::utils::compute_note_hash_for_nullify, + keys::getters::get_nsk_app, macros::notes::note, note::utils::compute_note_hash_for_nullify, protocol_types::{ constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, }, diff --git a/noir-projects/noir-contracts/contracts/schnorr_hardcoded_account_contract/src/main.nr b/noir-projects/noir-contracts/contracts/schnorr_hardcoded_account_contract/src/main.nr index 1eea24b7356..91e74544a19 100644 --- a/noir-projects/noir-contracts/contracts/schnorr_hardcoded_account_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/schnorr_hardcoded_account_contract/src/main.nr @@ -5,8 +5,7 @@ use dep::aztec::macros::aztec; #[aztec] contract SchnorrHardcodedAccount { use dep::authwit::{ - account::AccountActions, - auth_witness::get_auth_witness, + account::AccountActions, auth_witness::get_auth_witness, entrypoint::{app::AppPayload, fee::FeePayload}, }; use dep::aztec::prelude::PrivateContext; diff --git a/noir-projects/noir-contracts/contracts/schnorr_single_key_account_contract/src/auth_oracle.nr b/noir-projects/noir-contracts/contracts/schnorr_single_key_account_contract/src/auth_oracle.nr index 063720d28e1..309fe83b5a4 100644 --- a/noir-projects/noir-contracts/contracts/schnorr_single_key_account_contract/src/auth_oracle.nr +++ b/noir-projects/noir-contracts/contracts/schnorr_single_key_account_contract/src/auth_oracle.nr @@ -1,8 +1,6 @@ use dep::authwit::auth_witness; use dep::aztec::protocol_types::{ - address::PartialAddress, - public_keys::{PUBLIC_KEYS_LENGTH, PublicKeys}, - utils::arr_copy_slice, + address::PartialAddress, public_keys::{PUBLIC_KEYS_LENGTH, PublicKeys}, utils::arr_copy_slice, }; pub struct AuthWitness { diff --git a/noir-projects/noir-contracts/contracts/spam_contract/src/main.nr b/noir-projects/noir-contracts/contracts/spam_contract/src/main.nr index 53cdee95ef4..8db19f4d90a 100644 --- a/noir-projects/noir-contracts/contracts/spam_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/spam_contract/src/main.nr @@ -15,8 +15,7 @@ contract Spam { constants::{ GENERATOR_INDEX__NOTE_NULLIFIER, MAX_NOTE_HASHES_PER_CALL, MAX_NULLIFIERS_PER_CALL, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, - }, - hash::poseidon2_hash_with_separator, + }, hash::poseidon2_hash_with_separator, }, }; diff --git a/noir-projects/noir-contracts/contracts/spam_contract/src/types/balance_set.nr b/noir-projects/noir-contracts/contracts/spam_contract/src/types/balance_set.nr index c9526d85c49..27835836c32 100644 --- a/noir-projects/noir-contracts/contracts/spam_contract/src/types/balance_set.nr +++ b/noir-projects/noir-contracts/contracts/spam_contract/src/types/balance_set.nr @@ -1,8 +1,7 @@ // This file is copied from the token contract. use crate::types::token_note::OwnedNote; use dep::aztec::{ - context::{PrivateContext, UnconstrainedContext}, - note::note_emission::OuterNoteEmission, + context::{PrivateContext, UnconstrainedContext}, note::note_emission::OuterNoteEmission, protocol_types::{constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, public_keys::NpkM}, }; use dep::aztec::prelude::{ diff --git a/noir-projects/noir-contracts/contracts/spam_contract/src/types/token_note.nr b/noir-projects/noir-contracts/contracts/spam_contract/src/types/token_note.nr index 3b60ed16816..062cbd5eaa3 100644 --- a/noir-projects/noir-contracts/contracts/spam_contract/src/types/token_note.nr +++ b/noir-projects/noir-contracts/contracts/spam_contract/src/types/token_note.nr @@ -1,9 +1,6 @@ use dep::aztec::{ - keys::getters::get_nsk_app, - macros::notes::note, - note::utils::compute_note_hash_for_nullify, - oracle::random::random, - prelude::{NoteHeader, NullifiableNote, PrivateContext}, + keys::getters::get_nsk_app, macros::notes::note, note::utils::compute_note_hash_for_nullify, + oracle::random::random, prelude::{NoteHeader, NullifiableNote, PrivateContext}, protocol_types::{ constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, }, diff --git a/noir-projects/noir-contracts/contracts/static_child_contract/src/main.nr b/noir-projects/noir-contracts/contracts/static_child_contract/src/main.nr index 1d44bb0350a..dc350a500b6 100644 --- a/noir-projects/noir-contracts/contracts/static_child_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/static_child_contract/src/main.nr @@ -9,8 +9,7 @@ contract StaticChild { encrypted_logs::encrypted_note_emission::encode_and_encrypt_note, keys::getters::get_public_keys, macros::{functions::{private, public, view}, storage::storage}, - note::note_getter_options::NoteGetterOptions, - utils::comparison::Comparator, + note::note_getter_options::NoteGetterOptions, utils::comparison::Comparator, }; use dep::value_note::value_note::ValueNote; diff --git a/noir-projects/noir-contracts/contracts/test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/test_contract/src/main.nr index c19a1a63ecd..75a9ee0fa57 100644 --- a/noir-projects/noir-contracts/contracts/test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/test_contract/src/main.nr @@ -26,12 +26,9 @@ contract Test { hash::{ArgsHasher, compute_secret_hash, pedersen_hash}, macros::{events::event, functions::{internal, private, public}, storage::storage}, note::{ - lifecycle::{create_note, destroy_note_unsafe}, - note_getter::{get_notes, view_notes}, + lifecycle::{create_note, destroy_note_unsafe}, note_getter::{get_notes, view_notes}, note_getter_options::NoteStatus, - }, - oracle::random::random, - utils::comparison::Comparator, + }, oracle::random::random, utils::comparison::Comparator, }; use dep::token_portal_content_hash_lib::{ get_mint_private_content_hash, get_mint_public_content_hash, diff --git a/noir-projects/noir-contracts/contracts/test_contract/src/test_note.nr b/noir-projects/noir-contracts/contracts/test_contract/src/test_note.nr index 7f938fa42cd..ad3e7229c65 100644 --- a/noir-projects/noir-contracts/contracts/test_contract/src/test_note.nr +++ b/noir-projects/noir-contracts/contracts/test_contract/src/test_note.nr @@ -1,6 +1,5 @@ use dep::aztec::{ - context::PrivateContext, - macros::notes::note, + context::PrivateContext, macros::notes::note, note::{note_header::NoteHeader, note_interface::NullifiableNote}, }; diff --git a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr index f49d64b7ba1..f2bb1208b10 100644 --- a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr @@ -16,9 +16,7 @@ contract TokenBlacklist { use dep::aztec::{ encrypted_logs::encrypted_note_emission::{ encode_and_encrypt_note, encode_and_encrypt_note_unconstrained, - }, - hash::compute_secret_hash, - keys::getters::get_public_keys, + }, hash::compute_secret_hash, keys::getters::get_public_keys, macros::{functions::{initializer, internal, private, public, view}, storage::storage}, prelude::{AztecAddress, Map, NoteGetterOptions, PrivateSet, PublicMutable, SharedMutable}, utils::comparison::Comparator, diff --git a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/balances_map.nr b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/balances_map.nr index 8c1d84c3cef..06a97efc16c 100644 --- a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/balances_map.nr +++ b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/balances_map.nr @@ -1,7 +1,6 @@ use crate::types::token_note::OwnedNote; use dep::aztec::{ - context::{PrivateContext, UnconstrainedContext}, - keys::getters::get_public_keys, + context::{PrivateContext, UnconstrainedContext}, keys::getters::get_public_keys, note::note_emission::OuterNoteEmission, protocol_types::constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, }; diff --git a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/token_note.nr b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/token_note.nr index b36d5316324..4a1da500c8b 100644 --- a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/token_note.nr +++ b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/token_note.nr @@ -1,9 +1,6 @@ use dep::aztec::{ - keys::getters::get_nsk_app, - macros::notes::note, - note::utils::compute_note_hash_for_nullify, - oracle::random::random, - prelude::{NoteHeader, NullifiableNote, PrivateContext}, + keys::getters::get_nsk_app, macros::notes::note, note::utils::compute_note_hash_for_nullify, + oracle::random::random, prelude::{NoteHeader, NullifiableNote, PrivateContext}, protocol_types::{ constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, }, diff --git a/noir-projects/noir-contracts/contracts/token_bridge_contract/src/main.nr b/noir-projects/noir-contracts/contracts/token_bridge_contract/src/main.nr index ef94712166a..034bfe92e01 100644 --- a/noir-projects/noir-contracts/contracts/token_bridge_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/token_bridge_contract/src/main.nr @@ -18,8 +18,7 @@ contract TokenBridge { use dep::token::Token; use dep::aztec::macros::{ - functions::{initializer, internal, private, public, view}, - storage::storage, + functions::{initializer, internal, private, public, view}, storage::storage, }; // docs:end:token_bridge_imports 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 b38e513d7da..bf2d883fd05 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/main.nr @@ -26,21 +26,15 @@ contract Token { encode_and_encrypt_note, encode_and_encrypt_note_unconstrained, encrypt_and_emit_partial_log, }, - }, - hash::compute_secret_hash, - keys::getters::get_public_keys, + }, hash::compute_secret_hash, keys::getters::get_public_keys, macros::{ - events::event, - functions::{initializer, internal, private, public, view}, + events::event, functions::{initializer, internal, private, public, view}, storage::storage, - }, - oracle::random::random, + }, oracle::random::random, prelude::{ AztecAddress, FunctionSelector, Map, NoteGetterOptions, PrivateSet, PublicMutable, SharedImmutable, - }, - protocol_types::{point::Point, traits::Serialize}, - utils::comparison::Comparator, + }, protocol_types::{point::Point, traits::Serialize}, utils::comparison::Comparator, }; // docs:start:import_authwit diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/test/utils.nr b/noir-projects/noir-contracts/contracts/token_contract/src/test/utils.nr index c3f93777556..7e22bdbfa23 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/test/utils.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/test/utils.nr @@ -1,12 +1,8 @@ use dep::aztec::{ hash::compute_secret_hash, oracle::{ - execution::{get_block_number, get_contract_address}, - random::random, - storage::storage_read, - }, - prelude::AztecAddress, - protocol_types::storage::map::derive_storage_slot_in_map, + execution::{get_block_number, get_contract_address}, random::random, storage::storage_read, + }, prelude::AztecAddress, protocol_types::storage::map::derive_storage_slot_in_map, test::helpers::{cheatcodes, test_environment::TestEnvironment}, }; diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/types/balance_set.nr b/noir-projects/noir-contracts/contracts/token_contract/src/types/balance_set.nr index 9f650a94291..3c31c14c07b 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/types/balance_set.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/types/balance_set.nr @@ -1,11 +1,9 @@ use crate::types::token_note::OwnedNote; use dep::aztec::{ - context::{PrivateContext, UnconstrainedContext}, - keys::getters::get_public_keys, + context::{PrivateContext, UnconstrainedContext}, keys::getters::get_public_keys, note::{ note_emission::OuterNoteEmission, note_getter::view_notes, note_interface::NullifiableNote, - }, - protocol_types::{constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, public_keys::NpkM}, + }, protocol_types::{constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, public_keys::NpkM}, }; use dep::aztec::prelude::{NoteGetterOptions, NoteInterface, NoteViewerOptions, PrivateSet}; diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/types/token_note.nr b/noir-projects/noir-contracts/contracts/token_contract/src/types/token_note.nr index 677dd918033..69227d04296 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/types/token_note.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/types/token_note.nr @@ -1,8 +1,6 @@ use dep::aztec::{ - keys::getters::get_nsk_app, - macros::notes::partial_note, - note::utils::compute_note_hash_for_nullify, - oracle::random::random, + keys::getters::get_nsk_app, macros::notes::partial_note, + note::utils::compute_note_hash_for_nullify, oracle::random::random, prelude::{NoteHeader, NullifiableNote, PrivateContext}, protocol_types::{ constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/types/transparent_note.nr b/noir-projects/noir-contracts/contracts/token_contract/src/types/transparent_note.nr index ed1f08e0d74..2ab50c3476f 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/types/transparent_note.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/types/transparent_note.nr @@ -1,7 +1,6 @@ // docs:start:token_types_all use dep::aztec::{ - macros::notes::note, - note::utils::compute_note_hash_for_nullify, + macros::notes::note, note::utils::compute_note_hash_for_nullify, prelude::{NoteHeader, NullifiableNote, PrivateContext}, protocol_types::{ constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, diff --git a/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr b/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr index f1625dc6119..1b45f4ee8e6 100644 --- a/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr @@ -17,8 +17,7 @@ contract Uniswap { use crate::util::{compute_swap_private_content_hash, compute_swap_public_content_hash}; use dep::aztec::macros::{ - functions::{initializer, internal, private, public, view}, - storage::storage, + functions::{initializer, internal, private, public, view}, storage::storage, }; use dep::token::Token; use dep::token_bridge::TokenBridge; diff --git a/noir-projects/noir-protocol-circuits/crates/parity-lib/src/root/root_parity_input.nr b/noir-projects/noir-protocol-circuits/crates/parity-lib/src/root/root_parity_input.nr index cb1b2edc1ea..b0bc95a1eb9 100644 --- a/noir-projects/noir-protocol-circuits/crates/parity-lib/src/root/root_parity_input.nr +++ b/noir-projects/noir-protocol-circuits/crates/parity-lib/src/root/root_parity_input.nr @@ -3,11 +3,9 @@ use dep::types::{ constants::{BASE_PARITY_INDEX, VK_TREE_HEIGHT}, merkle_tree::membership::assert_check_membership, recursion::{ - proof::RecursiveProof, - traits::Verifiable, + proof::RecursiveProof, traits::Verifiable, verification_key::{HonkVerificationKey, VerificationKey}, - }, - traits::Empty, + }, traits::Empty, }; pub struct RootParityInput { diff --git a/noir-projects/noir-protocol-circuits/crates/parity-lib/src/root/root_rollup_parity_input.nr b/noir-projects/noir-protocol-circuits/crates/parity-lib/src/root/root_rollup_parity_input.nr index dc0c35e2454..c31114014c1 100644 --- a/noir-projects/noir-protocol-circuits/crates/parity-lib/src/root/root_rollup_parity_input.nr +++ b/noir-projects/noir-protocol-circuits/crates/parity-lib/src/root/root_rollup_parity_input.nr @@ -3,11 +3,9 @@ use dep::types::{ constants::{ROOT_PARITY_INDEX, VK_TREE_HEIGHT}, merkle_tree::membership::assert_check_membership, recursion::{ - proof::NestedRecursiveProof, - traits::Verifiable, + proof::NestedRecursiveProof, traits::Verifiable, verification_key::{HonkVerificationKey, VerificationKey}, - }, - traits::Empty, + }, traits::Empty, }; pub struct RootRollupParityInput { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/previous_kernel_validator.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/previous_kernel_validator.nr index 4476930b3a4..fdadacfe1ad 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/previous_kernel_validator.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/previous_kernel_validator.nr @@ -5,9 +5,7 @@ use crate::components::previous_kernel_validator::previous_kernel_validator_hint }; use dep::types::{ abis::{log_hash::ScopedEncryptedLogHash, private_kernel_data::PrivateKernelData}, - address::AztecAddress, - traits::is_empty, - utils::arrays::array_length, + address::AztecAddress, traits::is_empty, utils::arrays::array_length, }; pub struct PreviousKernelValidator { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/previous_kernel_validator/previous_kernel_validator_hints.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/previous_kernel_validator/previous_kernel_validator_hints.nr index 23927a82882..28719890ab0 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/previous_kernel_validator/previous_kernel_validator_hints.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/previous_kernel_validator/previous_kernel_validator_hints.nr @@ -1,9 +1,7 @@ use dep::types::{ abis::{ kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, note_hash::ScopedNoteHash, - }, - constants::{MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX}, - utils::arrays::find_index_hint, + }, constants::{MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX}, utils::arrays::find_index_hint, }; pub struct PreviousKernelValidatorHints { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_call_data_validator.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_call_data_validator.nr index 24eaeec2842..2fa422b6c00 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_call_data_validator.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_call_data_validator.nr @@ -9,17 +9,11 @@ use crate::components::private_call_data_validator::{ }; use dep::types::{ abis::{ - call_context::CallContext, - kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, - note_hash::ScopedNoteHash, - private_call_request::PrivateCallRequest, + call_context::CallContext, kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, + note_hash::ScopedNoteHash, private_call_request::PrivateCallRequest, private_circuit_public_inputs::PrivateCircuitPublicInputsArrayLengths, - private_kernel::private_call_data::PrivateCallData, - side_effect::{Ordered, RangeOrdered}, - }, - address::AztecAddress, - constants::MAX_FIELD_VALUE, - transaction::tx_request::TxRequest, + private_kernel::private_call_data::PrivateCallData, side_effect::{Ordered, RangeOrdered}, + }, address::AztecAddress, constants::MAX_FIELD_VALUE, transaction::tx_request::TxRequest, utils::arrays::find_index_hint, }; diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_kernel_circuit_output_validator.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_kernel_circuit_output_validator.nr index 9784fefe4d0..fcc7ed1819e 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_kernel_circuit_output_validator.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_kernel_circuit_output_validator.nr @@ -3,15 +3,11 @@ use dep::types::{ abis::{ kernel_circuit_public_inputs::{ PrivateKernelCircuitPublicInputs, PrivateKernelCircuitPublicInputsArrayLengths, - }, - max_block_number::MaxBlockNumber, + }, max_block_number::MaxBlockNumber, private_circuit_public_inputs::{ PrivateCircuitPublicInputs, PrivateCircuitPublicInputsArrayLengths, }, - }, - address::AztecAddress, - traits::is_empty, - transaction::tx_request::TxRequest, + }, address::AztecAddress, traits::is_empty, transaction::tx_request::TxRequest, utils::arrays::{ assert_array_appended, assert_array_appended_reversed, assert_array_appended_scoped, assert_array_prepended, diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_kernel_circuit_public_inputs_composer.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_kernel_circuit_public_inputs_composer.nr index f0702793359..67cfffefe28 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_kernel_circuit_public_inputs_composer.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_kernel_circuit_public_inputs_composer.nr @@ -3,14 +3,9 @@ use dep::types::{ combined_constant_data::CombinedConstantData, kernel_circuit_public_inputs::{ PrivateKernelCircuitPublicInputs, PrivateKernelCircuitPublicInputsBuilder, - }, - max_block_number::MaxBlockNumber, - nullifier::{Nullifier, ScopedNullifier}, + }, max_block_number::MaxBlockNumber, nullifier::{Nullifier, ScopedNullifier}, private_circuit_public_inputs::PrivateCircuitPublicInputs, - }, - address::AztecAddress, - traits::is_empty, - transaction::tx_request::TxRequest, + }, address::AztecAddress, traits::is_empty, transaction::tx_request::TxRequest, utils::arrays::{array_length, array_to_bounded_vec, sort_by_counter_asc, sort_by_counter_desc}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer.nr index 3d570925058..486c626fa2b 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer.nr @@ -7,16 +7,13 @@ use dep::reset_kernel_lib::{PrivateValidationRequestProcessor, TransientDataInde use dep::types::{ abis::{ kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, - log_hash::{NoteLogHash, ScopedEncryptedLogHash}, - note_hash::ScopedNoteHash, + log_hash::{NoteLogHash, ScopedEncryptedLogHash}, note_hash::ScopedNoteHash, nullifier::ScopedNullifier, - }, - address::AztecAddress, + }, address::AztecAddress, constants::{ MAX_ENCRYPTED_LOGS_PER_TX, MAX_NOTE_ENCRYPTED_LOGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, - }, - hash::{mask_encrypted_log_hash, silo_note_hash, silo_nullifier}, + }, hash::{mask_encrypted_log_hash, silo_note_hash, silo_nullifier}, utils::arrays::sort_by_counter_asc, }; diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer/reset_output_hints.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer/reset_output_hints.nr index a88cbd99565..625023f3f03 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer/reset_output_hints.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer/reset_output_hints.nr @@ -14,8 +14,7 @@ use dep::types::{ constants::{ MAX_ENCRYPTED_LOGS_PER_TX, MAX_NOTE_ENCRYPTED_LOGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, - }, - utils::arrays::{get_order_hints_asc, OrderHint}, + }, utils::arrays::{get_order_hints_asc, OrderHint}, }; pub struct ResetOutputHints { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer/reset_output_hints/get_transient_or_propagated_note_hash_indexes_for_logs.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer/reset_output_hints/get_transient_or_propagated_note_hash_indexes_for_logs.nr index d57b7c061d2..208bfc36c15 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer/reset_output_hints/get_transient_or_propagated_note_hash_indexes_for_logs.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer/reset_output_hints/get_transient_or_propagated_note_hash_indexes_for_logs.nr @@ -1,7 +1,6 @@ use dep::reset_kernel_lib::TransientDataIndexHint; use dep::types::{ - abis::{log_hash::NoteLogHash, note_hash::ScopedNoteHash}, - utils::arrays::find_index_hint, + abis::{log_hash::NoteLogHash, note_hash::ScopedNoteHash}, utils::arrays::find_index_hint, }; pub unconstrained fn get_transient_or_propagated_note_hash_indexes_for_logs( diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_validator.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_validator.nr index c126b1ebf5b..e0ab7346acc 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_validator.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_validator.nr @@ -5,12 +5,9 @@ use dep::reset_kernel_lib::{ use dep::types::{ abis::{ kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, - log_hash::{NoteLogHash, ScopedEncryptedLogHash}, - note_hash::ScopedNoteHash, + log_hash::{NoteLogHash, ScopedEncryptedLogHash}, note_hash::ScopedNoteHash, nullifier::ScopedNullifier, - }, - hash::{mask_encrypted_log_hash, silo_note_hash, silo_nullifier}, - traits::is_empty, + }, hash::{mask_encrypted_log_hash, silo_note_hash, silo_nullifier}, traits::is_empty, utils::arrays::{ assert_sorted_transformed_value_array, assert_sorted_transformed_value_array_capped_size, }, diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_composer.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_composer.nr index 44eca05c0f6..093fd62d795 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_composer.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_composer.nr @@ -8,11 +8,9 @@ use dep::types::{ abis::{ accumulated_data::combined_accumulated_data::CombinedAccumulatedData, kernel_circuit_public_inputs::{KernelCircuitPublicInputs, PrivateKernelCircuitPublicInputs}, - log_hash::{NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, - note_hash::ScopedNoteHash, + log_hash::{NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, note_hash::ScopedNoteHash, nullifier::ScopedNullifier, - }, - messaging::l2_to_l1_message::ScopedL2ToL1Message, + }, messaging::l2_to_l1_message::ScopedL2ToL1Message, }; pub struct TailOutputComposer { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_composer/meter_gas_used.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_composer/meter_gas_used.nr index 7ecd1b59a77..f0f5def75b7 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_composer/meter_gas_used.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_composer/meter_gas_used.nr @@ -6,8 +6,7 @@ use dep::types::{ constants::{ DA_BYTES_PER_FIELD, DA_GAS_PER_BYTE, L2_GAS_PER_LOG_BYTE, L2_GAS_PER_NOTE_HASH, L2_GAS_PER_NULLIFIER, - }, - utils::arrays::array_length, + }, utils::arrays::array_length, }; pub fn meter_gas_used(data: CombinedAccumulatedData, gas_settings: GasSettings) -> Gas { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_validator.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_validator.nr index dbca9f64106..87b11475ae8 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_validator.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_validator.nr @@ -8,9 +8,7 @@ use dep::types::{ abis::{ kernel_circuit_public_inputs::{KernelCircuitPublicInputs, PrivateKernelCircuitPublicInputs}, log_hash::{NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, - }, - messaging::l2_to_l1_message::ScopedL2ToL1Message, - traits::is_empty, + }, messaging::l2_to_l1_message::ScopedL2ToL1Message, traits::is_empty, utils::arrays::assert_exposed_sorted_transformed_value_array, }; diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_composer.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_composer.nr index b32a7408dce..241256003e7 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_composer.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_composer.nr @@ -11,8 +11,7 @@ use crate::components::{ use dep::types::abis::{ kernel_circuit_public_inputs::{ PrivateKernelCircuitPublicInputs, PublicKernelCircuitPublicInputs, - }, - validation_requests::PublicValidationRequests, + }, validation_requests::PublicValidationRequests, }; pub struct TailToPublicOutputComposer { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_composer/meter_gas_used.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_composer/meter_gas_used.nr index a338db8f439..f3b0e8b572e 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_composer/meter_gas_used.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_composer/meter_gas_used.nr @@ -3,8 +3,7 @@ use dep::types::{ constants::{ DA_BYTES_PER_FIELD, DA_GAS_PER_BYTE, FIXED_AVM_STARTUP_L2_GAS, L2_GAS_PER_LOG_BYTE, L2_GAS_PER_NOTE_HASH, L2_GAS_PER_NULLIFIER, - }, - utils::arrays::array_length, + }, utils::arrays::array_length, }; fn meter_gas_used(data: PublicAccumulatedData) -> Gas { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_validator.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_validator.nr index 7201736c70e..55c07a1804e 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_validator.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_validator.nr @@ -12,14 +12,10 @@ use dep::types::{ abis::{ kernel_circuit_public_inputs::{ PrivateKernelCircuitPublicInputs, PublicKernelCircuitPublicInputs, - }, - log_hash::{LogHash, NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, - note_hash::ScopedNoteHash, - nullifier::{Nullifier, ScopedNullifier}, + }, log_hash::{LogHash, NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, + note_hash::ScopedNoteHash, nullifier::{Nullifier, ScopedNullifier}, public_call_request::PublicCallRequest, - }, - messaging::l2_to_l1_message::ScopedL2ToL1Message, - traits::is_empty_array, + }, messaging::l2_to_l1_message::ScopedL2ToL1Message, traits::is_empty_array, utils::arrays::{ assert_split_sorted_transformed_value_arrays_asc, assert_split_sorted_transformed_value_arrays_desc, assert_split_transformed_value_arrays, diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_validator/tail_to_public_output_hints.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_validator/tail_to_public_output_hints.nr index be4038a7515..f46f0af3422 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_validator/tail_to_public_output_hints.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_validator/tail_to_public_output_hints.nr @@ -2,8 +2,7 @@ use dep::types::{ abis::kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, constants::{ MAX_L2_TO_L1_MSGS_PER_TX, MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_UNENCRYPTED_LOGS_PER_TX, - }, - utils::arrays::{get_split_order_hints_asc, get_split_order_hints_desc, SplitOrderHints}, + }, utils::arrays::{get_split_order_hints_asc, get_split_order_hints_desc, SplitOrderHints}, }; pub struct TailToPublicOutputHints { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_empty.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_empty.nr index f1042b6d945..803a3207ebe 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_empty.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_empty.nr @@ -1,12 +1,9 @@ use dep::types::{ - header::Header, - KernelCircuitPublicInputs, + header::Header, KernelCircuitPublicInputs, recursion::{ - proof::RecursiveProof, - traits::Verifiable, + proof::RecursiveProof, traits::Verifiable, verification_key::{HonkVerificationKey, VerificationKey}, - }, - traits::Empty, + }, traits::Empty, }; pub struct EmptyNestedCircuitPublicInputs { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_init.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_init.nr index 5f6eceb0c47..1479b82e45c 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_init.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_init.nr @@ -8,8 +8,7 @@ use dep::types::{ kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, private_circuit_public_inputs::PrivateCircuitPublicInputs, private_kernel::private_call_data::{PrivateCallData, PrivateCallDataWithoutPublicInputs}, - }, - transaction::tx_request::TxRequest, + }, transaction::tx_request::TxRequest, }; // Initialization struct for private inputs to the private kernel diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_inner.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_inner.nr index b63f31ede3d..f497f1b3fff 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_inner.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_inner.nr @@ -8,8 +8,7 @@ use dep::types::{ abis::{ kernel_circuit_public_inputs::{ PrivateKernelCircuitPublicInputs, PrivateKernelCircuitPublicInputsArrayLengths, - }, - private_circuit_public_inputs::PrivateCircuitPublicInputs, + }, private_circuit_public_inputs::PrivateCircuitPublicInputs, private_kernel::private_call_data::{PrivateCallData, PrivateCallDataWithoutPublicInputs}, private_kernel_data::{PrivateKernelData, PrivateKernelDataWithoutPublicInputs}, }, diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_reset.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_reset.nr index 682c7a0a521..89772192e7f 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_reset.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_reset.nr @@ -135,23 +135,17 @@ mod tests { tests::{ note_hash_read_request_hints_builder::NoteHashReadRequestHintsBuilder, nullifier_read_request_hints_builder::NullifierReadRequestHintsBuilder, - }, - TransientDataIndexHint, + }, TransientDataIndexHint, }; use dep::types::{ abis::{ kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, - log_hash::{NoteLogHash, ScopedEncryptedLogHash}, - max_block_number::MaxBlockNumber, - note_hash::ScopedNoteHash, - nullifier::ScopedNullifier, - }, - address::AztecAddress, - hash::{mask_encrypted_log_hash, silo_note_hash, silo_nullifier}, + log_hash::{NoteLogHash, ScopedEncryptedLogHash}, max_block_number::MaxBlockNumber, + note_hash::ScopedNoteHash, nullifier::ScopedNullifier, + }, address::AztecAddress, hash::{mask_encrypted_log_hash, silo_note_hash, silo_nullifier}, point::Point, tests::{fixture_builder::FixtureBuilder, utils::{assert_array_eq, swap_items}}, - traits::is_empty_array, - utils::arrays::find_index_hint, + traits::is_empty_array, utils::arrays::find_index_hint, }; use dep::types::constants::{ BASE_ROLLUP_INDEX, GENERATOR_INDEX__OVSK_M, MAX_KEY_VALIDATION_REQUESTS_PER_TX, diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail.nr index 8e8268ad5b4..52dfac5bc74 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail.nr @@ -58,11 +58,8 @@ mod tests { abis::{ gas::Gas, kernel_circuit_public_inputs::KernelCircuitPublicInputs, log_hash::ScopedLogHash, max_block_number::MaxBlockNumber, - }, - address::{AztecAddress, EthAddress}, - point::Point, - tests::fixture_builder::FixtureBuilder, - traits::is_empty, + }, address::{AztecAddress, EthAddress}, point::Point, + tests::fixture_builder::FixtureBuilder, traits::is_empty, }; use dep::types::constants::{ BASE_ROLLUP_INDEX, DA_BYTES_PER_FIELD, DA_GAS_PER_BYTE, GENERATOR_INDEX__IVSK_M, diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail_to_public.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail_to_public.nr index 7910463a800..1f0731b8e46 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail_to_public.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail_to_public.nr @@ -57,15 +57,10 @@ mod tests { }; use dep::types::{ abis::{ - gas::Gas, - kernel_circuit_public_inputs::PublicKernelCircuitPublicInputs, - log_hash::{LogHash, NoteLogHash}, - note_hash::ScopedNoteHash, + gas::Gas, kernel_circuit_public_inputs::PublicKernelCircuitPublicInputs, + log_hash::{LogHash, NoteLogHash}, note_hash::ScopedNoteHash, nullifier::{Nullifier, ScopedNullifier}, - }, - address::{AztecAddress, EthAddress}, - constants::PRIVATE_KERNEL_INNER_INDEX, - point::Point, + }, address::{AztecAddress, EthAddress}, constants::PRIVATE_KERNEL_INNER_INDEX, point::Point, tests::{fixture_builder::FixtureBuilder, utils::assert_array_eq}, }; use dep::types::constants::{ diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_call_data_validator_builder/mod.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_call_data_validator_builder/mod.nr index 58b753d3b01..5f0d70f292b 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_call_data_validator_builder/mod.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_call_data_validator_builder/mod.nr @@ -15,9 +15,7 @@ use dep::types::{ abis::{ note_hash::ScopedNoteHash, private_call_request::PrivateCallRequest, private_kernel::private_call_data::PrivateCallData, - }, - tests::fixture_builder::FixtureBuilder, - transaction::tx_request::TxRequest, + }, tests::fixture_builder::FixtureBuilder, transaction::tx_request::TxRequest, }; pub struct PrivateCallDataValidatorBuilder { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_kernel_circuit_output_validator_builder/mod.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_kernel_circuit_output_validator_builder/mod.nr index 0604a83155e..384fa98417b 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_kernel_circuit_output_validator_builder/mod.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_kernel_circuit_output_validator_builder/mod.nr @@ -12,9 +12,7 @@ use dep::types::{ kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputsArrayLengths, private_call_request::PrivateCallRequest, private_circuit_public_inputs::PrivateCircuitPublicInputsArrayLengths, - }, - constants::PRIVATE_KERNEL_INIT_INDEX, - tests::fixture_builder::FixtureBuilder, + }, constants::PRIVATE_KERNEL_INIT_INDEX, tests::fixture_builder::FixtureBuilder, transaction::tx_request::TxRequest, }; diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_kernel_circuit_public_inputs_composer_builder/mod.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_kernel_circuit_public_inputs_composer_builder/mod.nr index 3ccc2438ab7..adc4b05947d 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_kernel_circuit_public_inputs_composer_builder/mod.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_kernel_circuit_public_inputs_composer_builder/mod.nr @@ -7,9 +7,7 @@ use dep::types::{ abis::{ kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, private_call_request::PrivateCallRequest, - }, - tests::fixture_builder::FixtureBuilder, - transaction::tx_request::TxRequest, + }, tests::fixture_builder::FixtureBuilder, transaction::tx_request::TxRequest, }; pub struct PrivateKernelCircuitPublicInputsComposerBuilder { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/reset_output_validator_builder/mod.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/reset_output_validator_builder/mod.nr index 71955e0ebd5..46fbe569a48 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/reset_output_validator_builder/mod.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/reset_output_validator_builder/mod.nr @@ -6,8 +6,7 @@ use crate::components::{ reset_output_validator::ResetOutputValidator, }; use dep::reset_kernel_lib::{ - KeyValidationHint, - PrivateValidationRequestProcessor, + KeyValidationHint, PrivateValidationRequestProcessor, tests::{NoteHashReadRequestHintsBuilder, NullifierReadRequestHintsBuilder}, TransientDataIndexHint, }; diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_output_composer_builder/meter_gas_used.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_output_composer_builder/meter_gas_used.nr index 3a04eb2c387..4b69b82f9dc 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_output_composer_builder/meter_gas_used.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_output_composer_builder/meter_gas_used.nr @@ -4,8 +4,7 @@ use dep::types::{ constants::{ DA_BYTES_PER_FIELD, DA_GAS_PER_BYTE, L2_GAS_PER_LOG_BYTE, L2_GAS_PER_NOTE_HASH, L2_GAS_PER_NULLIFIER, - }, - tests::fixture_builder::FixtureBuilder, + }, tests::fixture_builder::FixtureBuilder, }; fn new_builder() -> FixtureBuilder { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_output_validator_builder/mod.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_output_validator_builder/mod.nr index 7bc01c93661..e3a784e5081 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_output_validator_builder/mod.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_output_validator_builder/mod.nr @@ -6,8 +6,7 @@ mod validate_propagated_values; use crate::components::{ tail_output_composer::meter_gas_used::meter_gas_used, tail_output_validator::{ - tail_output_hints::{generate_tail_output_hints, TailOutputHints}, - TailOutputValidator, + tail_output_hints::{generate_tail_output_hints, TailOutputHints}, TailOutputValidator, }, }; use dep::types::{ diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_to_public_output_composer_builder/meter_gas_used.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_to_public_output_composer_builder/meter_gas_used.nr index f85e960474e..d54da7c8ea0 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_to_public_output_composer_builder/meter_gas_used.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_to_public_output_composer_builder/meter_gas_used.nr @@ -6,8 +6,7 @@ use dep::types::{ constants::{ DA_BYTES_PER_FIELD, DA_GAS_PER_BYTE, FIXED_AVM_STARTUP_L2_GAS, L2_GAS_PER_LOG_BYTE, L2_GAS_PER_NOTE_HASH, L2_GAS_PER_NULLIFIER, - }, - tests::fixture_builder::FixtureBuilder, + }, tests::fixture_builder::FixtureBuilder, }; #[test] diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_to_public_output_composer_builder/tail_to_public_output_composer.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_to_public_output_composer_builder/tail_to_public_output_composer.nr index 02cea830552..6d1e9a4972a 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_to_public_output_composer_builder/tail_to_public_output_composer.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_to_public_output_composer_builder/tail_to_public_output_composer.nr @@ -4,8 +4,7 @@ use dep::types::{ constants::{ DA_BYTES_PER_FIELD, DA_GAS_PER_BYTE, FIXED_AVM_STARTUP_L2_GAS, L2_GAS_PER_LOG_BYTE, L2_GAS_PER_NOTE_HASH, L2_GAS_PER_NULLIFIER, - }, - tests::utils::{assert_array_eq, swap_items}, + }, tests::utils::{assert_array_eq, swap_items}, }; #[test] @@ -141,7 +140,7 @@ fn tail_to_public_output_composer_succeeds() { // Gas: revertible let total_num_side_effects = 2 + 1 + 1; let total_log_length = 20 // note_encrypted_log_hash - + 6 + + 6 + 24 // encrypted_log_hash + 4; // unencrypted_log_hash let computed_da_gas = diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-reset-simulated/src/main.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-reset-simulated/src/main.nr index 89199192db0..6e584b61bbe 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-reset-simulated/src/main.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-reset-simulated/src/main.nr @@ -6,8 +6,7 @@ use dep::types::{ MAX_ENCRYPTED_LOGS_PER_TX, MAX_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_NULLIFIERS_PER_TX, - }, - PrivateKernelCircuitPublicInputs, + }, PrivateKernelCircuitPublicInputs, }; use types::abis::private_kernel_data::PrivateKernelDataWithoutPublicInputs; diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-reset/src/main.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-reset/src/main.nr index a5371db73d7..67acf1f4e81 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-reset/src/main.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-reset/src/main.nr @@ -6,8 +6,7 @@ use dep::types::{ MAX_ENCRYPTED_LOGS_PER_TX, MAX_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_NULLIFIERS_PER_TX, - }, - PrivateKernelCircuitPublicInputs, + }, PrivateKernelCircuitPublicInputs, }; use types::abis::private_kernel_data::PrivateKernelDataWithoutPublicInputs; diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/enqueued_call_data_validator.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/enqueued_call_data_validator.nr index 874779c9b90..de04e28e871 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/enqueued_call_data_validator.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/enqueued_call_data_validator.nr @@ -5,9 +5,7 @@ use dep::types::{ kernel_circuit_public_inputs::PublicKernelCircuitPublicInputs, public_call_request::PublicCallRequest, validation_requests::PublicValidationRequestArrayLengths, - }, - constants::MAX_L2_GAS_PER_ENQUEUED_CALL, - utils::arrays::array_length, + }, constants::MAX_L2_GAS_PER_ENQUEUED_CALL, utils::arrays::array_length, }; pub struct EnqueuedCallDataValidator { diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_kernel_output_composer.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_kernel_output_composer.nr index 0c982cd789d..e073a9d9bc5 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_kernel_output_composer.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_kernel_output_composer.nr @@ -10,10 +10,8 @@ use dep::types::{ kernel_circuit_public_inputs::{ PublicKernelCircuitPublicInputs, PublicKernelCircuitPublicInputsBuilder, VMCircuitPublicInputs, - }, - public_call_request::PublicCallRequest, - }, - traits::is_empty, + }, public_call_request::PublicCallRequest, + }, traits::is_empty, }; pub struct PublicKernelOutputComposer { diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_kernel_output_validator.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_kernel_output_validator.nr index d54de5d49e6..52e0af2d111 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_kernel_output_validator.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_kernel_output_validator.nr @@ -3,11 +3,9 @@ use dep::types::{ abis::{ accumulated_data::public_accumulated_data::{ PublicAccumulatedData, PublicAccumulatedDataArrayLengths, - }, - kernel_circuit_public_inputs::{PublicKernelCircuitPublicInputs, VMCircuitPublicInputs}, + }, kernel_circuit_public_inputs::{PublicKernelCircuitPublicInputs, VMCircuitPublicInputs}, validation_requests::public_validation_requests::PublicValidationRequestArrayLengths, - }, - traits::is_empty, + }, traits::is_empty, utils::arrays::{array_length, assert_array_appended, assert_array_prepended}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer.nr index 70f8219bf52..61a302e5187 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer.nr @@ -12,9 +12,7 @@ use crate::components::public_tail_output_composer::{ use dep::types::{ abis::kernel_circuit_public_inputs::{ KernelCircuitPublicInputs, PublicKernelCircuitPublicInputs, - }, - data::PublicDataLeafHint, - partial_state_reference::PartialStateReference, + }, data::PublicDataLeafHint, partial_state_reference::PartialStateReference, }; pub struct PublicTailOutputComposer { diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/combine_data.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/combine_data.nr index e6362a42aa8..01c537cf41f 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/combine_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/combine_data.nr @@ -2,10 +2,8 @@ use crate::components::public_tail_output_composer::generate_output_hints::Outpu use dep::types::{ abis::{ accumulated_data::{CombinedAccumulatedData, PublicAccumulatedData}, - log_hash::{LogHash, ScopedLogHash}, - nullifier::Nullifier, - }, - utils::arrays::{array_merge, dedupe_array, sort_by_counter_asc}, + log_hash::{LogHash, ScopedLogHash}, nullifier::Nullifier, + }, utils::arrays::{array_merge, dedupe_array, sort_by_counter_asc}, }; pub unconstrained fn combine_data( diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_output_hints.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_output_hints.nr index e36f4ef41a8..3d775538dc7 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_output_hints.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_output_hints.nr @@ -1,8 +1,7 @@ use crate::components::public_tail_output_composer::{ generate_overridable_public_data_writes::{ generate_overridable_public_data_writes, LinkedIndexHint, - }, - generate_public_data_leaves::generate_public_data_leaves, + }, generate_public_data_leaves::generate_public_data_leaves, }; use dep::types::{ abis::{ @@ -13,9 +12,7 @@ use dep::types::{ MAX_ENCRYPTED_LOGS_PER_TX, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_ENCRYPTED_LOGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_UNENCRYPTED_LOGS_PER_TX, - }, - data::{OverridablePublicDataTreeLeaf, PublicDataLeafHint}, - hash::silo_note_hash, + }, data::{OverridablePublicDataTreeLeaf, PublicDataLeafHint}, hash::silo_note_hash, traits::Empty, utils::arrays::{ array_merge, CombinedOrderHint, get_combined_order_hints_asc, sort_by_counter_asc, diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_overridable_public_data_writes.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_overridable_public_data_writes.nr index e18193b31be..f67768f322c 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_overridable_public_data_writes.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_overridable_public_data_writes.nr @@ -2,9 +2,7 @@ use dep::types::{ abis::{ public_data_update_request::PublicDataUpdateRequest, public_data_write::OverridablePublicDataWrite, - }, - data::OverridablePublicDataTreeLeaf, - traits::Empty, + }, data::OverridablePublicDataTreeLeaf, traits::Empty, utils::arrays::{array_length, find_index_hint}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_public_data_leaves.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_public_data_leaves.nr index 0a2f95e8392..7f73cccfe48 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_public_data_leaves.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_public_data_leaves.nr @@ -1,7 +1,6 @@ use dep::types::{ abis::{public_data_read::PublicDataRead, public_data_update_request::PublicDataUpdateRequest}, - data::{OverridablePublicDataTreeLeaf, PublicDataLeafHint, PublicDataTreeLeaf}, - traits::Empty, + data::{OverridablePublicDataTreeLeaf, PublicDataLeafHint, PublicDataTreeLeaf}, traits::Empty, utils::arrays::{get_sorted_result, SortedResult}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator.nr index 4b5da5a4d8f..1eb58595ad7 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator.nr @@ -13,14 +13,10 @@ use crate::components::{ use dep::types::{ abis::{ kernel_circuit_public_inputs::{KernelCircuitPublicInputs, PublicKernelCircuitPublicInputs}, - log_hash::{LogHash, ScopedLogHash}, - note_hash::ScopedNoteHash, - nullifier::Nullifier, + log_hash::{LogHash, ScopedLogHash}, note_hash::ScopedNoteHash, nullifier::Nullifier, public_data_update_request::PublicDataUpdateRequest, public_data_write::OverridablePublicDataWrite, - }, - data::PublicDataLeafHint, - hash::silo_note_hash, + }, data::PublicDataLeafHint, hash::silo_note_hash, messaging::l2_to_l1_message::ScopedL2ToL1Message, partial_state_reference::PartialStateReference, utils::arrays::{ diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator/validate_linked_public_data_writes.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator/validate_linked_public_data_writes.nr index 44bea48e398..cda2f56482b 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator/validate_linked_public_data_writes.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator/validate_linked_public_data_writes.nr @@ -59,9 +59,7 @@ mod tests { abis::{ public_data_update_request::PublicDataUpdateRequest, public_data_write::OverridablePublicDataWrite, - }, - data::{OverridablePublicDataTreeLeaf, PublicDataTreeLeaf}, - tests::utils::pad_end, + }, data::{OverridablePublicDataTreeLeaf, PublicDataTreeLeaf}, tests::utils::pad_end, }; struct TestBuilder { diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator/validate_unique_leaf_slots.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator/validate_unique_leaf_slots.nr index e0c3ec42171..63fd9ffea1e 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator/validate_unique_leaf_slots.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator/validate_unique_leaf_slots.nr @@ -30,8 +30,7 @@ pub fn validate_unique_leaf_slots( mod tests { use crate::components::public_tail_output_validator::validate_unique_leaf_slots::validate_unique_leaf_slots; use dep::types::{ - data::{OverridablePublicDataTreeLeaf, PublicDataTreeLeaf}, - tests::utils::pad_end, + data::{OverridablePublicDataTreeLeaf, PublicDataTreeLeaf}, tests::utils::pad_end, utils::arrays::SortedResult, }; diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/vm_circuit_output_composer.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/vm_circuit_output_composer.nr index 2a492590f23..7d938478c52 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/vm_circuit_output_composer.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/vm_circuit_output_composer.nr @@ -4,20 +4,16 @@ use crate::components::vm_circuit_output_composer::propagate_accumulated_data::p use dep::types::{ abis::{ accumulated_data::{PublicAccumulatedDataArrayLengths, PublicAccumulatedDataBuilder}, - combined_constant_data::CombinedConstantData, - gas::Gas, + combined_constant_data::CombinedConstantData, gas::Gas, kernel_circuit_public_inputs::vm_circuit_public_inputs::VMCircuitPublicInputs, public_call_request::PublicCallRequest, - public_circuit_public_inputs::PublicCircuitPublicInputs, - public_data_read::PublicDataRead, + public_circuit_public_inputs::PublicCircuitPublicInputs, public_data_read::PublicDataRead, public_inner_call_request::PublicInnerCallRequest, validation_requests::{ public_validation_requests_builder::PublicValidationRequestsBuilder, PublicValidationRequestArrayLengths, }, - }, - constants::MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, - traits::is_empty, + }, constants::MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, traits::is_empty, utils::arrays::array_to_bounded_vec, }; diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/vm_circuit_output_composer/propagate_accumulated_data.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/vm_circuit_output_composer/propagate_accumulated_data.nr index 6010ea888b4..3c1df8c3fbf 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/vm_circuit_output_composer/propagate_accumulated_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/vm_circuit_output_composer/propagate_accumulated_data.nr @@ -3,8 +3,7 @@ use dep::types::{ accumulated_data::PublicAccumulatedDataBuilder, nullifier::Nullifier, public_circuit_public_inputs::PublicCircuitPublicInputs, public_data_update_request::PublicDataUpdateRequest, - }, - hash::compute_siloed_nullifier, + }, hash::compute_siloed_nullifier, }; pub fn propagate_accumulated_data( diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_merge.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_merge.nr index 26283872651..895ddbc8c53 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_merge.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_merge.nr @@ -4,16 +4,14 @@ use crate::{ previous_kernel_validator::PreviousKernelValidator, public_kernel_output_composer::PublicKernelOutputComposer, public_kernel_output_validator::PublicKernelOutputValidator, - }, - public_kernel_phase::PublicKernelPhase, + }, public_kernel_phase::PublicKernelPhase, }; use dep::types::{ abis::{ enqueued_call_data::EnqueuedCallData, kernel_circuit_public_inputs::PublicKernelCircuitPublicInputs, public_kernel_data::PublicKernelData, - }, - constants::{PUBLIC_KERNEL_MERGE_INDEX, TUBE_INDEX}, + }, constants::{PUBLIC_KERNEL_MERGE_INDEX, TUBE_INDEX}, }; global ALLOWED_PREVIOUS_CIRCUITS = [TUBE_INDEX, PUBLIC_KERNEL_MERGE_INDEX]; @@ -91,8 +89,7 @@ mod tests { kernel_circuit_public_inputs::PublicKernelCircuitPublicInputs, max_block_number::MaxBlockNumber, validation_requests::PublicValidationRequestArrayLengths, - }, - constants::{BASE_ROLLUP_INDEX, PRIVATE_KERNEL_TAIL_TO_PUBLIC_INDEX}, + }, constants::{BASE_ROLLUP_INDEX, PRIVATE_KERNEL_TAIL_TO_PUBLIC_INDEX}, tests::{fixture_builder::FixtureBuilder, utils::assert_array_eq}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_tail.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_tail.nr index 6f28560c91e..33f7881cdbf 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_tail.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_tail.nr @@ -3,17 +3,13 @@ use crate::{ previous_kernel_validator::PreviousKernelValidator, public_tail_output_composer::{OutputHints, PublicTailOutputComposer}, public_tail_output_validator::PublicTailOutputValidator, - }, - public_kernel_phase::PublicKernelPhase, + }, public_kernel_phase::PublicKernelPhase, }; use dep::reset_kernel_lib::{ - NullifierNonExistentReadRequestHints, - NullifierReadRequestHints, + NullifierNonExistentReadRequestHints, NullifierReadRequestHints, public_data_read_request_hints::{ build_public_data_read_request_hints, PublicDataReadRequestHints, - }, - PublicValidationRequestProcessor, - TreeLeafReadRequestHint, + }, PublicValidationRequestProcessor, TreeLeafReadRequestHint, }; use dep::types::{ abis::{ @@ -25,9 +21,7 @@ use dep::types::{ MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_PUBLIC_DATA_HINTS, MAX_PUBLIC_DATA_READS_PER_TX, NOTE_HASH_TREE_HEIGHT, PUBLIC_KERNEL_MERGE_INDEX, - }, - data::PublicDataLeafHint, - partial_state_reference::PartialStateReference, + }, data::PublicDataLeafHint, partial_state_reference::PartialStateReference, }; global ALLOWED_PREVIOUS_CIRCUITS = [PUBLIC_KERNEL_MERGE_INDEX]; @@ -103,16 +97,14 @@ mod tests { tests::{ nullifier_non_existent_read_request_hints_builder::NullifierNonExistentReadRequestHintsBuilder, nullifier_read_request_hints_builder::NullifierReadRequestHintsBuilder, - }, - TreeLeafReadRequestHint, + }, TreeLeafReadRequestHint, }; use dep::types::{ abis::{ kernel_circuit_public_inputs::KernelCircuitPublicInputs, nullifier::ScopedNullifier, nullifier_leaf_preimage::NullifierLeafPreimage, public_data_update_request::PublicDataUpdateRequest, - }, - address::AztecAddress, + }, address::AztecAddress, constants::{ BASE_ROLLUP_INDEX, L1_TO_L2_MSG_TREE_HEIGHT, MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NOTE_HASHES_PER_TX, @@ -122,18 +114,13 @@ mod tests { NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, NULLIFIER_TREE_HEIGHT, PUBLIC_DATA_SUBTREE_HEIGHT, PUBLIC_DATA_SUBTREE_SIBLING_PATH_LENGTH, PUBLIC_DATA_TREE_HEIGHT, PUBLIC_KERNEL_MERGE_INDEX, - }, - data::{PublicDataLeafHint, PublicDataTreeLeafPreimage}, - hash::{compute_siloed_nullifier, silo_note_hash}, - merkle_tree::MembershipWitness, + }, data::{PublicDataLeafHint, PublicDataTreeLeafPreimage}, + hash::{compute_siloed_nullifier, silo_note_hash}, merkle_tree::MembershipWitness, partial_state_reference::PartialStateReference, tests::{ - fixture_builder::FixtureBuilder, - merkle_tree_utils::NonEmptyMerkleTree, + fixture_builder::FixtureBuilder, merkle_tree_utils::NonEmptyMerkleTree, utils::{assert_array_eq, pad_end, swap_items}, - }, - traits::is_empty, - utils::arrays::{array_merge, find_index_hint}, + }, traits::is_empty, utils::arrays::{array_merge, find_index_hint}, }; fn build_note_hash_tree( diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/note_hash_read_request_reset.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/note_hash_read_request_reset.nr index 52aa039a2b6..1cfcb5369e4 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/note_hash_read_request_reset.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/note_hash_read_request_reset.nr @@ -52,13 +52,9 @@ mod tests { }; use dep::types::{ abis::{ - note_hash::{NoteHash, ScopedNoteHash}, - note_hash_leaf_preimage::NoteHashLeafPreimage, + note_hash::{NoteHash, ScopedNoteHash}, note_hash_leaf_preimage::NoteHashLeafPreimage, read_request::{ReadRequest, ScopedReadRequest}, - }, - address::AztecAddress, - constants::NOTE_HASH_TREE_HEIGHT, - hash::compute_siloed_note_hash, + }, address::AztecAddress, constants::NOTE_HASH_TREE_HEIGHT, hash::compute_siloed_note_hash, merkle_tree::MembershipWitness, tests::{merkle_tree_utils::NonEmptyMerkleTree, utils::assert_array_eq}, traits::is_empty_array, diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/nullifier_non_existent_read_request_reset.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/nullifier_non_existent_read_request_reset.nr index 4068202c37b..496f899bddf 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/nullifier_non_existent_read_request_reset.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/nullifier_non_existent_read_request_reset.nr @@ -4,8 +4,7 @@ use dep::types::{ constants::{ MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX, MAX_NULLIFIERS_PER_TX, NULLIFIER_TREE_HEIGHT, - }, - merkle_tree::MembershipWitness, + }, merkle_tree::MembershipWitness, }; pub struct NullifierNonMembershipHint { diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/nullifier_read_request_reset.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/nullifier_read_request_reset.nr index 96a5fac86d0..87653104bff 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/nullifier_read_request_reset.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/nullifier_read_request_reset.nr @@ -52,13 +52,9 @@ mod tests { }; use dep::types::{ abis::{ - nullifier::{Nullifier, ScopedNullifier}, - nullifier_leaf_preimage::NullifierLeafPreimage, + nullifier::{Nullifier, ScopedNullifier}, nullifier_leaf_preimage::NullifierLeafPreimage, read_request::{ReadRequest, ScopedReadRequest}, - }, - address::AztecAddress, - constants::NULLIFIER_TREE_HEIGHT, - hash::compute_siloed_nullifier, + }, address::AztecAddress, constants::NULLIFIER_TREE_HEIGHT, hash::compute_siloed_nullifier, merkle_tree::MembershipWitness, tests::{merkle_tree_utils::NonEmptyMerkleTree, utils::assert_array_eq}, traits::is_empty_array, diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/private_validation_request_processor.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/private_validation_request_processor.nr index 8f641126807..b424985384f 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/private_validation_request_processor.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/private_validation_request_processor.nr @@ -5,16 +5,14 @@ use crate::{ key_validation_hint::{ get_unverified_key_validation_requests, KeyValidationHint, verify_reset_key_validation_requests, - }, - read_request::{get_unverified_read_requests, verify_reset_read_requests}, + }, read_request::{get_unverified_read_requests, verify_reset_read_requests}, }, }; use dep::types::{ abis::{ note_hash::ScopedNoteHash, nullifier::ScopedNullifier, validation_requests::PrivateValidationRequests, - }, - constants::{MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX}, + }, constants::{MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX}, }; pub struct PrivateValidationRequestProcessor { diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/public_data_read_request_hints.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/public_data_read_request_hints.nr index 2b8effeed0a..e54d5e0cc31 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/public_data_read_request_hints.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/public_data_read_request_hints.nr @@ -1,8 +1,7 @@ use crate::reset::{mutable_data_read_request::ReadIndexHint, read_request::ReadRequestStatus}; use dep::types::{ abis::{public_data_read::PublicDataRead, public_data_write::OverridablePublicDataWrite}, - data::OverridablePublicDataTreeLeaf, - utils::arrays::find_index_hint, + data::OverridablePublicDataTreeLeaf, utils::arrays::find_index_hint, }; pub struct PublicDataReadRequestHints { diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/public_validation_request_processor.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/public_validation_request_processor.nr index 103a358d287..be593a6df38 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/public_validation_request_processor.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/public_validation_request_processor.nr @@ -19,11 +19,8 @@ use dep::types::{ L1_TO_L2_MSG_TREE_HEIGHT, MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PUBLIC_DATA_READS_PER_TX, NOTE_HASH_TREE_HEIGHT, - }, - data::OverridablePublicDataTreeLeaf, - hash::compute_siloed_nullifier, - partial_state_reference::PartialStateReference, - traits::is_empty, + }, data::OverridablePublicDataTreeLeaf, hash::compute_siloed_nullifier, + partial_state_reference::PartialStateReference, traits::is_empty, utils::arrays::{ array_to_bounded_vec, assert_combined_array, assert_sorted_array, combine_arrays, }, diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/mutable_data_read_request.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/mutable_data_read_request.nr index 87027b7e18f..e321873fc5f 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/mutable_data_read_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/mutable_data_read_request.nr @@ -123,18 +123,13 @@ mod tests { mutable_data_read_request::{ ensure_all_read_requests_are_verified, ReadIndexHint, reset_mutable_data_read_requests, validate_leaf_data_read_requests, validate_pending_read_requests, - }, - read_request::{ReadRequestState, ReadRequestStatus}, + }, read_request::{ReadRequestState, ReadRequestStatus}, }; use dep::types::{ abis::{ - public_data_read::PublicDataRead, - public_data_update_request::PublicDataUpdateRequest, - public_data_write::OverridablePublicDataWrite, - side_effect::{Overridable, Readable}, - }, - tests::utils::pad_end, - traits::Empty, + public_data_read::PublicDataRead, public_data_update_request::PublicDataUpdateRequest, + public_data_write::OverridablePublicDataWrite, side_effect::{Overridable, Readable}, + }, tests::utils::pad_end, traits::Empty, }; struct TestLeafData { diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/non_existent_read_request.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/non_existent_read_request.nr index 3cd22aa7443..af3ab9a611c 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/non_existent_read_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/non_existent_read_request.nr @@ -112,8 +112,7 @@ mod tests { }; use dep::types::{ - abis::{read_request::ReadRequest, side_effect::OrderedValue}, - address::AztecAddress, + abis::{read_request::ReadRequest, side_effect::OrderedValue}, address::AztecAddress, merkle_tree::{leaf_preimage::IndexedTreeLeafPreimage, membership::MembershipWitness}, tests::merkle_tree_utils::NonEmptyMerkleTree, }; diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/read_request.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/read_request.nr index 5e82fc20751..e32fbb788e7 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/read_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/read_request.nr @@ -1,8 +1,7 @@ // This will be moved to a separate Read Request Reset Circuit. use dep::types::{ abis::{read_request::ScopedReadRequest, side_effect::Readable}, - merkle_tree::{assert_check_membership, LeafPreimage, MembershipWitness}, - traits::Empty, + merkle_tree::{assert_check_membership, LeafPreimage, MembershipWitness}, traits::Empty, }; pub struct ReadRequestStateEnum { @@ -200,8 +199,7 @@ mod tests { }; use dep::types::{ abis::{read_request::{ReadRequest, ScopedReadRequest}, side_effect::Readable}, - address::AztecAddress, - merkle_tree::{LeafPreimage, MembershipWitness}, + address::AztecAddress, merkle_tree::{LeafPreimage, MembershipWitness}, tests::{merkle_tree_utils::NonEmptyMerkleTree, utils::assert_array_eq}, traits::{Empty, is_empty_array}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/transient_data.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/transient_data.nr index 19471c18b8a..fad6c81c520 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/transient_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/transient_data.nr @@ -198,11 +198,9 @@ mod tests { }; use dep::types::{ abis::{ - log_hash::NoteLogHash, - note_hash::{NoteHash, ScopedNoteHash}, + log_hash::NoteLogHash, note_hash::{NoteHash, ScopedNoteHash}, nullifier::{Nullifier, ScopedNullifier}, - }, - address::AztecAddress, + }, address::AztecAddress, }; global contract_address = AztecAddress::from_field(987654); diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/tests/nullifier_non_existent_read_request_hints_builder.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/tests/nullifier_non_existent_read_request_hints_builder.nr index a7d48860ad1..7035c32ede1 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/tests/nullifier_non_existent_read_request_hints_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/tests/nullifier_non_existent_read_request_hints_builder.nr @@ -6,9 +6,7 @@ use dep::types::{ constants::{ MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX, MAX_NULLIFIERS_PER_TX, NULLIFIER_SUBTREE_HEIGHT, NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, NULLIFIER_TREE_HEIGHT, - }, - merkle_tree::MembershipWitness, - tests::merkle_tree_utils::NonEmptyMerkleTree, + }, merkle_tree::MembershipWitness, tests::merkle_tree_utils::NonEmptyMerkleTree, utils::arrays::{find_index_hint, get_sorted_result}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/base_or_merge_rollup_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/base_or_merge_rollup_public_inputs.nr index bd9e7994bbb..f778fa569ce 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/base_or_merge_rollup_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/base_or_merge_rollup_public_inputs.nr @@ -1,9 +1,7 @@ use crate::abis::constant_rollup_data::ConstantRollupData; use dep::types::{ - constants::BASE_OR_MERGE_PUBLIC_INPUTS_LENGTH, - partial_state_reference::PartialStateReference, - traits::{Deserialize, Empty, Serialize}, - utils::reader::Reader, + constants::BASE_OR_MERGE_PUBLIC_INPUTS_LENGTH, partial_state_reference::PartialStateReference, + traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; global BASE_ROLLUP_TYPE = 0; diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/block_root_or_block_merge_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/block_root_or_block_merge_public_inputs.nr index 5f4d14647f1..245b39c702a 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/block_root_or_block_merge_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/block_root_or_block_merge_public_inputs.nr @@ -3,9 +3,7 @@ use dep::types::{ address::EthAddress, constants::{ AZTEC_EPOCH_DURATION, BLOCK_ROOT_OR_BLOCK_MERGE_PUBLIC_INPUTS_LENGTH, FEE_RECIPIENT_LENGTH, - }, - traits::{Deserialize, Empty, Serialize}, - utils::reader::Reader, + }, traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; pub struct FeeRecipient { diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/constant_rollup_data.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/constant_rollup_data.nr index 1d798746866..7307ecf4172 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/constant_rollup_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/constant_rollup_data.nr @@ -1,7 +1,6 @@ use dep::types::{ abis::{append_only_tree_snapshot::AppendOnlyTreeSnapshot, global_variables::GlobalVariables}, - constants::CONSTANT_ROLLUP_DATA_LENGTH, - traits::{Deserialize, Empty, Serialize}, + constants::CONSTANT_ROLLUP_DATA_LENGTH, traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_block_data.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_block_data.nr index 3a9c2ab9f02..dd3efcedc72 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_block_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_block_data.nr @@ -3,12 +3,9 @@ use dep::types::{ constants::VK_TREE_HEIGHT, merkle_tree::{membership::assert_check_membership, MembershipWitness}, recursion::{ - proof::NestedRecursiveProof, - traits::Verifiable, + proof::NestedRecursiveProof, traits::Verifiable, verification_key::{HonkVerificationKey, VerificationKey}, - }, - traits::Empty, - utils::arrays::find_index_hint, + }, traits::Empty, utils::arrays::find_index_hint, }; pub struct PreviousRollupBlockData { diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_data.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_data.nr index a9e771d19d1..0deb3b479cb 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_data.nr @@ -3,12 +3,9 @@ use dep::types::{ constants::VK_TREE_HEIGHT, merkle_tree::{membership::assert_check_membership, MembershipWitness}, recursion::{ - proof::NestedRecursiveProof, - traits::Verifiable, + proof::NestedRecursiveProof, traits::Verifiable, verification_key::{HonkVerificationKey, VerificationKey}, - }, - traits::Empty, - utils::arrays::find_index_hint, + }, traits::Empty, utils::arrays::find_index_hint, }; pub struct PreviousRollupData { diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/base_rollup_inputs.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/base_rollup_inputs.nr index 4b74c94aa43..f5d7b6797cc 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/base_rollup_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/base_rollup_inputs.nr @@ -2,8 +2,7 @@ use crate::{ abis::{ base_or_merge_rollup_public_inputs::{BASE_ROLLUP_TYPE, BaseOrMergeRollupPublicInputs}, constant_rollup_data::ConstantRollupData, - }, - base::state_diff_hints::StateDiffHints, + }, base::state_diff_hints::StateDiffHints, components::{compute_kernel_out_hash, compute_tx_effects_hash}, }; use dep::types::{ @@ -11,8 +10,7 @@ use dep::types::{ append_only_tree_snapshot::AppendOnlyTreeSnapshot, kernel_data::KernelData, nullifier_leaf_preimage::NullifierLeafPreimage, public_data_update_request::PublicDataUpdateRequest, - }, - address::AztecAddress, + }, address::AztecAddress, constants::{ ARCHIVE_HEIGHT, FEE_JUICE_ADDRESS, MAX_NOTE_HASHES_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, @@ -23,20 +21,14 @@ use dep::types::{ }, data::{ hash::{compute_public_data_tree_index, compute_public_data_tree_value}, - public_data_hint::PublicDataHint, - PublicDataTreeLeaf, - PublicDataTreeLeafPreimage, - }, - hash::silo_l2_to_l1_message, + public_data_hint::PublicDataHint, PublicDataTreeLeaf, PublicDataTreeLeafPreimage, + }, hash::silo_l2_to_l1_message, merkle_tree::{ append_only_tree, assert_check_membership, calculate_empty_tree_root, calculate_subtree_root, indexed_tree, MembershipWitness, - }, - messaging::l2_to_l1_message::ScopedL2ToL1Message, - partial_state_reference::PartialStateReference, - storage::map::derive_storage_slot_in_map, - traits::is_empty, - utils::field::{full_field_greater_than, full_field_less_than}, + }, messaging::l2_to_l1_message::ScopedL2ToL1Message, + partial_state_reference::PartialStateReference, storage::map::derive_storage_slot_in_map, + traits::is_empty, utils::field::{full_field_greater_than, full_field_less_than}, }; global ALLOWED_PREVIOUS_CIRCUITS = @@ -514,16 +506,14 @@ mod tests { base::{ base_rollup_inputs::{BaseRollupInputs, compute_fee_payer_fee_juice_balance_leaf_slot}, state_diff_hints::StateDiffHints, - }, - components::TX_EFFECTS_HASH_INPUT_FIELDS, + }, components::TX_EFFECTS_HASH_INPUT_FIELDS, }; use dep::types::{ abis::{ append_only_tree_snapshot::AppendOnlyTreeSnapshot, kernel_data::KernelData, nullifier_leaf_preimage::NullifierLeafPreimage, public_data_update_request::PublicDataUpdateRequest, - }, - address::{AztecAddress, EthAddress}, + }, address::{AztecAddress, EthAddress}, constants::{ ARCHIVE_HEIGHT, BASE_ROLLUP_INDEX, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, @@ -534,10 +524,8 @@ mod tests { PROTOCOL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, PUBLIC_DATA_SUBTREE_HEIGHT, PUBLIC_DATA_SUBTREE_SIBLING_PATH_LENGTH, PUBLIC_DATA_TREE_HEIGHT, PUBLIC_KERNEL_TAIL_INDEX, TUBE_INDEX, - }, - data::{public_data_hint::PublicDataHint, PublicDataTreeLeaf, PublicDataTreeLeafPreimage}, - hash::silo_l2_to_l1_message, - merkle_tree::MembershipWitness, + }, data::{public_data_hint::PublicDataHint, PublicDataTreeLeaf, PublicDataTreeLeafPreimage}, + hash::silo_l2_to_l1_message, merkle_tree::MembershipWitness, messaging::l2_to_l1_message::ScopedL2ToL1Message, partial_state_reference::PartialStateReference, tests::{fixture_builder::FixtureBuilder, fixtures, merkle_tree_utils::NonEmptyMerkleTree}, diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/state_diff_hints.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/state_diff_hints.nr index 5015f7ed779..27c46e2a1b9 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/state_diff_hints.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/state_diff_hints.nr @@ -4,8 +4,7 @@ use dep::types::{ MAX_NULLIFIERS_PER_TX, NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH, NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, NULLIFIER_TREE_HEIGHT, PUBLIC_DATA_SUBTREE_SIBLING_PATH_LENGTH, - }, - merkle_tree::MembershipWitness, + }, merkle_tree::MembershipWitness, }; pub struct StateDiffHints { diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/block_root/block_root_rollup_inputs.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/block_root/block_root_rollup_inputs.nr index 845d5b056ea..748171ffad4 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/block_root/block_root_rollup_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/block_root/block_root_rollup_inputs.nr @@ -2,8 +2,7 @@ use crate::{ abis::{ block_root_or_block_merge_public_inputs::{BlockRootOrBlockMergePublicInputs, FeeRecipient}, previous_rollup_data::PreviousRollupData, - }, - components, + }, components, }; use parity_lib::root::root_rollup_parity_input::RootRollupParityInput; use types::{ @@ -12,11 +11,8 @@ use types::{ ARCHIVE_HEIGHT, AZTEC_EPOCH_DURATION, BASE_ROLLUP_INDEX, L1_TO_L2_MSG_SUBTREE_HEIGHT, L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, MERGE_ROLLUP_INDEX, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, - }, - content_commitment::ContentCommitment, - header::Header, - merkle_tree::{append_only_tree, calculate_empty_tree_root}, - state_reference::StateReference, + }, content_commitment::ContentCommitment, header::Header, + merkle_tree::{append_only_tree, calculate_empty_tree_root}, state_reference::StateReference, traits::Empty, }; use types::debug_log::debug_log_format; diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/components.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/components.nr index 68bdd43b3d8..06e9c4b7a3a 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/components.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/components.nr @@ -7,8 +7,7 @@ use crate::abis::{ }; use dep::types::{ abis::{ - accumulated_data::CombinedAccumulatedData, - log_hash::{LogHash, ScopedLogHash}, + accumulated_data::CombinedAccumulatedData, log_hash::{LogHash, ScopedLogHash}, public_data_update_request::PublicDataUpdateRequest, }, constants::{ @@ -19,9 +18,7 @@ use dep::types::{ hash::{ accumulate_sha256, compute_tx_logs_hash, compute_tx_note_logs_hash, silo_encrypted_log_hash, silo_unencrypted_log_hash, - }, - merkle_tree::VariableMerkleTree, - utils::arrays::{array_length, array_merge}, + }, merkle_tree::VariableMerkleTree, utils::arrays::{array_length, array_merge}, }; /** @@ -361,7 +358,7 @@ fn get_all_update_requests_for_tx_effects( #[test] fn consistent_TX_EFFECTS_HASH_INPUT_FIELDS() { let expected_size = 1 // revert code - + 1 // transaction fee + + 1 // transaction fee + MAX_NOTE_HASHES_PER_TX + MAX_NULLIFIERS_PER_TX + MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX * 2 diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/tests/block_root_rollup_inputs.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/tests/block_root_rollup_inputs.nr index 7a213dc35da..4efd596f174 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/tests/block_root_rollup_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/tests/block_root_rollup_inputs.nr @@ -6,8 +6,7 @@ use dep::types::{ constants::{ ARCHIVE_HEIGHT, L1_TO_L2_MSG_SUBTREE_HEIGHT, L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, L1_TO_L2_MSG_TREE_HEIGHT, - }, - tests::merkle_tree_utils::compute_zero_hashes, + }, tests::merkle_tree_utils::compute_zero_hashes, }; pub fn compute_l1_l2_empty_snapshot() -> (AppendOnlyTreeSnapshot, [Field; L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH]) { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/combined_accumulated_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/combined_accumulated_data.nr index 56116a56531..5eac2c67caa 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/combined_accumulated_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/combined_accumulated_data.nr @@ -1,16 +1,13 @@ use crate::{ abis::{ - gas::Gas, - log_hash::{LogHash, ScopedLogHash}, + gas::Gas, log_hash::{LogHash, ScopedLogHash}, public_data_update_request::PublicDataUpdateRequest, }, constants::{ COMBINED_ACCUMULATED_DATA_LENGTH, MAX_ENCRYPTED_LOGS_PER_TX, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_ENCRYPTED_LOGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_UNENCRYPTED_LOGS_PER_TX, - }, - messaging::l2_to_l1_message::ScopedL2ToL1Message, - traits::{Deserialize, Empty, Serialize}, + }, messaging::l2_to_l1_message::ScopedL2ToL1Message, traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/private_accumulated_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/private_accumulated_data.nr index b7aee6d64c6..219b8ac1e55 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/private_accumulated_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/private_accumulated_data.nr @@ -1,13 +1,9 @@ use crate::{ abis::{ - log_hash::{NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, - note_hash::ScopedNoteHash, - nullifier::ScopedNullifier, - private_call_request::PrivateCallRequest, + log_hash::{NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, note_hash::ScopedNoteHash, + nullifier::ScopedNullifier, private_call_request::PrivateCallRequest, public_call_request::PublicCallRequest, - }, - messaging::l2_to_l1_message::ScopedL2ToL1Message, - traits::{Deserialize, Empty, Serialize}, + }, messaging::l2_to_l1_message::ScopedL2ToL1Message, traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; use crate::constants::{ diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/private_accumulated_data_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/private_accumulated_data_builder.nr index 3bd58cddbcf..d6620f0244e 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/private_accumulated_data_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/private_accumulated_data_builder.nr @@ -1,19 +1,15 @@ use crate::{ abis::{ accumulated_data::private_accumulated_data::PrivateAccumulatedData, - log_hash::{NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, - note_hash::ScopedNoteHash, - nullifier::ScopedNullifier, - private_call_request::PrivateCallRequest, + log_hash::{NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, note_hash::ScopedNoteHash, + nullifier::ScopedNullifier, private_call_request::PrivateCallRequest, public_call_request::PublicCallRequest, }, constants::{ MAX_ENCRYPTED_LOGS_PER_TX, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_ENCRYPTED_LOGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_UNENCRYPTED_LOGS_PER_TX, - }, - messaging::l2_to_l1_message::ScopedL2ToL1Message, - traits::Empty, + }, messaging::l2_to_l1_message::ScopedL2ToL1Message, traits::Empty, }; pub struct PrivateAccumulatedDataBuilder { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_data.nr index 4c1ddda3649..1f188520960 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_data.nr @@ -1,10 +1,7 @@ use crate::{ abis::{ - gas::Gas, - log_hash::{LogHash, ScopedLogHash}, - note_hash::ScopedNoteHash, - nullifier::Nullifier, - public_call_request::PublicCallRequest, + gas::Gas, log_hash::{LogHash, ScopedLogHash}, note_hash::ScopedNoteHash, + nullifier::Nullifier, public_call_request::PublicCallRequest, public_data_update_request::PublicDataUpdateRequest, }, constants::{ @@ -12,9 +9,7 @@ use crate::{ MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_UNENCRYPTED_LOGS_PER_TX, NUM_PUBLIC_ACCUMULATED_DATA_ARRAYS, PUBLIC_ACCUMULATED_DATA_LENGTH, - }, - messaging::l2_to_l1_message::ScopedL2ToL1Message, - traits::{Deserialize, Empty, Serialize}, + }, messaging::l2_to_l1_message::ScopedL2ToL1Message, traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_length, reader::Reader}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_data_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_data_builder.nr index 98b52060000..875cc29f53c 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_data_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_data_builder.nr @@ -1,20 +1,14 @@ use crate::{ abis::{ - accumulated_data::public_accumulated_data::PublicAccumulatedData, - gas::Gas, - log_hash::{LogHash, ScopedLogHash}, - note_hash::ScopedNoteHash, - nullifier::Nullifier, - public_call_request::PublicCallRequest, - public_data_update_request::PublicDataUpdateRequest, + accumulated_data::public_accumulated_data::PublicAccumulatedData, gas::Gas, + log_hash::{LogHash, ScopedLogHash}, note_hash::ScopedNoteHash, nullifier::Nullifier, + public_call_request::PublicCallRequest, public_data_update_request::PublicDataUpdateRequest, }, constants::{ MAX_ENCRYPTED_LOGS_PER_TX, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_ENCRYPTED_LOGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_UNENCRYPTED_LOGS_PER_TX, - }, - messaging::l2_to_l1_message::ScopedL2ToL1Message, - traits::Empty, + }, messaging::l2_to_l1_message::ScopedL2ToL1Message, traits::Empty, utils::arrays::array_to_bounded_vec, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/call_context.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/call_context.nr index 6eafed0eedd..1743d4ada08 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/call_context.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/call_context.nr @@ -1,9 +1,6 @@ use crate::{ - abis::function_selector::FunctionSelector, - address::AztecAddress, - constants::CALL_CONTEXT_LENGTH, - traits::{Deserialize, Empty, Serialize}, - utils::reader::Reader, + abis::function_selector::FunctionSelector, address::AztecAddress, + constants::CALL_CONTEXT_LENGTH, traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; // docs:start:call-context diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/function_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/function_data.nr index 2366cb99ab7..93ec5c40d2d 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/function_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/function_data.nr @@ -1,6 +1,5 @@ use crate::{ - abis::function_selector::FunctionSelector, - constants::FUNCTION_DATA_LENGTH, + abis::function_selector::FunctionSelector, constants::FUNCTION_DATA_LENGTH, traits::{Deserialize, Empty, Serialize}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/gas.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/gas.nr index ccd0c236802..b1eef3247e0 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/gas.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/gas.nr @@ -1,6 +1,5 @@ use crate::{ - abis::gas_fees::GasFees, - constants::{FIXED_DA_GAS, FIXED_L2_GAS, GAS_LENGTH}, + abis::gas_fees::GasFees, constants::{FIXED_DA_GAS, FIXED_L2_GAS, GAS_LENGTH}, traits::{Deserialize, Empty, Serialize}, }; use std::ops::{Add, Sub}; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/gas_settings.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/gas_settings.nr index bf31b75ac47..ba234e90680 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/gas_settings.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/gas_settings.nr @@ -3,9 +3,7 @@ use crate::{ constants::{ DEFAULT_GAS_LIMIT, DEFAULT_INCLUSION_FEE, DEFAULT_MAX_FEE_PER_GAS, DEFAULT_TEARDOWN_GAS_LIMIT, GAS_SETTINGS_LENGTH, - }, - traits::{Deserialize, Empty, Serialize}, - utils::reader::Reader, + }, traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; pub struct GasSettings { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/global_variables.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/global_variables.nr index abcfab91273..7c4b277f89d 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/global_variables.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/global_variables.nr @@ -1,8 +1,6 @@ use crate::{ - abis::gas_fees::GasFees, - address::{AztecAddress, EthAddress}, - constants::GLOBAL_VARIABLES_LENGTH, - traits::{Deserialize, Empty, Serialize}, + abis::gas_fees::GasFees, address::{AztecAddress, EthAddress}, + constants::GLOBAL_VARIABLES_LENGTH, traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/kernel_circuit_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/kernel_circuit_public_inputs.nr index 5743fdb34a3..b1c818b30be 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/kernel_circuit_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/kernel_circuit_public_inputs.nr @@ -2,11 +2,8 @@ use crate::{ abis::{ accumulated_data::CombinedAccumulatedData, combined_constant_data::CombinedConstantData, gas_fees::GasFees, validation_requests::RollupValidationRequests, - }, - address::AztecAddress, - constants::KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH, - partial_state_reference::PartialStateReference, - traits::{Deserialize, Empty, Serialize}, + }, address::AztecAddress, constants::KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH, + partial_state_reference::PartialStateReference, traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs.nr index 647d8d6fc88..5788947a74d 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs.nr @@ -2,11 +2,8 @@ use crate::{ abis::{ accumulated_data::PrivateAccumulatedData, combined_constant_data::CombinedConstantData, public_call_request::PublicCallRequest, validation_requests::PrivateValidationRequests, - }, - address::AztecAddress, - constants::PRIVATE_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH, - traits::{Deserialize, Empty, Serialize}, - utils::{arrays::array_length, reader::Reader}, + }, address::AztecAddress, constants::PRIVATE_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH, + traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_length, reader::Reader}, }; pub struct PrivateKernelCircuitPublicInputsArrayLengths { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs_builder.nr index c602171f27d..94a770fbf9d 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs_builder.nr @@ -5,9 +5,7 @@ use crate::{ kernel_circuit_public_inputs::private_kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, public_call_request::PublicCallRequest, validation_requests::PrivateValidationRequestsBuilder, - }, - address::AztecAddress, - traits::Empty, + }, address::AztecAddress, traits::Empty, }; pub struct PrivateKernelCircuitPublicInputsBuilder { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/public_kernel_circuit_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/public_kernel_circuit_public_inputs.nr index 7e7921f340e..e7134be57c4 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/public_kernel_circuit_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/public_kernel_circuit_public_inputs.nr @@ -2,11 +2,8 @@ use crate::{ abis::{ accumulated_data::PublicAccumulatedData, combined_constant_data::CombinedConstantData, public_call_request::PublicCallRequest, validation_requests::PublicValidationRequests, - }, - address::AztecAddress, - constants::PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH, - traits::{Deserialize, Empty, Serialize}, - utils::reader::Reader, + }, address::AztecAddress, constants::PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH, + traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; pub struct PublicKernelCircuitPublicInputs { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/public_kernel_circuit_public_inputs_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/public_kernel_circuit_public_inputs_builder.nr index f81c736f9bd..87d4a1f7e37 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/public_kernel_circuit_public_inputs_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/public_kernel_circuit_public_inputs_builder.nr @@ -5,9 +5,7 @@ use crate::{ kernel_circuit_public_inputs::public_kernel_circuit_public_inputs::PublicKernelCircuitPublicInputs, public_call_request::PublicCallRequest, validation_requests::PublicValidationRequestsBuilder, - }, - address::AztecAddress, - traits::Empty, + }, address::AztecAddress, traits::Empty, }; pub struct PublicKernelCircuitPublicInputsBuilder { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/vm_circuit_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/vm_circuit_public_inputs.nr index 2bfd1cfe59d..5dd9501d42a 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/vm_circuit_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/vm_circuit_public_inputs.nr @@ -1,15 +1,11 @@ use crate::{ abis::{ accumulated_data::{PublicAccumulatedData, PublicAccumulatedDataArrayLengths}, - combined_constant_data::CombinedConstantData, - gas::Gas, - public_call_request::PublicCallRequest, - public_inner_call_request::PublicInnerCallRequest, + combined_constant_data::CombinedConstantData, gas::Gas, + public_call_request::PublicCallRequest, public_inner_call_request::PublicInnerCallRequest, validation_requests::{PublicValidationRequestArrayLengths, PublicValidationRequests}, - }, - constants::{MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, VM_CIRCUIT_PUBLIC_INPUTS_LENGTH}, - traits::{Deserialize, Empty, Serialize}, - utils::reader::Reader, + }, constants::{MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, VM_CIRCUIT_PUBLIC_INPUTS_LENGTH}, + traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; pub struct VMCircuitPublicInputs { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_data.nr index ba83686a0a8..b44dcb401d5 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_data.nr @@ -1,11 +1,9 @@ use crate::{ abis::kernel_circuit_public_inputs::KernelCircuitPublicInputs, - constants::{TUBE_INDEX, VK_TREE_HEIGHT}, - merkle_tree::membership::check_membership, + constants::{TUBE_INDEX, VK_TREE_HEIGHT}, merkle_tree::membership::check_membership, recursion::{ proof::NestedRecursiveProof, traits::Verifiable, verification_key::HonkVerificationKey, - }, - utils::arrays::find_index_hint, + }, utils::arrays::find_index_hint, }; pub struct KernelData { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/log_hash.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/log_hash.nr index 6969df71a5e..b35ff5743cc 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/log_hash.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/log_hash.nr @@ -1,12 +1,9 @@ use crate::{ - abis::side_effect::{Ordered, OrderedValue, Scoped}, - address::AztecAddress, + abis::side_effect::{Ordered, OrderedValue, Scoped}, address::AztecAddress, constants::{ ENCRYPTED_LOG_HASH_LENGTH, LOG_HASH_LENGTH, NOTE_LOG_HASH_LENGTH, SCOPED_ENCRYPTED_LOG_HASH_LENGTH, SCOPED_LOG_HASH_LENGTH, - }, - traits::{Deserialize, Empty, Serialize}, - utils::{arrays::array_concat, reader::Reader}, + }, traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_concat, reader::Reader}, }; pub struct LogHash { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/note_hash.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/note_hash.nr index 83063fe84cc..f6ab8cd1dba 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/note_hash.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/note_hash.nr @@ -1,9 +1,7 @@ use crate::{ abis::{read_request::ScopedReadRequest, side_effect::{Ordered, OrderedValue, Readable, Scoped}}, - address::AztecAddress, - constants::{NOTE_HASH_LENGTH, SCOPED_NOTE_HASH_LENGTH}, - traits::{Deserialize, Empty, Serialize}, - utils::{arrays::array_concat, reader::Reader}, + address::AztecAddress, constants::{NOTE_HASH_LENGTH, SCOPED_NOTE_HASH_LENGTH}, + traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_concat, reader::Reader}, }; pub struct NoteHash { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/note_hash_leaf_preimage.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/note_hash_leaf_preimage.nr index 0c8d740f55e..1c0cedca919 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/note_hash_leaf_preimage.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/note_hash_leaf_preimage.nr @@ -1,10 +1,8 @@ global NOTE_HASH_LEAF_PREIMAGE_LENGTH: u32 = 1; use crate::{ - abis::{read_request::ScopedReadRequest, side_effect::Readable}, - hash::compute_siloed_note_hash, - merkle_tree::leaf_preimage::LeafPreimage, - traits::Empty, + abis::{read_request::ScopedReadRequest, side_effect::Readable}, hash::compute_siloed_note_hash, + merkle_tree::leaf_preimage::LeafPreimage, traits::Empty, }; pub struct NoteHashLeafPreimage { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/nullifier.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/nullifier.nr index fdfe8e26425..ccce9822db2 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/nullifier.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/nullifier.nr @@ -1,9 +1,7 @@ use crate::{ abis::{read_request::ScopedReadRequest, side_effect::{Ordered, OrderedValue, Readable, Scoped}}, - address::AztecAddress, - constants::{NULLIFIER_LENGTH, SCOPED_NULLIFIER_LENGTH}, - hash::compute_siloed_nullifier, - traits::{Deserialize, Empty, Serialize}, + address::AztecAddress, constants::{NULLIFIER_LENGTH, SCOPED_NULLIFIER_LENGTH}, + hash::compute_siloed_nullifier, traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_concat, reader::Reader}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/nullifier_leaf_preimage.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/nullifier_leaf_preimage.nr index d9361aa1dec..cdfcdfb21aa 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/nullifier_leaf_preimage.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/nullifier_leaf_preimage.nr @@ -1,10 +1,8 @@ global NULLIFIER_LEAF_PREIMAGE_LENGTH: u32 = 3; use crate::{ - abis::{read_request::ScopedReadRequest, side_effect::Readable}, - hash::compute_siloed_nullifier, - merkle_tree::leaf_preimage::{IndexedTreeLeafPreimage, LeafPreimage}, - traits::{Empty, Hash}, + abis::{read_request::ScopedReadRequest, side_effect::Readable}, hash::compute_siloed_nullifier, + merkle_tree::leaf_preimage::{IndexedTreeLeafPreimage, LeafPreimage}, traits::{Empty, Hash}, }; pub struct NullifierLeafPreimage { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_call_request.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_call_request.nr index b1585b82e92..e4014d00fb2 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_call_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_call_request.nr @@ -1,7 +1,6 @@ use crate::{ abis::{call_context::CallContext, side_effect::{Ordered, RangeOrdered}}, - constants::PRIVATE_CALL_REQUEST_LENGTH, - traits::{Deserialize, Empty, Serialize}, + constants::PRIVATE_CALL_REQUEST_LENGTH, traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_circuit_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_circuit_public_inputs.nr index cf1b9b4f8c8..540c741c559 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_circuit_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_circuit_public_inputs.nr @@ -1,14 +1,9 @@ use crate::{ abis::{ - call_context::CallContext, - log_hash::{EncryptedLogHash, LogHash, NoteLogHash}, - max_block_number::MaxBlockNumber, - note_hash::NoteHash, - nullifier::Nullifier, - private_call_request::PrivateCallRequest, - public_call_request::PublicCallRequest, - read_request::ReadRequest, - validation_requests::KeyValidationRequestAndGenerator, + call_context::CallContext, log_hash::{EncryptedLogHash, LogHash, NoteLogHash}, + max_block_number::MaxBlockNumber, note_hash::NoteHash, nullifier::Nullifier, + private_call_request::PrivateCallRequest, public_call_request::PublicCallRequest, + read_request::ReadRequest, validation_requests::KeyValidationRequestAndGenerator, }, constants::{ MAX_ENCRYPTED_LOGS_PER_CALL, MAX_KEY_VALIDATION_REQUESTS_PER_CALL, @@ -17,11 +12,8 @@ use crate::{ MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIERS_PER_CALL, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, MAX_UNENCRYPTED_LOGS_PER_CALL, PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH, - }, - header::Header, - messaging::l2_to_l1_message::L2ToL1Message, - traits::{Deserialize, Empty, Serialize}, - transaction::tx_context::TxContext, + }, header::Header, messaging::l2_to_l1_message::L2ToL1Message, + traits::{Deserialize, Empty, Serialize}, transaction::tx_context::TxContext, utils::{arrays::validate_array, reader::Reader}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel/private_call_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel/private_call_data.nr index 459aeab8bd2..1cf7279ac6c 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel/private_call_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel/private_call_data.nr @@ -2,8 +2,7 @@ use crate::{ abis::private_circuit_public_inputs::PrivateCircuitPublicInputs, address::SaltedInitializationHash, constants::{FUNCTION_TREE_HEIGHT, PROTOCOL_CONTRACT_TREE_HEIGHT}, - merkle_tree::membership::MembershipWitness, - public_keys::PublicKeys, + merkle_tree::membership::MembershipWitness, public_keys::PublicKeys, recursion::verification_key::ClientIVCVerificationKey, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel_data.nr index 4a8f350de4a..813f04794b3 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel_data.nr @@ -2,8 +2,7 @@ use crate::{ abis::kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, constants::{PRIVATE_KERNEL_RESET_INDEX, VK_TREE_HEIGHT}, merkle_tree::membership::assert_check_membership, - recursion::verification_key::ClientIVCVerificationKey, - utils::arrays::find_index_hint, + recursion::verification_key::ClientIVCVerificationKey, utils::arrays::find_index_hint, }; pub struct PrivateKernelData { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_call_request.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_call_request.nr index d8aaf06f80c..f27a202984a 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_call_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_call_request.nr @@ -1,8 +1,6 @@ use crate::{ - abis::{call_context::CallContext, side_effect::Ordered}, - address::AztecAddress, - constants::PUBLIC_CALL_REQUEST_LENGTH, - traits::{Deserialize, Empty, Serialize}, + abis::{call_context::CallContext, side_effect::Ordered}, address::AztecAddress, + constants::PUBLIC_CALL_REQUEST_LENGTH, traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_circuit_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_circuit_public_inputs.nr index f1171176d09..7bfaacb5be5 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_circuit_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_circuit_public_inputs.nr @@ -4,8 +4,7 @@ use crate::{ note_hash::NoteHash, nullifier::Nullifier, public_inner_call_request::PublicInnerCallRequest, read_request::ReadRequest, tree_leaf_read_request::TreeLeafReadRequest, - }, - address::AztecAddress, + }, address::AztecAddress, constants::{ MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_CALL, MAX_L2_TO_L1_MSGS_PER_CALL, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NOTE_HASHES_PER_CALL, @@ -13,12 +12,9 @@ use crate::{ MAX_NULLIFIERS_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_DATA_READS_PER_CALL, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL, MAX_UNENCRYPTED_LOGS_PER_CALL, PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH, - }, - contrakt::{storage_read::StorageRead, storage_update_request::StorageUpdateRequest}, - header::Header, - messaging::l2_to_l1_message::L2ToL1Message, - traits::{Deserialize, Empty, Serialize}, - utils::reader::Reader, + }, contrakt::{storage_read::StorageRead, storage_update_request::StorageUpdateRequest}, + header::Header, messaging::l2_to_l1_message::L2ToL1Message, + traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; // Public inputs to public app circuit. diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_read.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_read.nr index 89427f042c2..8e088ddc5f1 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_read.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_read.nr @@ -1,7 +1,5 @@ use crate::{ - abis::side_effect::Ordered, - address::AztecAddress, - constants::PUBLIC_DATA_READ_LENGTH, + abis::side_effect::Ordered, address::AztecAddress, constants::PUBLIC_DATA_READ_LENGTH, contrakt::storage_read::StorageRead, data::hash::{compute_public_data_tree_index, compute_public_data_tree_value}, traits::{Deserialize, Empty, Serialize}, diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_update_request.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_update_request.nr index 6b55882403a..1e83aa81e48 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_update_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_update_request.nr @@ -1,13 +1,10 @@ use crate::{ - abis::side_effect::Ordered, - address::AztecAddress, - constants::PUBLIC_DATA_UPDATE_REQUEST_LENGTH, + abis::side_effect::Ordered, address::AztecAddress, constants::PUBLIC_DATA_UPDATE_REQUEST_LENGTH, contrakt::storage_update_request::StorageUpdateRequest, data::{ hash::{compute_public_data_tree_index, compute_public_data_tree_value}, public_data_tree_leaf::PublicDataTreeLeaf, - }, - traits::{Deserialize, Empty, Serialize}, + }, traits::{Deserialize, Empty, Serialize}, }; // TODO: Rename to PublicDataWrite diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_write.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_write.nr index 290c6ca6e31..b829d06d7b4 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_write.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_write.nr @@ -1,10 +1,8 @@ use crate::{ abis::{ - public_data_read::PublicDataRead, - public_data_update_request::PublicDataUpdateRequest, + public_data_read::PublicDataRead, public_data_update_request::PublicDataUpdateRequest, side_effect::{Inner, Ordered, Overridable, Readable}, - }, - traits::Empty, + }, traits::Empty, }; pub struct OverridablePublicDataWrite { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_inner_call_request.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_inner_call_request.nr index 1535e297904..00a61e96be9 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_inner_call_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_inner_call_request.nr @@ -1,7 +1,6 @@ use crate::{ abis::{public_call_stack_item_compressed::PublicCallStackItemCompressed, side_effect::Ordered}, - constants::PUBLIC_INNER_CALL_REQUEST_LENGTH, - traits::{Deserialize, Empty, Serialize}, + constants::PUBLIC_INNER_CALL_REQUEST_LENGTH, traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_kernel_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_kernel_data.nr index c8e8a15d35e..10853977219 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_kernel_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_kernel_data.nr @@ -1,11 +1,9 @@ use crate::{ abis::kernel_circuit_public_inputs::PublicKernelCircuitPublicInputs, - constants::{TUBE_INDEX, VK_TREE_HEIGHT}, - merkle_tree::membership::check_membership, + constants::{TUBE_INDEX, VK_TREE_HEIGHT}, merkle_tree::membership::check_membership, recursion::{ proof::NestedRecursiveProof, traits::Verifiable, verification_key::HonkVerificationKey, - }, - utils::arrays::find_index_hint, + }, utils::arrays::find_index_hint, }; pub struct PublicKernelData { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/read_request.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/read_request.nr index 8191f4ee4dc..41a2740ce56 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/read_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/read_request.nr @@ -1,9 +1,7 @@ use crate::{ - abis::side_effect::{Ordered, Scoped}, - address::AztecAddress, + abis::side_effect::{Ordered, Scoped}, address::AztecAddress, constants::{READ_REQUEST_LENGTH, SCOPED_READ_REQUEST_LEN}, - traits::{Deserialize, Empty, Serialize}, - utils::{arrays::array_concat, reader::Reader}, + traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_concat, reader::Reader}, }; pub struct ReadRequest { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/key_validation_request_and_generator.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/key_validation_request_and_generator.nr index 5ae055a5724..3adfc46c9b3 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/key_validation_request_and_generator.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/key_validation_request_and_generator.nr @@ -2,11 +2,8 @@ use crate::{ abis::validation_requests::{ key_validation_request::KeyValidationRequest, scoped_key_validation_request_and_generator::ScopedKeyValidationRequestAndGenerator, - }, - address::AztecAddress, - constants::KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH, - traits::{Deserialize, Empty, Serialize}, - utils::{arrays::array_concat, reader::Reader}, + }, address::AztecAddress, constants::KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH, + traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_concat, reader::Reader}, }; pub struct KeyValidationRequestAndGenerator { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/private_validation_requests.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/private_validation_requests.nr index f1e6adea10e..bb407329ceb 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/private_validation_requests.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/private_validation_requests.nr @@ -9,9 +9,7 @@ use crate::{ constants::{ MAX_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, PRIVATE_VALIDATION_REQUESTS_LENGTH, - }, - traits::{Deserialize, Empty, Serialize}, - utils::reader::Reader, + }, traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; pub struct PrivateValidationRequests { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/private_validation_requests_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/private_validation_requests_builder.nr index 1fe0e108e8b..93630f8005b 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/private_validation_requests_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/private_validation_requests_builder.nr @@ -1,7 +1,6 @@ use crate::{ abis::{ - max_block_number::MaxBlockNumber, - read_request::ScopedReadRequest, + max_block_number::MaxBlockNumber, read_request::ScopedReadRequest, validation_requests::{ private_validation_requests::PrivateValidationRequests, rollup_validation_requests::RollupValidationRequests, @@ -11,8 +10,7 @@ use crate::{ constants::{ MAX_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, - }, - traits::Empty, + }, traits::Empty, }; pub struct PrivateValidationRequestsBuilder { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/public_validation_requests.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/public_validation_requests.nr index c6d77daadd1..149b8d6781b 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/public_validation_requests.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/public_validation_requests.nr @@ -9,9 +9,7 @@ use crate::{ MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_PUBLIC_DATA_READS_PER_TX, NUM_PUBLIC_VALIDATION_REQUEST_ARRAYS, PUBLIC_VALIDATION_REQUESTS_LENGTH, - }, - traits::{Deserialize, Empty, Serialize}, - utils::{arrays::array_length, reader::Reader}, + }, traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_length, reader::Reader}, }; pub struct PublicValidationRequests { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/public_validation_requests_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/public_validation_requests_builder.nr index b5a45d5faea..18ceb1f4e11 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/public_validation_requests_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/public_validation_requests_builder.nr @@ -1,9 +1,7 @@ use crate::{ abis::{ - max_block_number::MaxBlockNumber, - public_data_read::PublicDataRead, - read_request::ScopedReadRequest, - tree_leaf_read_request::TreeLeafReadRequest, + max_block_number::MaxBlockNumber, public_data_read::PublicDataRead, + read_request::ScopedReadRequest, tree_leaf_read_request::TreeLeafReadRequest, validation_requests::{ public_validation_requests::PublicValidationRequests, rollup_validation_requests::RollupValidationRequests, @@ -13,9 +11,7 @@ use crate::{ MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_PUBLIC_DATA_READS_PER_TX, - }, - traits::Empty, - utils::arrays::array_to_bounded_vec, + }, traits::Empty, utils::arrays::array_to_bounded_vec, }; pub struct PublicValidationRequestsBuilder { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/rollup_validation_requests.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/rollup_validation_requests.nr index 79ddba32742..bbfacf3edfd 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/rollup_validation_requests.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/rollup_validation_requests.nr @@ -1,8 +1,6 @@ use crate::{ - abis::max_block_number::MaxBlockNumber, - constants::ROLLUP_VALIDATION_REQUESTS_LENGTH, - traits::{Deserialize, Empty, Serialize}, - utils::reader::Reader, + abis::max_block_number::MaxBlockNumber, constants::ROLLUP_VALIDATION_REQUESTS_LENGTH, + traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; // These are validation requests that cannot be fulfilled in the current context (private or public), and must be diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/scoped_key_validation_request_and_generator.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/scoped_key_validation_request_and_generator.nr index 17eda595bc8..8329a101b0a 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/scoped_key_validation_request_and_generator.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/scoped_key_validation_request_and_generator.nr @@ -2,11 +2,8 @@ use crate::{ abis::{ side_effect::Scoped, validation_requests::key_validation_request_and_generator::KeyValidationRequestAndGenerator, - }, - address::AztecAddress, - constants::SCOPED_KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH, - traits::{Deserialize, Empty, Serialize}, - utils::{arrays::array_concat, reader::Reader}, + }, address::AztecAddress, constants::SCOPED_KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH, + traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_concat, reader::Reader}, }; pub struct ScopedKeyValidationRequestAndGenerator { 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..bec16175bdb 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 @@ -11,8 +11,7 @@ use crate::{ }, contract_class_id::ContractClassId, hash::{poseidon2_hash_with_separator, private_functions_root_from_siblings}, merkle_tree::membership::MembershipWitness, - traits::{Deserialize, Empty, FromField, Serialize, ToField}, - utils, + traits::{Deserialize, Empty, FromField, Serialize, ToField}, utils, }; // We do below because `use crate::point::Point;` does not work diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/address/partial_address.nr b/noir-projects/noir-protocol-circuits/crates/types/src/address/partial_address.nr index e44ff45d7d5..e13e08c196f 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/address/partial_address.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/address/partial_address.nr @@ -1,9 +1,7 @@ use crate::{ address::{aztec_address::AztecAddress, salted_initialization_hash::SaltedInitializationHash}, - constants::GENERATOR_INDEX__PARTIAL_ADDRESS, - contract_class_id::ContractClassId, - hash::poseidon2_hash_with_separator, - traits::{Deserialize, Serialize, ToField}, + constants::GENERATOR_INDEX__PARTIAL_ADDRESS, contract_class_id::ContractClassId, + hash::poseidon2_hash_with_separator, traits::{Deserialize, Serialize, ToField}, }; global PARTIAL_ADDRESS_LENGTH: u32 = 1; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/contract_instance.nr b/noir-projects/noir-protocol-circuits/crates/types/src/contract_instance.nr index dfc372b2037..319b3820dac 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/contract_instance.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/contract_instance.nr @@ -2,11 +2,8 @@ use crate::{ address::{ aztec_address::AztecAddress, partial_address::PartialAddress, public_keys_hash::PublicKeysHash, - }, - constants::CONTRACT_INSTANCE_LENGTH, - contract_class_id::ContractClassId, - public_keys::PublicKeys, - traits::{Deserialize, Hash, Serialize}, + }, constants::CONTRACT_INSTANCE_LENGTH, contract_class_id::ContractClassId, + public_keys::PublicKeys, traits::{Deserialize, Hash, Serialize}, }; pub struct ContractInstance { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/contrakt/storage_update_request.nr b/noir-projects/noir-protocol-circuits/crates/types/src/contrakt/storage_update_request.nr index d9a8071a605..37cb287f5d2 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/contrakt/storage_update_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/contrakt/storage_update_request.nr @@ -1,6 +1,5 @@ use crate::{ - constants::CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH, - traits::{Deserialize, Empty, Serialize}, + constants::CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH, traits::{Deserialize, Empty, Serialize}, }; pub struct StorageUpdateRequest { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/data/public_data_hint.nr b/noir-projects/noir-protocol-circuits/crates/types/src/data/public_data_hint.nr index 6adec664620..7726b63ef89 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/data/public_data_hint.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/data/public_data_hint.nr @@ -1,8 +1,7 @@ use crate::{ constants::PUBLIC_DATA_TREE_HEIGHT, data::public_data_tree_leaf_preimage::PublicDataTreeLeafPreimage, - merkle_tree::{conditionally_assert_check_membership, MembershipWitness}, - traits::Empty, + merkle_tree::{conditionally_assert_check_membership, MembershipWitness}, traits::Empty, }; pub struct PublicDataHint { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/data/public_data_tree_leaf.nr b/noir-projects/noir-protocol-circuits/crates/types/src/data/public_data_tree_leaf.nr index 64f02300c9e..07c2fd40a6d 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/data/public_data_tree_leaf.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/data/public_data_tree_leaf.nr @@ -1,6 +1,5 @@ use crate::{ - abis::{public_data_read::PublicDataRead, side_effect::{Overridable, Readable}}, - traits::Empty, + abis::{public_data_read::PublicDataRead, side_effect::{Overridable, Readable}}, traits::Empty, }; pub struct PublicDataTreeLeaf { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/hash.nr b/noir-projects/noir-protocol-circuits/crates/types/src/hash.nr index 7ceb2ba0b6e..61b746598b6 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/hash.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/hash.nr @@ -2,20 +2,16 @@ use crate::{ abis::{ contract_class_function_leaf_preimage::ContractClassFunctionLeafPreimage, function_selector::FunctionSelector, - log_hash::{LogHash, ScopedEncryptedLogHash, ScopedLogHash}, - note_hash::ScopedNoteHash, + log_hash::{LogHash, ScopedEncryptedLogHash, ScopedLogHash}, note_hash::ScopedNoteHash, nullifier::ScopedNullifier, - }, - address::{AztecAddress, EthAddress}, + }, address::{AztecAddress, EthAddress}, constants::{ FUNCTION_TREE_HEIGHT, GENERATOR_INDEX__NOTE_HASH_NONCE, GENERATOR_INDEX__OUTER_NULLIFIER, GENERATOR_INDEX__SILOED_NOTE_HASH, GENERATOR_INDEX__UNIQUE_NOTE_HASH, GENERATOR_INDEX__VK, MAX_ENCRYPTED_LOGS_PER_TX, MAX_NOTE_ENCRYPTED_LOGS_PER_TX, - }, - merkle_tree::root::root_from_sibling_path, + }, merkle_tree::root::root_from_sibling_path, messaging::l2_to_l1_message::{L2ToL1Message, ScopedL2ToL1Message}, - recursion::verification_key::VerificationKey, - traits::{is_empty, ToField}, + recursion::verification_key::VerificationKey, traits::{is_empty, ToField}, utils::field::field_from_bytes_32_trunc, }; use super::utils::field::field_from_bytes; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/header.nr b/noir-projects/noir-protocol-circuits/crates/types/src/header.nr index fa4a57da32b..62ce52d86b0 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/header.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/header.nr @@ -6,11 +6,8 @@ use crate::{ constants::{ CONTENT_COMMITMENT_LENGTH, GENERATOR_INDEX__BLOCK_HASH, GLOBAL_VARIABLES_LENGTH, HEADER_LENGTH, STATE_REFERENCE_LENGTH, - }, - content_commitment::ContentCommitment, - hash::poseidon2_hash_with_separator, - state_reference::StateReference, - traits::{Deserialize, Empty, Hash, Serialize}, + }, content_commitment::ContentCommitment, hash::poseidon2_hash_with_separator, + state_reference::StateReference, traits::{Deserialize, Empty, Hash, Serialize}, utils::arr_copy_slice, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/merkle_tree/indexed_tree.nr b/noir-projects/noir-protocol-circuits/crates/types/src/merkle_tree/indexed_tree.nr index 1a12382093b..5ca42b3ac56 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/merkle_tree/indexed_tree.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/merkle_tree/indexed_tree.nr @@ -5,9 +5,7 @@ use crate::{ merkle_tree::{ membership::{assert_check_membership, MembershipWitness}, root::{calculate_empty_tree_root, calculate_subtree_root, root_from_sibling_path}, - }, - traits::{Empty, Hash, is_empty}, - utils::arrays::check_permutation, + }, traits::{Empty, Hash, is_empty}, utils::arrays::check_permutation, }; pub fn batch_insert( diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/merkle_tree/membership.nr b/noir-projects/noir-protocol-circuits/crates/types/src/merkle_tree/membership.nr index 1d3815dde9a..f428a8d3549 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/merkle_tree/membership.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/merkle_tree/membership.nr @@ -2,8 +2,7 @@ use crate::{ merkle_tree::{ indexed_tree::check_valid_low_leaf::assert_check_valid_low_leaf, leaf_preimage::IndexedTreeLeafPreimage, root::root_from_sibling_path, - }, - traits::Empty, + }, traits::Empty, }; pub struct MembershipWitness { @@ -90,8 +89,7 @@ mod tests { assert_check_membership, assert_check_non_membership, check_membership, conditionally_assert_check_membership, MembershipWitness, }, - }, - tests::merkle_tree_utils::NonEmptyMerkleTree, + }, tests::merkle_tree_utils::NonEmptyMerkleTree, }; use std::hash::pedersen_hash; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/messaging/l2_to_l1_message.nr b/noir-projects/noir-protocol-circuits/crates/types/src/messaging/l2_to_l1_message.nr index b3de63f26b0..b0e226dc587 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/messaging/l2_to_l1_message.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/messaging/l2_to_l1_message.nr @@ -1,9 +1,7 @@ use crate::{ - abis::side_effect::{Ordered, Scoped}, - address::{AztecAddress, EthAddress}, + abis::side_effect::{Ordered, Scoped}, address::{AztecAddress, EthAddress}, constants::{L2_TO_L1_MESSAGE_LENGTH, SCOPED_L2_TO_L1_MESSAGE_LENGTH}, - traits::{Deserialize, Empty, Serialize}, - utils::{arrays::array_concat, reader::Reader}, + traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_concat, reader::Reader}, }; // Note: Not to be confused with L2ToL1Msg in Solidity diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/partial_state_reference.nr b/noir-projects/noir-protocol-circuits/crates/types/src/partial_state_reference.nr index b85b9b3e328..0384aa58b94 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/partial_state_reference.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/partial_state_reference.nr @@ -1,7 +1,6 @@ use crate::{ abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot, - constants::PARTIAL_STATE_REFERENCE_LENGTH, - traits::{Deserialize, Empty, Serialize}, + constants::PARTIAL_STATE_REFERENCE_LENGTH, traits::{Deserialize, Empty, Serialize}, }; pub struct PartialStateReference { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/public_keys.nr b/noir-projects/noir-protocol-circuits/crates/types/src/public_keys.nr index 94fae081b85..a22a2e29c6b 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/public_keys.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/public_keys.nr @@ -3,9 +3,7 @@ use crate::{ constants::{ DEFAULT_IVPK_M_X, DEFAULT_IVPK_M_Y, DEFAULT_NPK_M_X, DEFAULT_NPK_M_Y, DEFAULT_OVPK_M_X, DEFAULT_OVPK_M_Y, DEFAULT_TPK_M_X, DEFAULT_TPK_M_Y, GENERATOR_INDEX__PUBLIC_KEYS_HASH, - }, - hash::poseidon2_hash_with_separator, - point::POINT_LENGTH, + }, hash::poseidon2_hash_with_separator, point::POINT_LENGTH, traits::{Deserialize, Hash, Serialize}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/recursion/verification_key.nr b/noir-projects/noir-protocol-circuits/crates/types/src/recursion/verification_key.nr index a11b7852902..9aa057d9dab 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/recursion/verification_key.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/recursion/verification_key.nr @@ -1,8 +1,7 @@ use crate::{ constants::{ CLIENT_IVC_VERIFICATION_KEY_LENGTH_IN_FIELDS, HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS, - }, - traits::{Deserialize, Empty, Serialize}, + }, traits::{Deserialize, Empty, Serialize}, }; pub struct VerificationKey { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/state_reference.nr b/noir-projects/noir-protocol-circuits/crates/types/src/state_reference.nr index c2ac4b58123..9c9b0bdf98f 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/state_reference.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/state_reference.nr @@ -1,8 +1,7 @@ use crate::{ abis::append_only_tree_snapshot::{APPEND_ONLY_TREE_SNAPSHOT_LENGTH, AppendOnlyTreeSnapshot}, constants::{PARTIAL_STATE_REFERENCE_LENGTH, STATE_REFERENCE_LENGTH}, - partial_state_reference::PartialStateReference, - traits::{Deserialize, Empty, Serialize}, + partial_state_reference::PartialStateReference, traits::{Deserialize, Empty, Serialize}, utils::arr_copy_slice, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixture_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixture_builder.nr index 3b121da821c..14494cb7bd4 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixture_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixture_builder.nr @@ -3,44 +3,31 @@ use crate::{ accumulated_data::{ CombinedAccumulatedData, PrivateAccumulatedData, PrivateAccumulatedDataBuilder, PublicAccumulatedData, PublicAccumulatedDataArrayLengths, PublicAccumulatedDataBuilder, - }, - call_context::CallContext, - combined_constant_data::CombinedConstantData, - enqueued_call_data::{EnqueuedCallData, Proof}, - function_data::FunctionData, - function_selector::FunctionSelector, - gas::Gas, - gas_settings::GasSettings, + }, call_context::CallContext, combined_constant_data::CombinedConstantData, + enqueued_call_data::{EnqueuedCallData, Proof}, function_data::FunctionData, + function_selector::FunctionSelector, gas::Gas, gas_settings::GasSettings, global_variables::GlobalVariables, kernel_circuit_public_inputs::{ KernelCircuitPublicInputs, PrivateKernelCircuitPublicInputs, PublicKernelCircuitPublicInputs, VMCircuitPublicInputs, - }, - kernel_data::KernelData, + }, kernel_data::KernelData, log_hash::{EncryptedLogHash, LogHash, NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, - max_block_number::MaxBlockNumber, - note_hash::{NoteHash, ScopedNoteHash}, - nullifier::{Nullifier, ScopedNullifier}, - private_call_request::PrivateCallRequest, + max_block_number::MaxBlockNumber, note_hash::{NoteHash, ScopedNoteHash}, + nullifier::{Nullifier, ScopedNullifier}, private_call_request::PrivateCallRequest, private_circuit_public_inputs::PrivateCircuitPublicInputs, - private_kernel::private_call_data::PrivateCallData, - private_kernel_data::PrivateKernelData, + private_kernel::private_call_data::PrivateCallData, private_kernel_data::PrivateKernelData, public_call_data::{Proof as PublicCallDataProof, PublicCallData}, public_call_request::PublicCallRequest, - public_circuit_public_inputs::PublicCircuitPublicInputs, - public_data_read::PublicDataRead, + public_circuit_public_inputs::PublicCircuitPublicInputs, public_data_read::PublicDataRead, public_data_update_request::PublicDataUpdateRequest, - public_inner_call_request::PublicInnerCallRequest, - public_kernel_data::PublicKernelData, - read_request::{ReadRequest, ScopedReadRequest}, - tree_leaf_read_request::TreeLeafReadRequest, + public_inner_call_request::PublicInnerCallRequest, public_kernel_data::PublicKernelData, + read_request::{ReadRequest, ScopedReadRequest}, tree_leaf_read_request::TreeLeafReadRequest, validation_requests::{ KeyValidationRequest, KeyValidationRequestAndGenerator, PrivateValidationRequests, PublicValidationRequestArrayLengths, PublicValidationRequests, RollupValidationRequests, ScopedKeyValidationRequestAndGenerator, }, - }, - address::{AztecAddress, EthAddress, PublicKeysHash, SaltedInitializationHash}, + }, address::{AztecAddress, EthAddress, PublicKeysHash, SaltedInitializationHash}, constants::{ FUNCTION_TREE_HEIGHT, MAX_ENCRYPTED_LOGS_PER_TX, MAX_FIELD_VALUE, MAX_KEY_VALIDATION_REQUESTS_PER_TX, MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_TX, @@ -53,33 +40,24 @@ use crate::{ MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_UNENCRYPTED_LOGS_PER_TX, PRIVATE_CALL_REQUEST_LENGTH, PROTOCOL_CONTRACT_TREE_HEIGHT, PUBLIC_CALL_REQUEST_LENGTH, VK_TREE_HEIGHT, - }, - contrakt::{storage_read::StorageRead, storage_update_request::StorageUpdateRequest}, + }, contrakt::{storage_read::StorageRead, storage_update_request::StorageUpdateRequest}, hash::{ compute_l2_to_l1_hash, compute_siloed_nullifier, compute_tx_logs_hash, mask_encrypted_log_hash, silo_note_hash, silo_unencrypted_log_hash, - }, - header::Header, - merkle_tree::{membership::MembershipWitness, MerkleTree}, + }, header::Header, merkle_tree::{membership::MembershipWitness, MerkleTree}, messaging::l2_to_l1_message::{L2ToL1Message, ScopedL2ToL1Message}, - partial_state_reference::PartialStateReference, - point::Point, - public_keys::PublicKeys, + partial_state_reference::PartialStateReference, point::Point, public_keys::PublicKeys, recursion::{ proof::NestedRecursiveProof, verification_key::{ClientIVCVerificationKey, HonkVerificationKey, VerificationKey}, }, tests::fixtures::{ - self, - contract_functions::ContractFunction, - contracts::ContractData, + self, contract_functions::ContractFunction, contracts::ContractData, vk_tree::{ generate_fake_client_ivc_vk_for_index, generate_fake_honk_vk_for_index, get_vk_merkle_tree, VK_TREE_WIDTH, }, - }, - traits::Empty, - transaction::{tx_context::TxContext, tx_request::TxRequest}, + }, traits::Empty, transaction::{tx_context::TxContext, tx_request::TxRequest}, }; fn subarray(arr: [T; N]) -> [T; M] { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/contracts.nr b/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/contracts.nr index 462bc8fc975..5e26fb5575f 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/contracts.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/contracts.nr @@ -1,9 +1,7 @@ use crate::{ address::{AztecAddress, PartialAddress, PublicKeysHash, SaltedInitializationHash}, - contract_class_id::ContractClassId, - hash::private_functions_root_from_siblings, - public_keys::PublicKeys, - tests::fixtures::contract_functions::get_protocol_contract_function, + contract_class_id::ContractClassId, hash::private_functions_root_from_siblings, + public_keys::PublicKeys, tests::fixtures::contract_functions::get_protocol_contract_function, }; pub struct ContractData { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/tests/merkle_tree_utils.nr b/noir-projects/noir-protocol-circuits/crates/types/src/tests/merkle_tree_utils.nr index b4ff548be02..9bb0cf86ac3 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/tests/merkle_tree_utils.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/tests/merkle_tree_utils.nr @@ -1,6 +1,5 @@ use crate::{ - hash::merkle_hash, - merkle_tree::{calculate_empty_tree_root, merkle_tree, MerkleTree}, + hash::merkle_hash, merkle_tree::{calculate_empty_tree_root, merkle_tree, MerkleTree}, traits::Empty, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/transaction/tx_context.nr b/noir-projects/noir-protocol-circuits/crates/types/src/transaction/tx_context.nr index 25de53247cf..254e7602cfc 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/transaction/tx_context.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/transaction/tx_context.nr @@ -1,8 +1,6 @@ use crate::{ - abis::gas_settings::GasSettings, - constants::TX_CONTEXT_LENGTH, - traits::{Deserialize, Empty, Serialize}, - utils::reader::Reader, + abis::gas_settings::GasSettings, constants::TX_CONTEXT_LENGTH, + traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; // docs:start:tx-context diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/transaction/tx_request.nr b/noir-projects/noir-protocol-circuits/crates/types/src/transaction/tx_request.nr index e8f743548db..0dc45c48ffd 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/transaction/tx_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/transaction/tx_request.nr @@ -1,11 +1,8 @@ use crate::{ - abis::function_data::FunctionData, - address::AztecAddress, + abis::function_data::FunctionData, address::AztecAddress, constants::{GENERATOR_INDEX__TX_REQUEST, TX_REQUEST_LENGTH}, - hash::poseidon2_hash_with_separator, - traits::{Deserialize, Empty, Hash, Serialize}, - transaction::tx_context::TxContext, - utils::reader::Reader, + hash::poseidon2_hash_with_separator, traits::{Deserialize, Empty, Hash, Serialize}, + transaction::tx_context::TxContext, utils::reader::Reader, }; pub struct TxRequest { @@ -78,9 +75,7 @@ mod tests { abis::{ function_data::FunctionData, function_selector::FunctionSelector, gas::Gas, gas_fees::GasFees, gas_settings::GasSettings, - }, - address::AztecAddress, - transaction::{tx_context::TxContext, tx_request::TxRequest}, + }, address::AztecAddress, transaction::{tx_context::TxContext, tx_request::TxRequest}, }; #[test] diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_array_appended.nr b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_array_appended.nr index 8142b69c430..1377ada4486 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_array_appended.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_array_appended.nr @@ -1,7 +1,5 @@ use crate::{ - abis::side_effect::Scoped, - address::aztec_address::AztecAddress, - traits::{Empty, is_empty}, + abis::side_effect::Scoped, address::aztec_address::AztecAddress, traits::{Empty, is_empty}, }; pub fn assert_array_appended( diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_combined_sorted_transformed_value_array.nr b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_combined_sorted_transformed_value_array.nr index cac15101a86..af0387c7710 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_combined_sorted_transformed_value_array.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_combined_sorted_transformed_value_array.nr @@ -1,8 +1,7 @@ mod get_combined_order_hints; use crate::{ - abis::side_effect::Ordered, - traits::{Empty, is_empty}, + abis::side_effect::Ordered, traits::{Empty, is_empty}, utils::arrays::{ array_length, assert_combined_sorted_transformed_value_array::get_combined_order_hints::{ @@ -101,16 +100,14 @@ mod tests { tests::{ types::{ combine_two_values, is_combined_from_two_values, TestCombinedValue, TestTwoValues, - }, - utils::pad_end, + }, utils::pad_end, }, utils::arrays::{ array_merge, assert_combined_sorted_transformed_value_array::{ assert_combined_sorted_transformed_value_array_asc, get_combined_order_hints::{CombinedOrderHint, get_combined_order_hints_asc}, - }, - sort_by_counter::sort_by_counter_asc, + }, sort_by_counter::sort_by_counter_asc, }, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_combined_sorted_transformed_value_array/get_combined_order_hints.nr b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_combined_sorted_transformed_value_array/get_combined_order_hints.nr index ac62b93bd14..f63e5bfbbdc 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_combined_sorted_transformed_value_array/get_combined_order_hints.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_combined_sorted_transformed_value_array/get_combined_order_hints.nr @@ -1,6 +1,5 @@ use crate::{ - abis::side_effect::Ordered, - traits::{Empty, is_empty}, + abis::side_effect::Ordered, traits::{Empty, is_empty}, utils::arrays::{ array_length, get_sorted_tuple::get_sorted_tuple, sort_by_counter::compare_by_counter_empty_padded_asc, diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_deduped_array.nr b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_deduped_array.nr index af7e9c4bdac..17460434e88 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_deduped_array.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_deduped_array.nr @@ -39,10 +39,8 @@ where mod tests { use crate::{ - abis::side_effect::{Inner, Overridable}, - tests::{types::TestValue, utils::pad_end}, - traits::Empty, - utils::arrays::assert_deduped_array::{assert_deduped_array, dedupe_array}, + abis::side_effect::{Inner, Overridable}, tests::{types::TestValue, utils::pad_end}, + traits::Empty, utils::arrays::assert_deduped_array::{assert_deduped_array, dedupe_array}, }; struct TestItem { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_exposed_sorted_transformed_value_array.nr b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_exposed_sorted_transformed_value_array.nr index eba9fe575a2..40f0072676e 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_exposed_sorted_transformed_value_array.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_exposed_sorted_transformed_value_array.nr @@ -1,8 +1,7 @@ mod get_order_hints; use crate::{ - abis::side_effect::Ordered, - traits::{Empty, is_empty}, + abis::side_effect::Ordered, traits::{Empty, is_empty}, utils::arrays::{ array_length, assert_exposed_sorted_transformed_value_array::get_order_hints::OrderHint, }, diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_exposed_sorted_transformed_value_array/get_order_hints.nr b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_exposed_sorted_transformed_value_array/get_order_hints.nr index 145df154174..d9e61497371 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_exposed_sorted_transformed_value_array/get_order_hints.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_exposed_sorted_transformed_value_array/get_order_hints.nr @@ -1,6 +1,5 @@ use crate::{ - abis::side_effect::Ordered, - traits::Empty, + abis::side_effect::Ordered, traits::Empty, utils::arrays::{ get_sorted_tuple::get_sorted_tuple, sort_by_counter::{ diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_split_sorted_transformed_value_arrays.nr b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_split_sorted_transformed_value_arrays.nr index 36cc3b3d07c..d5d058e54ea 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_split_sorted_transformed_value_arrays.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_split_sorted_transformed_value_arrays.nr @@ -1,8 +1,7 @@ mod get_split_order_hints; use crate::{ - abis::side_effect::Ordered, - traits::Empty, + abis::side_effect::Ordered, traits::Empty, utils::arrays::{ array_length, assert_split_sorted_transformed_value_arrays::get_split_order_hints::SplitOrderHints, diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_split_sorted_transformed_value_arrays/get_split_order_hints.nr b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_split_sorted_transformed_value_arrays/get_split_order_hints.nr index 2a330cc2fe2..19a1514599e 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_split_sorted_transformed_value_arrays/get_split_order_hints.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_split_sorted_transformed_value_arrays/get_split_order_hints.nr @@ -1,6 +1,5 @@ use crate::{ - abis::side_effect::Ordered, - traits::{Empty, is_empty}, + abis::side_effect::Ordered, traits::{Empty, is_empty}, utils::arrays::{ get_sorted_tuple::get_sorted_tuple, sort_by_counter::{ From b1baccb68e9855c8a3e1fff2db93c041b170ac74 Mon Sep 17 00:00:00 2001 From: Tom French Date: Fri, 25 Oct 2024 11:34:32 +0100 Subject: [PATCH 3/4] . --- .../aztec-nr/address-note/src/address_note.nr | 7 ++- noir-projects/aztec-nr/authwit/src/account.nr | 3 +- noir-projects/aztec-nr/authwit/src/auth.nr | 6 ++- .../aztec-nr/authwit/src/cheatcodes.nr | 8 +-- .../aztec-nr/authwit/src/entrypoint/app.nr | 3 +- .../aztec-nr/authwit/src/entrypoint/fee.nr | 3 +- .../aztec/src/context/private_context.nr | 31 +++++++---- .../encrypted_event_emission.nr | 4 +- .../encrypted_logs/encrypted_note_emission.nr | 10 ++-- .../aztec/src/encrypted_logs/header.nr | 5 +- .../aztec/src/encrypted_logs/payload.nr | 13 +++-- noir-projects/aztec-nr/aztec/src/hash.nr | 6 ++- .../src/history/nullifier_non_inclusion.nr | 3 +- .../aztec-nr/aztec/src/macros/dispatch/mod.nr | 2 +- .../aztec/src/macros/functions/interfaces.nr | 7 +-- .../aztec-nr/aztec/src/macros/notes/mod.nr | 5 +- .../aztec-nr/aztec/src/macros/storage/mod.nr | 3 +- .../aztec-nr/aztec/src/macros/utils.nr | 6 +-- noir-projects/aztec-nr/aztec/src/messaging.nr | 3 +- .../aztec-nr/aztec/src/note/lifecycle.nr | 3 +- .../aztec/src/note/note_getter/mod.nr | 3 +- .../aztec/src/note/note_getter/test.nr | 3 +- .../aztec-nr/aztec/src/note/utils.nr | 3 +- .../src/oracle/get_membership_witness.nr | 3 +- .../get_nullifier_membership_witness.nr | 3 +- .../aztec-nr/aztec/src/oracle/keys.nr | 3 +- noir-projects/aztec-nr/aztec/src/prelude.nr | 10 ++-- .../aztec/src/state_vars/private_immutable.nr | 7 ++- .../aztec/src/state_vars/private_mutable.nr | 6 ++- .../aztec/src/state_vars/private_set.nr | 9 ++-- .../aztec/src/state_vars/public_immutable.nr | 3 +- .../aztec/src/state_vars/shared_immutable.nr | 6 ++- .../shared_mutable/shared_mutable.nr | 9 ++-- .../src/state_vars/shared_mutable/test.nr | 3 +- .../src/test/helpers/test_environment.nr | 5 +- .../aztec-nr/aztec/src/test/helpers/utils.nr | 10 ++-- .../aztec/src/test/mocks/mock_note.nr | 3 +- .../aztec-nr/uint-note/src/uint_note.nr | 4 +- .../aztec-nr/value-note/src/value_note.nr | 7 ++- .../src/dapp_payload.nr | 3 +- .../app_subscription_contract/src/main.nr | 3 +- .../src/subscription_note.nr | 7 ++- .../contracts/auth_contract/src/main.nr | 3 +- .../auth_registry_contract/src/main.nr | 3 +- .../avm_initializer_test_contract/src/main.nr | 3 +- .../contracts/avm_test_contract/src/main.nr | 14 ++--- .../contracts/card_game_contract/src/cards.nr | 14 +++-- .../contracts/child_contract/src/main.nr | 3 +- .../contracts/claim_contract/src/main.nr | 3 +- .../src/events/class_registered.nr | 4 +- .../events/private_function_broadcasted.nr | 4 +- .../unconstrained_function_broadcasted.nr | 4 +- .../src/main.nr | 3 +- .../src/main.nr | 13 +++-- .../crowdfunding_contract/src/main.nr | 11 ++-- .../docs_example_contract/src/main.nr | 4 +- .../src/types/card_note.nr | 4 +- .../ecdsa_k_account_contract/src/main.nr | 3 +- .../ecdsa_r_account_contract/src/main.nr | 3 +- .../contracts/lending_contract/src/main.nr | 3 +- .../contracts/nft_contract/src/main.nr | 14 +++-- .../nft_contract/src/test/access_control.nr | 2 +- .../nft_contract/src/test/minting.nr | 4 +- .../src/test/transfer_in_private.nr | 16 +++--- .../src/test/transfer_in_public.nr | 14 ++--- .../src/test/transfer_to_private.nr | 12 +++-- .../src/test/transfer_to_public.nr | 14 ++--- .../contracts/nft_contract/src/test/utils.nr | 10 ++-- .../nft_contract/src/types/nft_note.nr | 9 ++-- .../schnorr_account_contract/src/main.nr | 9 ++-- .../src/public_key_note.nr | 4 +- .../src/main.nr | 3 +- .../src/auth_oracle.nr | 4 +- .../contracts/spam_contract/src/main.nr | 3 +- .../spam_contract/src/types/balance_set.nr | 3 +- .../spam_contract/src/types/token_note.nr | 7 ++- .../static_child_contract/src/main.nr | 3 +- .../contracts/test_contract/src/main.nr | 13 +++-- .../contracts/test_contract/src/test_note.nr | 3 +- .../token_blacklist_contract/src/main.nr | 4 +- .../src/types/balances_map.nr | 3 +- .../src/types/token_note.nr | 7 ++- .../token_bridge_contract/src/main.nr | 3 +- .../contracts/token_contract/src/main.nr | 14 +++-- .../token_contract/src/test/access_control.nr | 2 +- .../contracts/token_contract/src/test/burn.nr | 26 ++++----- .../token_contract/src/test/minting.nr | 16 +++--- .../src/test/reading_constants.nr | 4 +- .../token_contract/src/test/shielding.nr | 14 ++--- .../src/test/transfer_private.nr | 18 +++---- .../src/test/transfer_public.nr | 16 +++--- .../token_contract/src/test/unshielding.nr | 14 ++--- .../token_contract/src/test/utils.nr | 8 ++- .../token_contract/src/types/balance_set.nr | 6 ++- .../token_contract/src/types/token_note.nr | 6 ++- .../src/types/transparent_note.nr | 3 +- .../contracts/uniswap_contract/src/main.nr | 3 +- .../parity-lib/src/root/root_parity_input.nr | 6 ++- .../src/root/root_rollup_parity_input.nr | 6 ++- .../components/previous_kernel_validator.nr | 4 +- .../previous_kernel_validator_hints.nr | 4 +- .../components/private_call_data_validator.nr | 14 +++-- ...private_kernel_circuit_output_validator.nr | 8 ++- ...e_kernel_circuit_public_inputs_composer.nr | 9 +++- .../src/components/reset_output_composer.nr | 9 ++-- .../reset_output_hints.nr | 3 +- ...r_propagated_note_hash_indexes_for_logs.nr | 3 +- .../src/components/reset_output_validator.nr | 7 ++- .../src/components/tail_output_composer.nr | 6 ++- .../tail_output_composer/meter_gas_used.nr | 3 +- .../src/components/tail_output_validator.nr | 4 +- .../tail_to_public_output_composer.nr | 3 +- .../meter_gas_used.nr | 3 +- .../tail_to_public_output_validator.nr | 10 ++-- .../tail_to_public_output_hints.nr | 3 +- .../src/private_kernel_empty.nr | 9 ++-- .../src/private_kernel_init.nr | 3 +- .../src/private_kernel_inner.nr | 3 +- .../src/private_kernel_reset.nr | 16 ++++-- .../src/private_kernel_tail.nr | 7 ++- .../src/private_kernel_tail_to_public.nr | 11 ++-- .../mod.nr | 4 +- .../mod.nr | 4 +- .../mod.nr | 4 +- .../reset_output_validator_builder/mod.nr | 3 +- .../meter_gas_used.nr | 3 +- .../tail_output_validator_builder/mod.nr | 3 +- .../meter_gas_used.nr | 3 +- .../tail_to_public_output_composer.nr | 5 +- .../src/main.nr | 3 +- .../crates/private-kernel-reset/src/main.nr | 3 +- .../enqueued_call_data_validator.nr | 4 +- .../public_kernel_output_composer.nr | 6 ++- .../public_kernel_output_validator.nr | 6 ++- .../components/public_tail_output_composer.nr | 4 +- .../combine_data.nr | 6 ++- .../generate_output_hints.nr | 7 ++- ...generate_overridable_public_data_writes.nr | 4 +- .../generate_public_data_leaves.nr | 3 +- .../public_tail_output_validator.nr | 8 ++- .../validate_linked_public_data_writes.nr | 4 +- .../validate_unique_leaf_slots.nr | 3 +- .../components/vm_circuit_output_composer.nr | 10 ++-- .../propagate_accumulated_data.nr | 3 +- .../src/public_kernel_merge.nr | 9 ++-- .../src/public_kernel_tail.nr | 33 ++++++++---- .../src/note_hash_read_request_reset.nr | 8 ++- ...llifier_non_existent_read_request_reset.nr | 3 +- .../src/nullifier_read_request_reset.nr | 8 ++- .../private_validation_request_processor.nr | 6 ++- .../src/public_data_read_request_hints.nr | 3 +- .../public_validation_request_processor.nr | 7 ++- .../src/reset/mutable_data_read_request.nr | 13 +++-- .../src/reset/non_existent_read_request.nr | 3 +- .../src/reset/read_request.nr | 6 ++- .../src/reset/transient_data.nr | 6 ++- ...non_existent_read_request_hints_builder.nr | 4 +- .../base_or_merge_rollup_public_inputs.nr | 6 ++- ...block_root_or_block_merge_public_inputs.nr | 4 +- .../src/abis/constant_rollup_data.nr | 3 +- .../src/abis/previous_rollup_block_data.nr | 7 ++- .../src/abis/previous_rollup_data.nr | 7 ++- .../rollup-lib/src/base/base_rollup_inputs.nr | 34 ++++++++---- .../rollup-lib/src/base/state_diff_hints.nr | 3 +- .../block_root/block_root_rollup_inputs.nr | 10 ++-- .../crates/rollup-lib/src/components.nr | 9 ++-- .../src/tests/block_root_rollup_inputs.nr | 3 +- .../combined_accumulated_data.nr | 7 ++- .../private_accumulated_data.nr | 10 ++-- .../private_accumulated_data_builder.nr | 10 ++-- .../public_accumulated_data.nr | 11 ++-- .../public_accumulated_data_builder.nr | 14 +++-- .../crates/types/src/abis/call_context.nr | 7 ++- .../crates/types/src/abis/function_data.nr | 3 +- .../crates/types/src/abis/gas.nr | 3 +- .../crates/types/src/abis/gas_settings.nr | 4 +- .../crates/types/src/abis/global_variables.nr | 6 ++- .../kernel_circuit_public_inputs.nr | 7 ++- .../private_kernel_circuit_public_inputs.nr | 7 ++- ...te_kernel_circuit_public_inputs_builder.nr | 4 +- .../public_kernel_circuit_public_inputs.nr | 7 ++- ...ic_kernel_circuit_public_inputs_builder.nr | 4 +- .../vm_circuit_public_inputs.nr | 12 +++-- .../crates/types/src/abis/kernel_data.nr | 6 ++- .../crates/types/src/abis/log_hash.nr | 7 ++- .../crates/types/src/abis/note_hash.nr | 6 ++- .../types/src/abis/note_hash_leaf_preimage.nr | 6 ++- .../crates/types/src/abis/nullifier.nr | 6 ++- .../types/src/abis/nullifier_leaf_preimage.nr | 6 ++- .../types/src/abis/private_call_request.nr | 3 +- .../src/abis/private_circuit_public_inputs.nr | 20 ++++--- .../abis/private_kernel/private_call_data.nr | 3 +- .../types/src/abis/private_kernel_data.nr | 3 +- .../types/src/abis/public_call_request.nr | 6 ++- .../src/abis/public_circuit_public_inputs.nr | 12 +++-- .../crates/types/src/abis/public_data_read.nr | 4 +- .../src/abis/public_data_update_request.nr | 7 ++- .../types/src/abis/public_data_write.nr | 6 ++- .../src/abis/public_inner_call_request.nr | 3 +- .../types/src/abis/public_kernel_data.nr | 6 ++- .../crates/types/src/abis/read_request.nr | 6 ++- .../key_validation_request_and_generator.nr | 7 ++- .../private_validation_requests.nr | 4 +- .../private_validation_requests_builder.nr | 6 ++- .../public_validation_requests.nr | 4 +- .../public_validation_requests_builder.nr | 10 ++-- .../rollup_validation_requests.nr | 6 ++- ...ed_key_validation_request_and_generator.nr | 7 ++- .../crates/types/src/address/aztec_address.nr | 16 +++--- .../types/src/address/partial_address.nr | 6 ++- .../crates/types/src/contract_instance.nr | 7 ++- .../src/contrakt/storage_update_request.nr | 3 +- .../crates/types/src/data/public_data_hint.nr | 3 +- .../types/src/data/public_data_tree_leaf.nr | 3 +- .../crates/types/src/hash.nr | 12 +++-- .../crates/types/src/header.nr | 7 ++- .../types/src/merkle_tree/indexed_tree.nr | 4 +- .../types/src/merkle_tree/membership.nr | 6 ++- .../types/src/messaging/l2_to_l1_message.nr | 6 ++- .../types/src/partial_state_reference.nr | 3 +- .../crates/types/src/public_keys.nr | 4 +- .../types/src/recursion/verification_key.nr | 3 +- .../crates/types/src/state_reference.nr | 3 +- .../crates/types/src/tests/fixture_builder.nr | 54 +++++++++++++------ .../types/src/tests/fixtures/contracts.nr | 6 ++- .../types/src/tests/merkle_tree_utils.nr | 3 +- .../types/src/transaction/tx_context.nr | 6 ++- .../types/src/transaction/tx_request.nr | 13 +++-- .../src/utils/arrays/assert_array_appended.nr | 4 +- ...combined_sorted_transformed_value_array.nr | 9 ++-- .../get_combined_order_hints.nr | 3 +- .../src/utils/arrays/assert_deduped_array.nr | 6 ++- ..._exposed_sorted_transformed_value_array.nr | 3 +- .../get_order_hints.nr | 3 +- ...t_split_sorted_transformed_value_arrays.nr | 3 +- .../get_split_order_hints.nr | 3 +- 236 files changed, 1060 insertions(+), 527 deletions(-) diff --git a/noir-projects/aztec-nr/address-note/src/address_note.nr b/noir-projects/aztec-nr/address-note/src/address_note.nr index a1202c46fe6..a1207e21603 100644 --- a/noir-projects/aztec-nr/address-note/src/address_note.nr +++ b/noir-projects/aztec-nr/address-note/src/address_note.nr @@ -1,9 +1,12 @@ use dep::aztec::{ - context::PrivateContext, keys::getters::get_nsk_app, macros::notes::note, + context::PrivateContext, + keys::getters::get_nsk_app, + macros::notes::note, note::{ note_header::NoteHeader, note_interface::NullifiableNote, utils::compute_note_hash_for_nullify, - }, oracle::random::random, + }, + oracle::random::random, protocol_types::{ address::AztecAddress, constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, diff --git a/noir-projects/aztec-nr/authwit/src/account.nr b/noir-projects/aztec-nr/authwit/src/account.nr index d9f6f49f74d..93c8ce72666 100644 --- a/noir-projects/aztec-nr/authwit/src/account.nr +++ b/noir-projects/aztec-nr/authwit/src/account.nr @@ -1,5 +1,6 @@ use dep::aztec::{ - context::PrivateContext, hash::poseidon2_hash_with_separator, + context::PrivateContext, + hash::poseidon2_hash_with_separator, protocol_types::constants::{GENERATOR_INDEX__COMBINED_PAYLOAD, GENERATOR_INDEX__TX_NULLIFIER}, }; diff --git a/noir-projects/aztec-nr/authwit/src/auth.nr b/noir-projects/aztec-nr/authwit/src/auth.nr index a4ff281cb6d..a3f15076f98 100644 --- a/noir-projects/aztec-nr/authwit/src/auth.nr +++ b/noir-projects/aztec-nr/authwit/src/auth.nr @@ -1,10 +1,12 @@ use dep::aztec::{context::{gas::GasOpts, PrivateContext, PublicContext}, hash::hash_args_array}; use dep::aztec::protocol_types::{ - abis::function_selector::FunctionSelector, address::AztecAddress, + abis::function_selector::FunctionSelector, + address::AztecAddress, constants::{ CANONICAL_AUTH_REGISTRY_ADDRESS, GENERATOR_INDEX__AUTHWIT_INNER, GENERATOR_INDEX__AUTHWIT_NULLIFIER, GENERATOR_INDEX__AUTHWIT_OUTER, - }, hash::poseidon2_hash_with_separator, + }, + hash::poseidon2_hash_with_separator, }; /** diff --git a/noir-projects/aztec-nr/authwit/src/cheatcodes.nr b/noir-projects/aztec-nr/authwit/src/cheatcodes.nr index 5fbd1875d26..8e1b3909044 100644 --- a/noir-projects/aztec-nr/authwit/src/cheatcodes.nr +++ b/noir-projects/aztec-nr/authwit/src/cheatcodes.nr @@ -1,7 +1,9 @@ use dep::aztec::{ - context::{call_interfaces::CallInterface, public_context::PublicContext}, hash::hash_args, + context::{call_interfaces::CallInterface, public_context::PublicContext}, + hash::hash_args, oracle::execution::{get_block_number, get_contract_address}, - protocol_types::address::AztecAddress, test::helpers::cheatcodes, + protocol_types::address::AztecAddress, + test::helpers::cheatcodes, }; use crate::auth::{compute_authwit_message_hash, compute_inner_authwit_hash, set_authorized}; @@ -45,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/authwit/src/entrypoint/app.nr b/noir-projects/aztec-nr/authwit/src/entrypoint/app.nr index 1aac89e567f..3b1c1be2b53 100644 --- a/noir-projects/aztec-nr/authwit/src/entrypoint/app.nr +++ b/noir-projects/aztec-nr/authwit/src/entrypoint/app.nr @@ -1,6 +1,7 @@ use dep::aztec::prelude::PrivateContext; use dep::aztec::protocol_types::{ - constants::GENERATOR_INDEX__SIGNATURE_PAYLOAD, hash::poseidon2_hash_with_separator, + constants::GENERATOR_INDEX__SIGNATURE_PAYLOAD, + hash::poseidon2_hash_with_separator, traits::{Hash, Serialize}, }; diff --git a/noir-projects/aztec-nr/authwit/src/entrypoint/fee.nr b/noir-projects/aztec-nr/authwit/src/entrypoint/fee.nr index f2e1d4748c7..2adddbff69b 100644 --- a/noir-projects/aztec-nr/authwit/src/entrypoint/fee.nr +++ b/noir-projects/aztec-nr/authwit/src/entrypoint/fee.nr @@ -1,7 +1,8 @@ use crate::entrypoint::function_call::FunctionCall; use dep::aztec::prelude::PrivateContext; use dep::aztec::protocol_types::{ - constants::GENERATOR_INDEX__FEE_PAYLOAD, hash::poseidon2_hash_with_separator, + constants::GENERATOR_INDEX__FEE_PAYLOAD, + hash::poseidon2_hash_with_separator, traits::{Hash, Serialize}, }; diff --git a/noir-projects/aztec-nr/aztec/src/context/private_context.nr b/noir-projects/aztec-nr/aztec/src/context/private_context.nr index b073ce989e1..1465b61e8c6 100644 --- a/noir-projects/aztec-nr/aztec/src/context/private_context.nr +++ b/noir-projects/aztec-nr/aztec/src/context/private_context.nr @@ -4,23 +4,33 @@ use crate::{ keys::constants::{NULLIFIER_INDEX, NUM_KEY_TYPES, OUTGOING_INDEX, sk_generators}, messaging::process_l1_to_l2_message, oracle::{ - arguments, call_private_function::call_private_function_internal, + arguments, + call_private_function::call_private_function_internal, enqueue_public_function_call::{ enqueue_public_function_call_internal, notify_set_min_revertible_side_effect_counter, set_public_teardown_function_call_internal, - }, header::get_header_at, key_validation_request::get_key_validation_request, - logs::{emit_encrypted_event_log, emit_encrypted_note_log}, returns::pack_returns, + }, + header::get_header_at, + key_validation_request::get_key_validation_request, + logs::{emit_encrypted_event_log, emit_encrypted_note_log}, + returns::pack_returns, }, }; use dep::protocol_types::{ abis::{ - call_context::CallContext, function_selector::FunctionSelector, - log_hash::{EncryptedLogHash, LogHash, NoteLogHash}, max_block_number::MaxBlockNumber, - note_hash::NoteHash, nullifier::Nullifier, private_call_request::PrivateCallRequest, + call_context::CallContext, + function_selector::FunctionSelector, + log_hash::{EncryptedLogHash, LogHash, NoteLogHash}, + max_block_number::MaxBlockNumber, + note_hash::NoteHash, + nullifier::Nullifier, + private_call_request::PrivateCallRequest, private_circuit_public_inputs::PrivateCircuitPublicInputs, - public_call_request::PublicCallRequest, read_request::ReadRequest, + public_call_request::PublicCallRequest, + read_request::ReadRequest, validation_requests::{KeyValidationRequest, KeyValidationRequestAndGenerator}, - }, address::{AztecAddress, EthAddress}, + }, + address::{AztecAddress, EthAddress}, constants::{ MAX_ENCRYPTED_LOGS_PER_CALL, MAX_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_L2_TO_L1_MSGS_PER_CALL, MAX_NOTE_ENCRYPTED_LOGS_PER_CALL, @@ -28,7 +38,10 @@ use dep::protocol_types::{ MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIERS_PER_CALL, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, MAX_UNENCRYPTED_LOGS_PER_CALL, PUBLIC_DISPATCH_SELECTOR, - }, header::Header, messaging::l2_to_l1_message::L2ToL1Message, traits::Empty, + }, + header::Header, + messaging::l2_to_l1_message::L2ToL1Message, + traits::Empty, }; // When finished, one can call .finish() to convert back to the abi 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 fd1d4ce2d8c..5cccd74799b 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 @@ -3,7 +3,9 @@ use crate::{ event::event_interface::EventInterface, keys::getters::get_ovsk_app, oracle::random::random, }; use dep::protocol_types::{ - address::AztecAddress, hash::sha256_to_field, public_keys::{IvpkM, OvpkM}, + address::AztecAddress, + hash::sha256_to_field, + public_keys::{IvpkM, OvpkM}, }; fn compute_raw_event_log( 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 76a35bc70be..5239418d7b9 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,9 +1,13 @@ use crate::{ - context::PrivateContext, encrypted_logs::payload::compute_encrypted_log, - keys::getters::get_ovsk_app, note::{note_emission::NoteEmission, note_interface::NoteInterface}, + context::PrivateContext, + encrypted_logs::payload::compute_encrypted_log, + keys::getters::get_ovsk_app, + note::{note_emission::NoteEmission, note_interface::NoteInterface}, }; use dep::protocol_types::{ - abis::note_hash::NoteHash, address::AztecAddress, hash::sha256_to_field, + abis::note_hash::NoteHash, + address::AztecAddress, + hash::sha256_to_field, public_keys::{IvpkM, OvpkM, PublicKeys}, }; diff --git a/noir-projects/aztec-nr/aztec/src/encrypted_logs/header.nr b/noir-projects/aztec-nr/aztec/src/encrypted_logs/header.nr index 36c522766a2..54850470e1c 100644 --- a/noir-projects/aztec-nr/aztec/src/encrypted_logs/header.nr +++ b/noir-projects/aztec-nr/aztec/src/encrypted_logs/header.nr @@ -1,5 +1,8 @@ use dep::protocol_types::{ - address::AztecAddress, point::Point, public_keys::{IvpkM, PublicKeys, ToPoint}, scalar::Scalar, + address::AztecAddress, + point::Point, + public_keys::{IvpkM, PublicKeys, ToPoint}, + scalar::Scalar, }; use crate::keys::point_to_symmetric_key::point_to_symmetric_key; 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 725fffc5ce8..9831127a58c 100644 --- a/noir-projects/aztec-nr/aztec/src/encrypted_logs/payload.nr +++ b/noir-projects/aztec-nr/aztec/src/encrypted_logs/payload.nr @@ -1,6 +1,10 @@ use dep::protocol_types::{ - address::AztecAddress, constants::GENERATOR_INDEX__SYMMETRIC_KEY, - hash::poseidon2_hash_with_separator, point::Point, public_keys::{IvpkM, OvpkM}, scalar::Scalar, + address::AztecAddress, + constants::GENERATOR_INDEX__SYMMETRIC_KEY, + hash::poseidon2_hash_with_separator, + point::Point, + public_keys::{IvpkM, OvpkM}, + scalar::Scalar, }; use std::{ aes128::aes128_encrypt, embedded_curve_ops::fixed_base_scalar_mul as derive_public_key, @@ -159,7 +163,10 @@ mod test { compute_encrypted_log, compute_incoming_body_ciphertext, compute_outgoing_body_ciphertext, }; use dep::protocol_types::{ - address::AztecAddress, point::Point, public_keys::{IvpkM, OvpkM}, scalar::Scalar, + address::AztecAddress, + point::Point, + public_keys::{IvpkM, OvpkM}, + scalar::Scalar, }; use std::embedded_curve_ops::fixed_base_scalar_mul as derive_public_key; use std::test::OracleMock; diff --git a/noir-projects/aztec-nr/aztec/src/hash.nr b/noir-projects/aztec-nr/aztec/src/hash.nr index ba0b9943517..4e5b9111463 100644 --- a/noir-projects/aztec-nr/aztec/src/hash.nr +++ b/noir-projects/aztec-nr/aztec/src/hash.nr @@ -4,8 +4,10 @@ use dep::protocol_types::{ constants::{ GENERATOR_INDEX__FUNCTION_ARGS, GENERATOR_INDEX__MESSAGE_NULLIFIER, GENERATOR_INDEX__SECRET_HASH, - }, hash::{poseidon2_hash_with_separator, poseidon2_hash_with_separator_slice, sha256_to_field}, - point::Point, traits::Hash, + }, + hash::{poseidon2_hash_with_separator, poseidon2_hash_with_separator_slice, sha256_to_field}, + point::Point, + traits::Hash, }; pub use dep::protocol_types::hash::{compute_siloed_nullifier, pedersen_hash}; diff --git a/noir-projects/aztec-nr/aztec/src/history/nullifier_non_inclusion.nr b/noir-projects/aztec-nr/aztec/src/history/nullifier_non_inclusion.nr index 31f1e63f006..95a43086b2b 100644 --- a/noir-projects/aztec-nr/aztec/src/history/nullifier_non_inclusion.nr +++ b/noir-projects/aztec-nr/aztec/src/history/nullifier_non_inclusion.nr @@ -4,7 +4,8 @@ use crate::{ oracle::get_nullifier_membership_witness::get_low_nullifier_membership_witness, }; use dep::protocol_types::{ - header::Header, utils::field::{full_field_greater_than, full_field_less_than}, + header::Header, + utils::field::{full_field_greater_than, full_field_less_than}, }; use dep::protocol_types::merkle_tree::root::root_from_sibling_path; 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 328c218926b..f587c76aa11 100644 --- a/noir-projects/aztec-nr/aztec/src/macros/functions/interfaces.nr +++ b/noir-projects/aztec-nr/aztec/src/macros/functions/interfaces.nr @@ -3,7 +3,8 @@ use crate::macros::utils::{ is_fn_view, }; use std::{ - collections::umap::UHashMap, hash::{BuildHasherDefault, poseidon2::Poseidon2Hasher}, + collections::umap::UHashMap, + hash::{BuildHasherDefault, poseidon2::Poseidon2Hasher}, meta::{type_of, unquote}, }; @@ -13,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 { @@ -96,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 0e327112135..4c24f7f5920 100644 --- a/noir-projects/aztec-nr/aztec/src/macros/notes/mod.nr +++ b/noir-projects/aztec-nr/aztec/src/macros/notes/mod.nr @@ -1,7 +1,8 @@ use crate::note::{note_getter_options::PropertySelector, note_header::NoteHeader}; use protocol_types::meta::{flatten_to_fields, pack_from_fields}; use std::{ - collections::umap::UHashMap, hash::{BuildHasherDefault, poseidon2::Poseidon2Hasher}, + collections::umap::UHashMap, + hash::{BuildHasherDefault, poseidon2::Poseidon2Hasher}, meta::{typ::fresh_type_variable, type_of, unquote}, }; @@ -200,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/storage/mod.nr b/noir-projects/aztec-nr/aztec/src/macros/storage/mod.nr index c9535db0716..5d1e27c7a49 100644 --- a/noir-projects/aztec-nr/aztec/src/macros/storage/mod.nr +++ b/noir-projects/aztec-nr/aztec/src/macros/storage/mod.nr @@ -1,5 +1,6 @@ use std::{ - collections::umap::UHashMap, hash::{BuildHasherDefault, poseidon2::Poseidon2Hasher}, + collections::umap::UHashMap, + hash::{BuildHasherDefault, poseidon2::Poseidon2Hasher}, meta::unquote, }; 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/messaging.nr b/noir-projects/aztec-nr/aztec/src/messaging.nr index 6353ce6d4fd..6679fe0671e 100644 --- a/noir-projects/aztec-nr/aztec/src/messaging.nr +++ b/noir-projects/aztec-nr/aztec/src/messaging.nr @@ -4,7 +4,8 @@ use crate::{ }; use dep::protocol_types::{ - address::{AztecAddress, EthAddress}, merkle_tree::root::root_from_sibling_path, + address::{AztecAddress, EthAddress}, + merkle_tree::root::root_from_sibling_path, }; pub fn process_l1_to_l2_message( diff --git a/noir-projects/aztec-nr/aztec/src/note/lifecycle.nr b/noir-projects/aztec-nr/aztec/src/note/lifecycle.nr index ca5f5a78be6..d07e61e8b6b 100644 --- a/noir-projects/aztec-nr/aztec/src/note/lifecycle.nr +++ b/noir-projects/aztec-nr/aztec/src/note/lifecycle.nr @@ -1,6 +1,7 @@ use crate::context::{PrivateContext, PublicContext}; use crate::note::{ - note_emission::NoteEmission, note_header::NoteHeader, + note_emission::NoteEmission, + note_header::NoteHeader, note_interface::{NoteInterface, NullifiableNote}, utils::{compute_note_hash_for_nullify_internal, compute_note_hash_for_read_request}, }; diff --git a/noir-projects/aztec-nr/aztec/src/note/note_getter/mod.nr b/noir-projects/aztec-nr/aztec/src/note/note_getter/mod.nr index 597176bd132..52e8a14b64b 100644 --- a/noir-projects/aztec-nr/aztec/src/note/note_getter/mod.nr +++ b/noir-projects/aztec-nr/aztec/src/note/note_getter/mod.nr @@ -2,7 +2,8 @@ use crate::context::PrivateContext; use crate::note::{ constants::{GET_NOTE_ORACLE_RETURN_LENGTH, VIEW_NOTE_ORACLE_RETURN_LENGTH}, note_getter_options::{NoteGetterOptions, NoteStatus, PropertySelector, Select, Sort, SortOrder}, - note_interface::{NoteInterface, NullifiableNote}, note_viewer_options::NoteViewerOptions, + note_interface::{NoteInterface, NullifiableNote}, + note_viewer_options::NoteViewerOptions, utils::compute_note_hash_for_read_request, }; use crate::oracle; diff --git a/noir-projects/aztec-nr/aztec/src/note/note_getter/test.nr b/noir-projects/aztec-nr/aztec/src/note/note_getter/test.nr index 6e805ef07f4..48728210d4b 100644 --- a/noir-projects/aztec-nr/aztec/src/note/note_getter/test.nr +++ b/noir-projects/aztec-nr/aztec/src/note/note_getter/test.nr @@ -2,7 +2,8 @@ use crate::{ note::{ note_getter::constrain_get_notes_internal, note_getter_options::{NoteGetterOptions, PropertySelector, SortOrder}, - }, oracle::execution::get_contract_address, + }, + oracle::execution::get_contract_address, }; use dep::protocol_types::constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL; diff --git a/noir-projects/aztec-nr/aztec/src/note/utils.nr b/noir-projects/aztec-nr/aztec/src/note/utils.nr index 59e805cd06f..6f3031f0384 100644 --- a/noir-projects/aztec-nr/aztec/src/note/utils.nr +++ b/noir-projects/aztec-nr/aztec/src/note/utils.nr @@ -8,7 +8,8 @@ use dep::protocol_types::{ compute_siloed_note_hash as compute_siloed_note_hash, compute_siloed_nullifier as compute_siloed_nullifier_from_preimage, compute_unique_note_hash, - }, utils::arr_copy_slice, + }, + utils::arr_copy_slice, }; pub fn compute_siloed_nullifier( diff --git a/noir-projects/aztec-nr/aztec/src/oracle/get_membership_witness.nr b/noir-projects/aztec-nr/aztec/src/oracle/get_membership_witness.nr index 3987fab937a..fed4c3b66b7 100644 --- a/noir-projects/aztec-nr/aztec/src/oracle/get_membership_witness.nr +++ b/noir-projects/aztec-nr/aztec/src/oracle/get_membership_witness.nr @@ -1,5 +1,6 @@ use dep::protocol_types::{ - constants::{ARCHIVE_HEIGHT, NOTE_HASH_TREE_HEIGHT}, utils::arr_copy_slice, + constants::{ARCHIVE_HEIGHT, NOTE_HASH_TREE_HEIGHT}, + utils::arr_copy_slice, }; global NOTE_HASH_TREE_ID = 1; diff --git a/noir-projects/aztec-nr/aztec/src/oracle/get_nullifier_membership_witness.nr b/noir-projects/aztec-nr/aztec/src/oracle/get_nullifier_membership_witness.nr index 00805d190a7..bfdf6a6d759 100644 --- a/noir-projects/aztec-nr/aztec/src/oracle/get_nullifier_membership_witness.nr +++ b/noir-projects/aztec-nr/aztec/src/oracle/get_nullifier_membership_witness.nr @@ -1,6 +1,7 @@ use dep::protocol_types::{ abis::nullifier_leaf_preimage::{NULLIFIER_LEAF_PREIMAGE_LENGTH, NullifierLeafPreimage}, - constants::NULLIFIER_TREE_HEIGHT, utils::arr_copy_slice, + constants::NULLIFIER_TREE_HEIGHT, + utils::arr_copy_slice, }; // INDEX_LENGTH + NULLIFIER_LEAF_PREIMAGE_LENGTH + NULLIFIER_TREE_HEIGHT diff --git a/noir-projects/aztec-nr/aztec/src/oracle/keys.nr b/noir-projects/aztec-nr/aztec/src/oracle/keys.nr index 84646ab2595..f29c0e8b2f7 100644 --- a/noir-projects/aztec-nr/aztec/src/oracle/keys.nr +++ b/noir-projects/aztec-nr/aztec/src/oracle/keys.nr @@ -1,5 +1,6 @@ use dep::protocol_types::{ - address::{AztecAddress, PartialAddress}, point::Point, + address::{AztecAddress, PartialAddress}, + point::Point, public_keys::{IvpkM, NpkM, OvpkM, PublicKeys, TpkM}, }; diff --git a/noir-projects/aztec-nr/aztec/src/prelude.nr b/noir-projects/aztec-nr/aztec/src/prelude.nr index ba2f4d10655..04dee82bf14 100644 --- a/noir-projects/aztec-nr/aztec/src/prelude.nr +++ b/noir-projects/aztec-nr/aztec/src/prelude.nr @@ -2,8 +2,10 @@ pub use crate::{ context::{FunctionReturns, PackedReturns, PrivateContext, PublicContext}, note::{ - note_getter_options::NoteGetterOptions, note_header::NoteHeader, - note_interface::{NoteInterface, NullifiableNote}, note_viewer_options::NoteViewerOptions, + note_getter_options::NoteGetterOptions, + note_header::NoteHeader, + note_interface::{NoteInterface, NullifiableNote}, + note_viewer_options::NoteViewerOptions, utils::compute_note_hash_and_optionally_a_nullifier as utils_compute_note_hash_and_optionally_a_nullifier, }, state_vars::{ @@ -13,7 +15,9 @@ pub use crate::{ }, }; pub use dep::protocol_types::{ - abis::function_selector::FunctionSelector, address::{AztecAddress, EthAddress}, point::Point, + abis::function_selector::FunctionSelector, + address::{AztecAddress, EthAddress}, + point::Point, traits::{Deserialize, Serialize}, }; // docs:end:prelude diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/private_immutable.nr b/noir-projects/aztec-nr/aztec/src/state_vars/private_immutable.nr index 1f111b5a6e3..81bb6e42e6f 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/private_immutable.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/private_immutable.nr @@ -4,8 +4,11 @@ use dep::protocol_types::{ use crate::context::{PrivateContext, UnconstrainedContext}; use crate::note::{ - lifecycle::create_note, note_emission::NoteEmission, note_getter::{get_note, view_notes}, - note_interface::{NoteInterface, NullifiableNote}, note_viewer_options::NoteViewerOptions, + lifecycle::create_note, + note_emission::NoteEmission, + note_getter::{get_note, view_notes}, + note_interface::{NoteInterface, NullifiableNote}, + note_viewer_options::NoteViewerOptions, }; use crate::oracle::notes::check_nullifier_exists; use crate::state_vars::storage::Storage; diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/private_mutable.nr b/noir-projects/aztec-nr/aztec/src/state_vars/private_mutable.nr index 55c7b10ccec..7b144d1302a 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/private_mutable.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/private_mutable.nr @@ -4,8 +4,10 @@ use dep::protocol_types::{ use crate::context::{PrivateContext, UnconstrainedContext}; use crate::note::{ - lifecycle::{create_note, destroy_note_unsafe}, note_emission::NoteEmission, - note_getter::{get_note, view_notes}, note_interface::{NoteInterface, NullifiableNote}, + lifecycle::{create_note, destroy_note_unsafe}, + note_emission::NoteEmission, + note_getter::{get_note, view_notes}, + note_interface::{NoteInterface, NullifiableNote}, note_viewer_options::NoteViewerOptions, }; use crate::oracle::notes::check_nullifier_exists; diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/private_set.nr b/noir-projects/aztec-nr/aztec/src/state_vars/private_set.nr index a46d8a6f0db..b63638fc33f 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/private_set.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/private_set.nr @@ -2,9 +2,12 @@ use crate::context::{PrivateContext, PublicContext, UnconstrainedContext}; use crate::note::{ constants::MAX_NOTES_PER_PAGE, lifecycle::{create_note, create_note_hash_from_public, destroy_note_unsafe}, - note_emission::NoteEmission, note_getter::{get_notes, view_notes}, - note_getter_options::NoteGetterOptions, note_interface::{NoteInterface, NullifiableNote}, - note_viewer_options::NoteViewerOptions, utils::compute_note_hash_for_read_request, + note_emission::NoteEmission, + note_getter::{get_notes, view_notes}, + note_getter_options::NoteGetterOptions, + note_interface::{NoteInterface, NullifiableNote}, + note_viewer_options::NoteViewerOptions, + utils::compute_note_hash_for_read_request, }; use crate::state_vars::storage::Storage; use dep::protocol_types::{ diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/public_immutable.nr b/noir-projects/aztec-nr/aztec/src/state_vars/public_immutable.nr index 4fac882d8a9..1e9afe1de55 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/public_immutable.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/public_immutable.nr @@ -1,6 +1,7 @@ use crate::{context::{PublicContext, UnconstrainedContext}, state_vars::storage::Storage}; use dep::protocol_types::{ - constants::INITIALIZATION_SLOT_SEPARATOR, traits::{Deserialize, Serialize}, + constants::INITIALIZATION_SLOT_SEPARATOR, + traits::{Deserialize, Serialize}, }; // Just like SharedImmutable but without the ability to read from private functions. diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/shared_immutable.nr b/noir-projects/aztec-nr/aztec/src/state_vars/shared_immutable.nr index 8c6f3ecb9ab..00add0afb26 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/shared_immutable.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/shared_immutable.nr @@ -1,8 +1,10 @@ use crate::{ - context::{PrivateContext, PublicContext, UnconstrainedContext}, state_vars::storage::Storage, + context::{PrivateContext, PublicContext, UnconstrainedContext}, + state_vars::storage::Storage, }; use dep::protocol_types::{ - constants::INITIALIZATION_SLOT_SEPARATOR, traits::{Deserialize, Serialize}, + constants::INITIALIZATION_SLOT_SEPARATOR, + traits::{Deserialize, Serialize}, }; // Just like PublicImmutable but with the ability to read from private functions. diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/shared_mutable.nr b/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/shared_mutable.nr index 69bdb6f7fe7..0a499c40c70 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/shared_mutable.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/shared_mutable.nr @@ -1,6 +1,8 @@ use dep::protocol_types::{ - address::AztecAddress, hash::{poseidon2_hash, poseidon2_hash_with_separator}, - traits::{FromField, ToField}, utils::arrays::array_concat, + address::AztecAddress, + hash::{poseidon2_hash, poseidon2_hash_with_separator}, + traits::{FromField, ToField}, + utils::arrays::array_concat, }; use crate::context::{PrivateContext, PublicContext, UnconstrainedContext}; @@ -8,7 +10,8 @@ use crate::oracle::storage::storage_read; use crate::state_vars::{ shared_mutable::{ scheduled_delay_change::ScheduledDelayChange, scheduled_value_change::ScheduledValueChange, - }, storage::Storage, + }, + storage::Storage, }; use dep::std::mem::zeroed; diff --git a/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/test.nr b/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/test.nr index 22ce91f389c..cdf5414ec83 100644 --- a/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/test.nr +++ b/noir-projects/aztec-nr/aztec/src/state_vars/shared_mutable/test.nr @@ -3,7 +3,8 @@ use crate::{ state_vars::shared_mutable::{ scheduled_delay_change::ScheduledDelayChange, scheduled_value_change::ScheduledValueChange, shared_mutable::SharedMutable, - }, test::helpers::test_environment::TestEnvironment, + }, + test::helpers::test_environment::TestEnvironment, }; use dep::std::{mem::zeroed, test::OracleMock}; 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 4c322d77592..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 @@ -9,7 +9,8 @@ use crate::test::helpers::{cheatcodes, utils::Deployer}; use crate::note::{note_header::NoteHeader, note_interface::{NoteInterface, NullifiableNote}}; use crate::oracle::{ - execution::{get_block_number, get_contract_address}, notes::notify_created_note, + execution::{get_block_number, get_contract_address}, + notes::notify_created_note, }; use protocol_types::constants::PUBLIC_DISPATCH_SELECTOR; @@ -47,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 e4518510b38..5b28a1a1253 100644 --- a/noir-projects/aztec-nr/aztec/src/test/helpers/utils.nr +++ b/noir-projects/aztec-nr/aztec/src/test/helpers/utils.nr @@ -1,6 +1,8 @@ use dep::protocol_types::{ - abis::function_selector::FunctionSelector, address::AztecAddress, - contract_instance::ContractInstance, public_keys::{PUBLIC_KEYS_LENGTH, PublicKeys}, + abis::function_selector::FunctionSelector, + address::AztecAddress, + contract_instance::ContractInstance, + public_keys::{PUBLIC_KEYS_LENGTH, PublicKeys}, traits::{Deserialize, Serialize}, }; @@ -70,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( @@ -101,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/aztec-nr/aztec/src/test/mocks/mock_note.nr b/noir-projects/aztec-nr/aztec/src/test/mocks/mock_note.nr index 2ec80c7fc5d..299204688a0 100644 --- a/noir-projects/aztec-nr/aztec/src/test/mocks/mock_note.nr +++ b/noir-projects/aztec-nr/aztec/src/test/mocks/mock_note.nr @@ -1,5 +1,6 @@ use crate::{ - context::PrivateContext, generators::Ga1 as G_val, + context::PrivateContext, + generators::Ga1 as G_val, note::{ note_header::NoteHeader, note_interface::NoteInterface, utils::compute_note_hash_for_nullify, diff --git a/noir-projects/aztec-nr/uint-note/src/uint_note.nr b/noir-projects/aztec-nr/uint-note/src/uint_note.nr index 2a28cc9687c..44ab33c7201 100644 --- a/noir-projects/aztec-nr/uint-note/src/uint_note.nr +++ b/noir-projects/aztec-nr/uint-note/src/uint_note.nr @@ -1,5 +1,7 @@ use dep::aztec::{ - keys::getters::get_nsk_app, macros::notes::note, note::utils::compute_note_hash_for_nullify, + keys::getters::get_nsk_app, + macros::notes::note, + note::utils::compute_note_hash_for_nullify, prelude::{NullifiableNote, PrivateContext}, protocol_types::{ constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, diff --git a/noir-projects/aztec-nr/value-note/src/value_note.nr b/noir-projects/aztec-nr/value-note/src/value_note.nr index bc64e6e8e61..c243dbea25c 100644 --- a/noir-projects/aztec-nr/value-note/src/value_note.nr +++ b/noir-projects/aztec-nr/value-note/src/value_note.nr @@ -1,9 +1,12 @@ use dep::aztec::{ - context::PrivateContext, keys::getters::get_nsk_app, macros::notes::note, + context::PrivateContext, + keys::getters::get_nsk_app, + macros::notes::note, note::{ note_header::NoteHeader, note_interface::NullifiableNote, utils::compute_note_hash_for_nullify, - }, oracle::random::random, + }, + oracle::random::random, protocol_types::{ constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, traits::Serialize, diff --git a/noir-projects/noir-contracts/contracts/app_subscription_contract/src/dapp_payload.nr b/noir-projects/noir-contracts/contracts/app_subscription_contract/src/dapp_payload.nr index 67021fef75e..af2919e229e 100644 --- a/noir-projects/noir-contracts/contracts/app_subscription_contract/src/dapp_payload.nr +++ b/noir-projects/noir-contracts/contracts/app_subscription_contract/src/dapp_payload.nr @@ -1,6 +1,7 @@ use dep::aztec::prelude::{AztecAddress, PrivateContext}; use dep::aztec::protocol_types::{ - constants::GENERATOR_INDEX__SIGNATURE_PAYLOAD, hash::poseidon2_hash_with_separator, + constants::GENERATOR_INDEX__SIGNATURE_PAYLOAD, + hash::poseidon2_hash_with_separator, traits::{Hash, Serialize}, }; diff --git a/noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr b/noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr index a148ff6d4bd..e9077096fe8 100644 --- a/noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/app_subscription_contract/src/main.nr @@ -13,7 +13,8 @@ contract AppSubscription { keys::getters::get_public_keys, macros::{functions::{initializer, private, public}, storage::storage}, prelude::{AztecAddress, Map, PrivateMutable, SharedImmutable}, - protocol_types::constants::MAX_FIELD_VALUE, utils::comparison::Comparator, + protocol_types::constants::MAX_FIELD_VALUE, + utils::comparison::Comparator, }; use router::utils::privately_check_block_number; use token::Token; diff --git a/noir-projects/noir-contracts/contracts/app_subscription_contract/src/subscription_note.nr b/noir-projects/noir-contracts/contracts/app_subscription_contract/src/subscription_note.nr index 28076a47829..c8ce2bc8184 100644 --- a/noir-projects/noir-contracts/contracts/app_subscription_contract/src/subscription_note.nr +++ b/noir-projects/noir-contracts/contracts/app_subscription_contract/src/subscription_note.nr @@ -1,6 +1,9 @@ use dep::aztec::{ - hash::poseidon2_hash_with_separator, keys::getters::get_nsk_app, macros::notes::note, - note::utils::compute_note_hash_for_nullify, oracle::random::random, + hash::poseidon2_hash_with_separator, + keys::getters::get_nsk_app, + macros::notes::note, + note::utils::compute_note_hash_for_nullify, + oracle::random::random, prelude::{NoteHeader, NullifiableNote, PrivateContext}, protocol_types::constants::GENERATOR_INDEX__NOTE_NULLIFIER, }; diff --git a/noir-projects/noir-contracts/contracts/auth_contract/src/main.nr b/noir-projects/noir-contracts/contracts/auth_contract/src/main.nr index dfb8420c9c4..e14deb2bf2e 100644 --- a/noir-projects/noir-contracts/contracts/auth_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/auth_contract/src/main.nr @@ -8,7 +8,8 @@ use dep::aztec::macros::aztec; contract Auth { use dep::aztec::{ macros::{functions::{initializer, private, public, view}, storage::storage}, - protocol_types::address::AztecAddress, state_vars::{PublicImmutable, SharedMutable}, + protocol_types::address::AztecAddress, + state_vars::{PublicImmutable, SharedMutable}, }; // Authorizing a new address has a certain block delay before it goes into effect. diff --git a/noir-projects/noir-contracts/contracts/auth_registry_contract/src/main.nr b/noir-projects/noir-contracts/contracts/auth_registry_contract/src/main.nr index 68a08406c74..74423e063e0 100644 --- a/noir-projects/noir-contracts/contracts/auth_registry_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/auth_registry_contract/src/main.nr @@ -7,7 +7,8 @@ contract AuthRegistry { }; use dep::aztec::{ macros::{functions::{internal, private, public, view}, storage::storage}, - protocol_types::address::AztecAddress, state_vars::{Map, PublicMutable}, + protocol_types::address::AztecAddress, + state_vars::{Map, PublicMutable}, }; #[storage] diff --git a/noir-projects/noir-contracts/contracts/avm_initializer_test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/avm_initializer_test_contract/src/main.nr index ee1971ed733..8051e89933a 100644 --- a/noir-projects/noir-contracts/contracts/avm_initializer_test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/avm_initializer_test_contract/src/main.nr @@ -4,7 +4,8 @@ use dep::aztec::macros::aztec; contract AvmInitializerTest { // Libs use dep::aztec::{ - macros::{functions::{initializer, public}, storage::storage}, state_vars::PublicImmutable, + macros::{functions::{initializer, public}, storage::storage}, + state_vars::PublicImmutable, }; #[storage] diff --git a/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr index bd246246b4b..870c967c0b1 100644 --- a/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr @@ -39,7 +39,9 @@ contract AvmTest { abis::function_selector::FunctionSelector, storage::map::derive_storage_slot_in_map, }; use dep::aztec::protocol_types::{ - address::{AztecAddress, EthAddress}, point::Point, scalar::Scalar, + address::{AztecAddress, EthAddress}, + point::Point, + scalar::Scalar, }; use dep::aztec::protocol_types::constants::CONTRACT_INSTANCE_LENGTH; use dep::aztec::state_vars::PublicMutable; @@ -208,7 +210,7 @@ contract AvmTest { #[public] fn to_radix_le(input: Field) -> [u8; 10] { - input.to_le_radix( /*base=*/ 2) + input.to_le_radix(/*base=*/ 2) } // Helper functions to demonstrate an internal call stack in error messages @@ -282,7 +284,7 @@ contract AvmTest { #[public] fn pedersen_hash_with_index(data: [Field; 10]) -> Field { - std::hash::pedersen_hash_with_separator(data, /*index=*/ 20) + std::hash::pedersen_hash_with_separator(data, /*index=*/ 20) } /************************************************************************ @@ -402,11 +404,11 @@ contract AvmTest { #[public] fn emit_unencrypted_log() { - context.emit_unencrypted_log( /*message=*/ [10, 20, 30]); - context.emit_unencrypted_log( /*message=*/ "Hello, world!"); + context.emit_unencrypted_log(/*message=*/ [10, 20, 30]); + context.emit_unencrypted_log(/*message=*/ "Hello, world!"); let s: CompressedString<2, 44> = CompressedString::from_string("A long time ago, in a galaxy far far away..."); - context.emit_unencrypted_log( /*message=*/ s); + context.emit_unencrypted_log(/*message=*/ s); } #[public] 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 0fe77090139..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 @@ -1,11 +1,15 @@ use dep::aztec::prelude::{AztecAddress, NoteGetterOptions, NoteViewerOptions, PrivateContext}; use dep::aztec::{ - context::UnconstrainedContext, encrypted_logs::encrypted_note_emission::encode_and_encrypt_note, - keys::getters::get_public_keys, note::constants::MAX_NOTES_PER_PAGE, + context::UnconstrainedContext, + encrypted_logs::encrypted_note_emission::encode_and_encrypt_note, + keys::getters::get_public_keys, + note::constants::MAX_NOTES_PER_PAGE, protocol_types::{ - constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, traits::{FromField, Serialize, ToField}, - }, state_vars::PrivateSet, + constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, + traits::{FromField, Serialize, ToField}, + }, + state_vars::PrivateSet, }; use dep::value_note::value_note::ValueNote; @@ -177,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/child_contract/src/main.nr b/noir-projects/noir-contracts/contracts/child_contract/src/main.nr index ed45ceb317b..178516f0e9b 100644 --- a/noir-projects/noir-contracts/contracts/child_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/child_contract/src/main.nr @@ -9,7 +9,8 @@ contract Child { encrypted_logs::encrypted_note_emission::encode_and_encrypt_note, keys::getters::get_public_keys, macros::{functions::{internal, private, public}, storage::storage}, - note::note_getter_options::NoteGetterOptions, utils::comparison::Comparator, + note::note_getter_options::NoteGetterOptions, + utils::comparison::Comparator, }; use dep::value_note::value_note::ValueNote; diff --git a/noir-projects/noir-contracts/contracts/claim_contract/src/main.nr b/noir-projects/noir-contracts/contracts/claim_contract/src/main.nr index cbe8c98a2b0..668c2c86e31 100644 --- a/noir-projects/noir-contracts/contracts/claim_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/claim_contract/src/main.nr @@ -4,7 +4,8 @@ use dep::aztec::macros::aztec; contract Claim { use dep::aztec::{ macros::{functions::{initializer, private, public}, storage::storage}, - note::utils::compute_note_hash_for_nullify, protocol_types::address::AztecAddress, + note::utils::compute_note_hash_for_nullify, + protocol_types::address::AztecAddress, state_vars::SharedImmutable, }; use dep::value_note::value_note::ValueNote; diff --git a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/class_registered.nr b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/class_registered.nr index 5e5b0b67024..3a5e11515ed 100644 --- a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/class_registered.nr +++ b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/class_registered.nr @@ -1,7 +1,9 @@ use dep::aztec::protocol_types::{ constants::{ MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS, REGISTERER_CONTRACT_CLASS_REGISTERED_MAGIC_VALUE, - }, contract_class_id::ContractClassId, traits::Serialize, + }, + contract_class_id::ContractClassId, + traits::Serialize, }; // #[event] diff --git a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/private_function_broadcasted.nr b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/private_function_broadcasted.nr index 9beb08df7e1..8ffcef81f51 100644 --- a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/private_function_broadcasted.nr +++ b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/private_function_broadcasted.nr @@ -5,7 +5,9 @@ use dep::aztec::protocol_types::{ MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS, REGISTERER_PRIVATE_FUNCTION_BROADCASTED_ADDITIONAL_FIELDS, REGISTERER_PRIVATE_FUNCTION_BROADCASTED_MAGIC_VALUE, - }, contract_class_id::ContractClassId, traits::Serialize, + }, + contract_class_id::ContractClassId, + traits::Serialize, }; pub struct InnerPrivateFunction { diff --git a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/unconstrained_function_broadcasted.nr b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/unconstrained_function_broadcasted.nr index 89de5af946c..f81da27fb8c 100644 --- a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/unconstrained_function_broadcasted.nr +++ b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/events/unconstrained_function_broadcasted.nr @@ -5,7 +5,9 @@ use dep::aztec::protocol_types::{ MAX_PACKED_BYTECODE_SIZE_PER_UNCONSTRAINED_FUNCTION_IN_FIELDS, REGISTERER_UNCONSTRAINED_FUNCTION_BROADCASTED_ADDITIONAL_FIELDS, REGISTERER_UNCONSTRAINED_FUNCTION_BROADCASTED_MAGIC_VALUE, - }, contract_class_id::ContractClassId, traits::Serialize, + }, + contract_class_id::ContractClassId, + traits::Serialize, }; pub struct InnerUnconstrainedFunction { diff --git a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr index 22a6b6b241e..f268b7d3318 100644 --- a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr @@ -12,7 +12,8 @@ contract ContractClassRegisterer { MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS, MAX_PACKED_BYTECODE_SIZE_PER_UNCONSTRAINED_FUNCTION_IN_FIELDS, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS, - }, contract_class_id::ContractClassId, + }, + contract_class_id::ContractClassId, }; use dep::aztec::{ diff --git a/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/main.nr b/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/main.nr index 5e84e5deae8..7a990b386dc 100644 --- a/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/contract_instance_deployer_contract/src/main.nr @@ -3,13 +3,18 @@ use dep::aztec::macros::aztec; #[aztec] contract ContractInstanceDeployer { use dep::aztec::{ - hash::compute_unencrypted_log_hash, macros::{events::event, functions::private}, - oracle::logs::emit_unencrypted_log_private, utils::to_bytes::arr_to_be_bytes_arr, + hash::compute_unencrypted_log_hash, + macros::{events::event, functions::private}, + oracle::logs::emit_unencrypted_log_private, + utils::to_bytes::arr_to_be_bytes_arr, }; use dep::aztec::protocol_types::{ - abis::log_hash::LogHash, address::{AztecAddress, PartialAddress, PublicKeysHash}, + abis::log_hash::LogHash, + address::{AztecAddress, PartialAddress, PublicKeysHash}, constants::DEPLOYER_CONTRACT_INSTANCE_DEPLOYED_MAGIC_VALUE, - contract_class_id::ContractClassId, public_keys::PublicKeys, traits::Serialize, + contract_class_id::ContractClassId, + public_keys::PublicKeys, + traits::Serialize, }; use std::meta::derive; diff --git a/noir-projects/noir-contracts/contracts/crowdfunding_contract/src/main.nr b/noir-projects/noir-contracts/contracts/crowdfunding_contract/src/main.nr index 0d151935f87..654ca2e39c1 100644 --- a/noir-projects/noir-contracts/contracts/crowdfunding_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/crowdfunding_contract/src/main.nr @@ -10,9 +10,14 @@ contract Crowdfunding { encrypted_logs::encrypted_note_emission::encode_and_encrypt_note, keys::getters::get_public_keys, macros::{ - events::event, functions::{initializer, internal, private, public}, storage::storage, - }, prelude::{AztecAddress, PrivateSet, SharedImmutable}, protocol_types::traits::Serialize, - unencrypted_logs::unencrypted_event_emission::encode_event, utils::comparison::Comparator, + events::event, + functions::{initializer, internal, private, public}, + storage::storage, + }, + prelude::{AztecAddress, PrivateSet, SharedImmutable}, + protocol_types::traits::Serialize, + unencrypted_logs::unencrypted_event_emission::encode_event, + utils::comparison::Comparator, }; use std::meta::derive; // docs:start:import_valuenote 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-contracts/contracts/docs_example_contract/src/types/card_note.nr b/noir-projects/noir-contracts/contracts/docs_example_contract/src/types/card_note.nr index 88119054e0a..219a098ac06 100644 --- a/noir-projects/noir-contracts/contracts/docs_example_contract/src/types/card_note.nr +++ b/noir-projects/noir-contracts/contracts/docs_example_contract/src/types/card_note.nr @@ -1,5 +1,7 @@ use dep::aztec::{ - keys::getters::get_nsk_app, macros::notes::note, note::utils::compute_note_hash_for_nullify, + keys::getters::get_nsk_app, + macros::notes::note, + note::utils::compute_note_hash_for_nullify, protocol_types::{ constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, traits::Serialize, diff --git a/noir-projects/noir-contracts/contracts/ecdsa_k_account_contract/src/main.nr b/noir-projects/noir-contracts/contracts/ecdsa_k_account_contract/src/main.nr index 1405daf0889..3c7ad72c92d 100644 --- a/noir-projects/noir-contracts/contracts/ecdsa_k_account_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/ecdsa_k_account_contract/src/main.nr @@ -12,7 +12,8 @@ contract EcdsaKAccount { use dep::aztec::prelude::{PrivateContext, PrivateImmutable}; use dep::authwit::{ - account::AccountActions, auth_witness::get_auth_witness, + account::AccountActions, + auth_witness::get_auth_witness, entrypoint::{app::AppPayload, fee::FeePayload}, }; diff --git a/noir-projects/noir-contracts/contracts/ecdsa_r_account_contract/src/main.nr b/noir-projects/noir-contracts/contracts/ecdsa_r_account_contract/src/main.nr index b5db5e0d897..c166ef2aa9c 100644 --- a/noir-projects/noir-contracts/contracts/ecdsa_r_account_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/ecdsa_r_account_contract/src/main.nr @@ -11,7 +11,8 @@ contract EcdsaRAccount { use dep::aztec::prelude::{PrivateContext, PrivateImmutable}; use dep::authwit::{ - account::AccountActions, auth_witness::get_auth_witness, + account::AccountActions, + auth_witness::get_auth_witness, entrypoint::{app::AppPayload, fee::FeePayload}, }; diff --git a/noir-projects/noir-contracts/contracts/lending_contract/src/main.nr b/noir-projects/noir-contracts/contracts/lending_contract/src/main.nr index 8a1b602818a..077be6fea40 100644 --- a/noir-projects/noir-contracts/contracts/lending_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/lending_contract/src/main.nr @@ -24,7 +24,8 @@ contract Lending { use dep::token::Token; use dep::aztec::macros::{ - functions::{initializer, internal, private, public, view}, storage::storage, + functions::{initializer, internal, private, public, view}, + storage::storage, }; // Storage structure, containing all storage, and specifying what slots they use. 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 59fa53b20f3..f5d83db36a4 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/main.nr @@ -15,15 +15,21 @@ contract NFT { use dep::aztec::{ encrypted_logs::encrypted_note_emission::{ encode_and_encrypt_note, encrypt_and_emit_partial_log, - }, hash::pedersen_hash, keys::getters::get_public_keys, + }, + hash::pedersen_hash, + keys::getters::get_public_keys, macros::{ - events::event, functions::{initializer, internal, private, public, view}, + events::event, + functions::{initializer, internal, private, public, view}, storage::storage, - }, note::constants::MAX_NOTES_PER_PAGE, oracle::random::random, + }, + note::constants::MAX_NOTES_PER_PAGE, + oracle::random::random, prelude::{ AztecAddress, Map, NoteGetterOptions, NoteViewerOptions, PrivateContext, PrivateSet, PublicContext, PublicMutable, SharedImmutable, - }, protocol_types::{point::Point, traits::{is_empty, Serialize}}, + }, + protocol_types::{point::Point, traits::{is_empty, Serialize}}, utils::comparison::Comparator, }; use dep::compressed_string::FieldCompressedString; diff --git a/noir-projects/noir-contracts/contracts/nft_contract/src/test/access_control.nr b/noir-projects/noir-contracts/contracts/nft_contract/src/test/access_control.nr index fef5a236372..42373942d78 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/test/access_control.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/test/access_control.nr @@ -5,7 +5,7 @@ use crate::test::utils; unconstrained fn access_control() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, owner, recipient) = - utils::setup( /* with_account_contracts */ false); + utils::setup(/* with_account_contracts */ false); // Set a new admin NFT::at(nft_contract_address).set_admin(recipient).call(&mut env.public()); diff --git a/noir-projects/noir-contracts/contracts/nft_contract/src/test/minting.nr b/noir-projects/noir-contracts/contracts/nft_contract/src/test/minting.nr index cc9d12e24dd..5302e0e397d 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/test/minting.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/test/minting.nr @@ -4,7 +4,7 @@ use crate::test::utils; #[test] unconstrained fn mint_success() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough - let (env, nft_contract_address, owner, _) = utils::setup( /* with_account_contracts */ false); + let (env, nft_contract_address, owner, _) = utils::setup(/* with_account_contracts */ false); let token_id = 10000; NFT::at(nft_contract_address).mint(owner, token_id).call(&mut env.public()); @@ -16,7 +16,7 @@ unconstrained fn mint_success() { unconstrained fn mint_failures() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, owner, recipient) = - utils::setup( /* with_account_contracts */ false); + utils::setup(/* with_account_contracts */ false); // MINTING AS A NON-MINTER let token_id = 10000; diff --git a/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_in_private.nr b/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_in_private.nr index 63022cc57a0..b6b07566bc9 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_in_private.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_in_private.nr @@ -8,7 +8,7 @@ use aztec::oracle::random::random; unconstrained fn transfer_in_private() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ false); + utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ false); // Transfer the NFT to the recipient NFT::at(nft_contract_address).transfer_in_private(sender, recipient, token_id, 0).call( @@ -23,7 +23,7 @@ unconstrained fn transfer_in_private() { unconstrained fn transfer_in_private_to_self() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, owner, _, token_id) = - utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ false); + utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ false); // Transfer the NFT back to the owner NFT::at(nft_contract_address).transfer_in_private(owner, owner, token_id, 0).call( @@ -38,7 +38,7 @@ unconstrained fn transfer_in_private_to_self() { unconstrained fn transfer_in_private_to_non_deployed_account() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, sender, _, token_id) = - utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ false); + utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ false); let not_deployed = cheatcodes::create_account(); // Transfer the NFT to the recipient @@ -54,7 +54,7 @@ unconstrained fn transfer_in_private_to_non_deployed_account() { unconstrained fn transfer_in_private_on_behalf_of_other() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ true); + utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ true); // Transfer the NFT to the recipient let transfer_in_private_call_interface = @@ -78,7 +78,7 @@ unconstrained fn transfer_in_private_on_behalf_of_other() { unconstrained fn transfer_in_private_failure_not_an_owner() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, owner, not_owner, token_id) = - utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ false); + utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ false); // Try transferring the NFT from not_owner env.impersonate(not_owner); NFT::at(nft_contract_address).transfer_in_private(not_owner, owner, token_id, 0).call( @@ -92,7 +92,7 @@ unconstrained fn transfer_in_private_failure_on_behalf_of_self_non_zero_nonce() // The nonce check is in the beginning so we don't need to waste time on minting the NFT and transferring // it to private. let (env, nft_contract_address, sender, recipient) = - utils::setup( /* with_account_contracts */ false); + utils::setup(/* with_account_contracts */ false); // We set random value for the token_id as the nonce check is before we use the value. let token_id = random(); @@ -109,7 +109,7 @@ unconstrained fn transfer_in_private_failure_on_behalf_of_other_without_approval // The authwit check is in the beginning so we don't need to waste time on minting the NFT and transferring // it to private. let (env, nft_contract_address, sender, recipient) = - utils::setup( /* with_account_contracts */ true); + utils::setup(/* with_account_contracts */ true); // We set random value for the token_id as the nonce check is before we use the value. let token_id = random(); @@ -128,7 +128,7 @@ unconstrained fn transfer_in_private_failure_on_behalf_of_other_wrong_caller() { // The authwit check is in the beginning so we don't need to waste time on minting the NFT and transferring // it to private. let (env, nft_contract_address, sender, recipient) = - utils::setup( /* with_account_contracts */ true); + utils::setup(/* with_account_contracts */ true); // We set random value for the token_id as the nonce check is before we use the value. let token_id = random(); diff --git a/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_in_public.nr b/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_in_public.nr index d64c5180461..f02d84202a7 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_in_public.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_in_public.nr @@ -7,7 +7,7 @@ use dep::aztec::oracle::random::random; unconstrained fn transfer_in_public() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); // Transfer the NFT NFT::at(nft_contract_address).transfer_in_public(sender, recipient, token_id, 0).call( @@ -21,7 +21,7 @@ unconstrained fn transfer_in_public() { unconstrained fn transfer_in_public_to_self() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, user, _, token_id) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); // Transfer the NFT NFT::at(nft_contract_address).transfer_in_public(user, user, token_id, 0).call(&mut env.public()); @@ -34,7 +34,7 @@ unconstrained fn transfer_in_public_to_self() { unconstrained fn transfer_in_public_on_behalf_of_other() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); let transfer_in_public_from_call_interface = NFT::at(nft_contract_address).transfer_in_public(sender, recipient, token_id, 1); @@ -58,7 +58,7 @@ unconstrained fn transfer_in_public_failure_on_behalf_of_self_non_zero_nonce() { // The authwit check is in the beginning so we don't need to waste time on minting the NFT and transferring // it to private.. let (env, nft_contract_address, sender, recipient) = - utils::setup( /* with_account_contracts */ false); + utils::setup(/* with_account_contracts */ false); // We set random value for the token_id as the nonce check is before we use the value. let token_id = random(); @@ -73,7 +73,7 @@ unconstrained fn transfer_in_public_failure_on_behalf_of_self_non_zero_nonce() { unconstrained fn transfer_in_public_non_existent_nft() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, sender, recipient) = - utils::setup( /* with_account_contracts */ false); + utils::setup(/* with_account_contracts */ false); // Try to transfer the NFT let token_id = 612; @@ -86,7 +86,7 @@ unconstrained fn transfer_in_public_non_existent_nft() { unconstrained fn transfer_in_public_failure_on_behalf_of_other_without_approval() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); // Impersonate recipient to perform the call env.impersonate(recipient); @@ -100,7 +100,7 @@ unconstrained fn transfer_in_public_failure_on_behalf_of_other_without_approval( unconstrained fn transfer_in_public_failure_on_behalf_of_other_wrong_caller() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); let transfer_in_public_from_call_interface = NFT::at(nft_contract_address).transfer_in_public(sender, recipient, token_id, 1); authwit_cheatcodes::add_public_authwit_from_call_interface( diff --git a/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_private.nr b/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_private.nr index efa8fc6b15d..21e109704a7 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_private.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_private.nr @@ -1,6 +1,8 @@ use crate::{NFT, test::utils, types::nft_note::NFTNote}; use dep::aztec::{ - keys::getters::get_public_keys, oracle::random::random, prelude::{AztecAddress, NoteHeader}, + keys::getters::get_public_keys, + oracle::random::random, + prelude::{AztecAddress, NoteHeader}, protocol_types::storage::map::derive_storage_slot_in_map, }; use std::test::OracleMock; @@ -15,7 +17,7 @@ unconstrained fn transfer_to_private_internal_orchestration() { // in this test we just call it and check the outcome. // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, user, _, token_id) = - utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ false); + utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ false); // User should have the note in their private nfts utils::assert_owns_private_nft(nft_contract_address, user, token_id); @@ -30,7 +32,7 @@ unconstrained fn transfer_to_private_internal_orchestration() { unconstrained fn transfer_to_private_external_orchestration() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, _, recipient, token_id) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); let note_randomness = random(); @@ -75,7 +77,7 @@ unconstrained fn transfer_to_private_external_orchestration() { unconstrained fn transfer_to_private_transfer_not_prepared() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, _, _, token_id) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); // Transfer was not prepared so we can use random value for the hiding point slot let hiding_point_slot = random(); @@ -90,7 +92,7 @@ unconstrained fn transfer_to_private_transfer_not_prepared() { unconstrained fn transfer_to_private_failure_not_an_owner() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, _, not_owner, token_id) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); // (For this specific test we could set a random value for the commitment and not do the call to `prepare...` // as the NFT owner check is before we use the value but that would made the test less robust against changes diff --git a/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_public.nr b/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_public.nr index 0dbec15b255..83f3690a5dd 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_public.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_public.nr @@ -7,7 +7,7 @@ use dep::aztec::oracle::random::random; unconstrained fn transfer_to_public() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ false); + utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ false); NFT::at(nft_contract_address).transfer_to_public(sender, recipient, token_id, 0).call( &mut env.private(), @@ -21,7 +21,7 @@ unconstrained fn transfer_to_public() { unconstrained fn transfer_to_public_to_self() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, user, _, token_id) = - utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ false); + utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ false); NFT::at(nft_contract_address).transfer_to_public(user, user, token_id, 0).call( &mut env.private(), @@ -34,7 +34,7 @@ unconstrained fn transfer_to_public_to_self() { #[test] unconstrained fn transfer_to_public_on_behalf_of_other() { let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ true); + utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ true); let transfer_to_public_call_interface = NFT::at(nft_contract_address).transfer_to_public(sender, recipient, token_id, 0); @@ -56,7 +56,7 @@ unconstrained fn transfer_to_public_on_behalf_of_other() { unconstrained fn transfer_to_public_failure_not_an_owner() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, _, not_owner, token_id) = - utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ false); + utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ false); env.impersonate(not_owner); NFT::at(nft_contract_address).transfer_to_public(not_owner, not_owner, token_id, 0).call( @@ -68,7 +68,7 @@ unconstrained fn transfer_to_public_failure_not_an_owner() { unconstrained fn transfer_to_public_failure_on_behalf_of_self_non_zero_nonce() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, user, _, token_id) = - utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ false); + utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ false); NFT::at(nft_contract_address).transfer_to_public(user, user, token_id, random()).call( &mut env.private(), @@ -78,7 +78,7 @@ unconstrained fn transfer_to_public_failure_on_behalf_of_self_non_zero_nonce() { #[test(should_fail_with = "Authorization not found for message hash")] unconstrained fn transfer_to_public_failure_on_behalf_of_other_invalid_designated_caller() { let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ true); + utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ true); let transfer_to_public_call_interface = NFT::at(nft_contract_address).transfer_to_public(sender, recipient, token_id, 0); @@ -96,7 +96,7 @@ unconstrained fn transfer_to_public_failure_on_behalf_of_other_invalid_designate #[test(should_fail_with = "Authorization not found for message hash")] unconstrained fn transfer_to_public_failure_on_behalf_of_other_no_approval() { let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ true); + utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ true); // Impersonate recipient env.impersonate(recipient); diff --git a/noir-projects/noir-contracts/contracts/nft_contract/src/test/utils.nr b/noir-projects/noir-contracts/contracts/nft_contract/src/test/utils.nr index c06d48a7c66..429844e7f59 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/test/utils.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/test/utils.nr @@ -1,9 +1,13 @@ use crate::{NFT, types::nft_note::NFTNote}; use dep::aztec::{ - hash::pedersen_hash, keys::getters::get_public_keys, + hash::pedersen_hash, + keys::getters::get_public_keys, oracle::{ - execution::{get_block_number, get_contract_address}, random::random, storage::storage_read, - }, prelude::{AztecAddress, NoteHeader}, + execution::{get_block_number, get_contract_address}, + random::random, + storage::storage_read, + }, + prelude::{AztecAddress, NoteHeader}, protocol_types::storage::map::derive_storage_slot_in_map, test::helpers::{cheatcodes, test_environment::TestEnvironment}, }; diff --git a/noir-projects/noir-contracts/contracts/nft_contract/src/types/nft_note.nr b/noir-projects/noir-contracts/contracts/nft_contract/src/types/nft_note.nr index 3bc1fa66371..e055e32c983 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/types/nft_note.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/types/nft_note.nr @@ -1,9 +1,12 @@ use dep::aztec::{ - keys::getters::get_nsk_app, macros::notes::partial_note, - note::utils::compute_note_hash_for_nullify, oracle::random::random, + keys::getters::get_nsk_app, + macros::notes::partial_note, + note::utils::compute_note_hash_for_nullify, + oracle::random::random, prelude::{NoteHeader, NullifiableNote, PrivateContext}, protocol_types::{ - constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, + constants::GENERATOR_INDEX__NOTE_NULLIFIER, + hash::poseidon2_hash_with_separator, traits::{Empty, Eq}, }, }; diff --git a/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr b/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr index c78169cfdcd..1356b3aec67 100644 --- a/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/main.nr @@ -9,13 +9,16 @@ contract SchnorrAccount { use dep::std; use dep::authwit::{ - account::AccountActions, auth::{compute_authwit_message_hash, compute_authwit_nullifier}, - auth_witness::get_auth_witness, entrypoint::{app::AppPayload, fee::FeePayload}, + account::AccountActions, + auth::{compute_authwit_message_hash, compute_authwit_nullifier}, + auth_witness::get_auth_witness, + entrypoint::{app::AppPayload, fee::FeePayload}, }; use dep::aztec::encrypted_logs::encrypted_note_emission::encode_and_encrypt_note; use dep::aztec::{hash::compute_siloed_nullifier, keys::getters::get_public_keys}; use dep::aztec::macros::{ - functions::{initializer, noinitcheck, private, view}, storage::storage, + functions::{initializer, noinitcheck, private, view}, + storage::storage, }; use dep::aztec::oracle::get_nullifier_membership_witness::get_low_nullifier_membership_witness; use dep::aztec::prelude::{AztecAddress, PrivateContext, PrivateImmutable}; diff --git a/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/public_key_note.nr b/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/public_key_note.nr index a052a65eecb..2e48a31ac8d 100644 --- a/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/public_key_note.nr +++ b/noir-projects/noir-contracts/contracts/schnorr_account_contract/src/public_key_note.nr @@ -1,5 +1,7 @@ use dep::aztec::{ - keys::getters::get_nsk_app, macros::notes::note, note::utils::compute_note_hash_for_nullify, + keys::getters::get_nsk_app, + macros::notes::note, + note::utils::compute_note_hash_for_nullify, protocol_types::{ constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, }, diff --git a/noir-projects/noir-contracts/contracts/schnorr_hardcoded_account_contract/src/main.nr b/noir-projects/noir-contracts/contracts/schnorr_hardcoded_account_contract/src/main.nr index 91e74544a19..1eea24b7356 100644 --- a/noir-projects/noir-contracts/contracts/schnorr_hardcoded_account_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/schnorr_hardcoded_account_contract/src/main.nr @@ -5,7 +5,8 @@ use dep::aztec::macros::aztec; #[aztec] contract SchnorrHardcodedAccount { use dep::authwit::{ - account::AccountActions, auth_witness::get_auth_witness, + account::AccountActions, + auth_witness::get_auth_witness, entrypoint::{app::AppPayload, fee::FeePayload}, }; use dep::aztec::prelude::PrivateContext; diff --git a/noir-projects/noir-contracts/contracts/schnorr_single_key_account_contract/src/auth_oracle.nr b/noir-projects/noir-contracts/contracts/schnorr_single_key_account_contract/src/auth_oracle.nr index 309fe83b5a4..063720d28e1 100644 --- a/noir-projects/noir-contracts/contracts/schnorr_single_key_account_contract/src/auth_oracle.nr +++ b/noir-projects/noir-contracts/contracts/schnorr_single_key_account_contract/src/auth_oracle.nr @@ -1,6 +1,8 @@ use dep::authwit::auth_witness; use dep::aztec::protocol_types::{ - address::PartialAddress, public_keys::{PUBLIC_KEYS_LENGTH, PublicKeys}, utils::arr_copy_slice, + address::PartialAddress, + public_keys::{PUBLIC_KEYS_LENGTH, PublicKeys}, + utils::arr_copy_slice, }; pub struct AuthWitness { diff --git a/noir-projects/noir-contracts/contracts/spam_contract/src/main.nr b/noir-projects/noir-contracts/contracts/spam_contract/src/main.nr index 8db19f4d90a..53cdee95ef4 100644 --- a/noir-projects/noir-contracts/contracts/spam_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/spam_contract/src/main.nr @@ -15,7 +15,8 @@ contract Spam { constants::{ GENERATOR_INDEX__NOTE_NULLIFIER, MAX_NOTE_HASHES_PER_CALL, MAX_NULLIFIERS_PER_CALL, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, - }, hash::poseidon2_hash_with_separator, + }, + hash::poseidon2_hash_with_separator, }, }; diff --git a/noir-projects/noir-contracts/contracts/spam_contract/src/types/balance_set.nr b/noir-projects/noir-contracts/contracts/spam_contract/src/types/balance_set.nr index 27835836c32..c9526d85c49 100644 --- a/noir-projects/noir-contracts/contracts/spam_contract/src/types/balance_set.nr +++ b/noir-projects/noir-contracts/contracts/spam_contract/src/types/balance_set.nr @@ -1,7 +1,8 @@ // This file is copied from the token contract. use crate::types::token_note::OwnedNote; use dep::aztec::{ - context::{PrivateContext, UnconstrainedContext}, note::note_emission::OuterNoteEmission, + context::{PrivateContext, UnconstrainedContext}, + note::note_emission::OuterNoteEmission, protocol_types::{constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, public_keys::NpkM}, }; use dep::aztec::prelude::{ diff --git a/noir-projects/noir-contracts/contracts/spam_contract/src/types/token_note.nr b/noir-projects/noir-contracts/contracts/spam_contract/src/types/token_note.nr index 062cbd5eaa3..3b60ed16816 100644 --- a/noir-projects/noir-contracts/contracts/spam_contract/src/types/token_note.nr +++ b/noir-projects/noir-contracts/contracts/spam_contract/src/types/token_note.nr @@ -1,6 +1,9 @@ use dep::aztec::{ - keys::getters::get_nsk_app, macros::notes::note, note::utils::compute_note_hash_for_nullify, - oracle::random::random, prelude::{NoteHeader, NullifiableNote, PrivateContext}, + keys::getters::get_nsk_app, + macros::notes::note, + note::utils::compute_note_hash_for_nullify, + oracle::random::random, + prelude::{NoteHeader, NullifiableNote, PrivateContext}, protocol_types::{ constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, }, diff --git a/noir-projects/noir-contracts/contracts/static_child_contract/src/main.nr b/noir-projects/noir-contracts/contracts/static_child_contract/src/main.nr index dc350a500b6..1d44bb0350a 100644 --- a/noir-projects/noir-contracts/contracts/static_child_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/static_child_contract/src/main.nr @@ -9,7 +9,8 @@ contract StaticChild { encrypted_logs::encrypted_note_emission::encode_and_encrypt_note, keys::getters::get_public_keys, macros::{functions::{private, public, view}, storage::storage}, - note::note_getter_options::NoteGetterOptions, utils::comparison::Comparator, + note::note_getter_options::NoteGetterOptions, + utils::comparison::Comparator, }; use dep::value_note::value_note::ValueNote; diff --git a/noir-projects/noir-contracts/contracts/test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/test_contract/src/main.nr index 75a9ee0fa57..82e254ef37b 100644 --- a/noir-projects/noir-contracts/contracts/test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/test_contract/src/main.nr @@ -26,9 +26,12 @@ contract Test { hash::{ArgsHasher, compute_secret_hash, pedersen_hash}, macros::{events::event, functions::{internal, private, public}, storage::storage}, note::{ - lifecycle::{create_note, destroy_note_unsafe}, note_getter::{get_notes, view_notes}, + lifecycle::{create_note, destroy_note_unsafe}, + note_getter::{get_notes, view_notes}, note_getter_options::NoteStatus, - }, oracle::random::random, utils::comparison::Comparator, + }, + oracle::random::random, + utils::comparison::Comparator, }; use dep::token_portal_content_hash_lib::{ get_mint_private_content_hash, get_mint_public_content_hash, @@ -365,9 +368,9 @@ contract Test { #[public] fn emit_unencrypted(value: Field) { // docs:start:emit_unencrypted - context.emit_unencrypted_log( /*message=*/ value); - context.emit_unencrypted_log( /*message=*/ [10, 20, 30]); - context.emit_unencrypted_log( /*message=*/ "Hello, world!"); + context.emit_unencrypted_log(/*message=*/ value); + context.emit_unencrypted_log(/*message=*/ [10, 20, 30]); + context.emit_unencrypted_log(/*message=*/ "Hello, world!"); // docs:end:emit_unencrypted } diff --git a/noir-projects/noir-contracts/contracts/test_contract/src/test_note.nr b/noir-projects/noir-contracts/contracts/test_contract/src/test_note.nr index ad3e7229c65..7f938fa42cd 100644 --- a/noir-projects/noir-contracts/contracts/test_contract/src/test_note.nr +++ b/noir-projects/noir-contracts/contracts/test_contract/src/test_note.nr @@ -1,5 +1,6 @@ use dep::aztec::{ - context::PrivateContext, macros::notes::note, + context::PrivateContext, + macros::notes::note, note::{note_header::NoteHeader, note_interface::NullifiableNote}, }; diff --git a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr index f2bb1208b10..f49d64b7ba1 100644 --- a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/main.nr @@ -16,7 +16,9 @@ contract TokenBlacklist { use dep::aztec::{ encrypted_logs::encrypted_note_emission::{ encode_and_encrypt_note, encode_and_encrypt_note_unconstrained, - }, hash::compute_secret_hash, keys::getters::get_public_keys, + }, + hash::compute_secret_hash, + keys::getters::get_public_keys, macros::{functions::{initializer, internal, private, public, view}, storage::storage}, prelude::{AztecAddress, Map, NoteGetterOptions, PrivateSet, PublicMutable, SharedMutable}, utils::comparison::Comparator, diff --git a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/balances_map.nr b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/balances_map.nr index 06a97efc16c..8c1d84c3cef 100644 --- a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/balances_map.nr +++ b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/balances_map.nr @@ -1,6 +1,7 @@ use crate::types::token_note::OwnedNote; use dep::aztec::{ - context::{PrivateContext, UnconstrainedContext}, keys::getters::get_public_keys, + context::{PrivateContext, UnconstrainedContext}, + keys::getters::get_public_keys, note::note_emission::OuterNoteEmission, protocol_types::constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, }; diff --git a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/token_note.nr b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/token_note.nr index 4a1da500c8b..b36d5316324 100644 --- a/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/token_note.nr +++ b/noir-projects/noir-contracts/contracts/token_blacklist_contract/src/types/token_note.nr @@ -1,6 +1,9 @@ use dep::aztec::{ - keys::getters::get_nsk_app, macros::notes::note, note::utils::compute_note_hash_for_nullify, - oracle::random::random, prelude::{NoteHeader, NullifiableNote, PrivateContext}, + keys::getters::get_nsk_app, + macros::notes::note, + note::utils::compute_note_hash_for_nullify, + oracle::random::random, + prelude::{NoteHeader, NullifiableNote, PrivateContext}, protocol_types::{ constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, }, diff --git a/noir-projects/noir-contracts/contracts/token_bridge_contract/src/main.nr b/noir-projects/noir-contracts/contracts/token_bridge_contract/src/main.nr index 034bfe92e01..ef94712166a 100644 --- a/noir-projects/noir-contracts/contracts/token_bridge_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/token_bridge_contract/src/main.nr @@ -18,7 +18,8 @@ contract TokenBridge { use dep::token::Token; use dep::aztec::macros::{ - functions::{initializer, internal, private, public, view}, storage::storage, + functions::{initializer, internal, private, public, view}, + storage::storage, }; // docs:end:token_bridge_imports 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 bf2d883fd05..b38e513d7da 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/main.nr @@ -26,15 +26,21 @@ contract Token { encode_and_encrypt_note, encode_and_encrypt_note_unconstrained, encrypt_and_emit_partial_log, }, - }, hash::compute_secret_hash, keys::getters::get_public_keys, + }, + hash::compute_secret_hash, + keys::getters::get_public_keys, macros::{ - events::event, functions::{initializer, internal, private, public, view}, + events::event, + functions::{initializer, internal, private, public, view}, storage::storage, - }, oracle::random::random, + }, + oracle::random::random, prelude::{ AztecAddress, FunctionSelector, Map, NoteGetterOptions, PrivateSet, PublicMutable, SharedImmutable, - }, protocol_types::{point::Point, traits::Serialize}, utils::comparison::Comparator, + }, + protocol_types::{point::Point, traits::Serialize}, + utils::comparison::Comparator, }; // docs:start:import_authwit diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/test/access_control.nr b/noir-projects/noir-contracts/contracts/token_contract/src/test/access_control.nr index 9cb547b237d..aafe621f498 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/test/access_control.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/test/access_control.nr @@ -5,7 +5,7 @@ use crate::Token; unconstrained fn access_control() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient) = - utils::setup( /* with_account_contracts */ false); + utils::setup(/* with_account_contracts */ false); // Set a new admin Token::at(token_contract_address).set_admin(recipient).call(&mut env.public()); diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/test/burn.nr b/noir-projects/noir-contracts/contracts/token_contract/src/test/burn.nr index 3fbf1d73c64..daa91a0d26c 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/test/burn.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/test/burn.nr @@ -6,7 +6,7 @@ use dep::aztec::oracle::random::random; #[test] unconstrained fn burn_public_success() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); let burn_amount = mint_amount / 10; // Burn less than balance @@ -17,7 +17,7 @@ unconstrained fn burn_public_success() { #[test] unconstrained fn burn_public_on_behalf_of_other() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); let burn_amount = mint_amount / 10; // Burn on behalf of other @@ -38,7 +38,7 @@ unconstrained fn burn_public_on_behalf_of_other() { #[test(should_fail_with = "attempt to subtract with underflow")] unconstrained fn burn_public_failure_more_than_balance() { let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); // Burn more than balance let burn_amount = mint_amount * 10; @@ -49,7 +49,7 @@ unconstrained fn burn_public_failure_more_than_balance() { #[test(should_fail_with = "invalid nonce")] unconstrained fn burn_public_failure_on_behalf_of_self_non_zero_nonce() { let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); // Burn on behalf of self with non-zero nonce let burn_amount = mint_amount / 10; @@ -62,7 +62,7 @@ unconstrained fn burn_public_failure_on_behalf_of_self_non_zero_nonce() { #[test(should_fail_with = "unauthorized")] unconstrained fn burn_public_failure_on_behalf_of_other_without_approval() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); // Burn on behalf of other without approval let burn_amount = mint_amount / 10; @@ -76,7 +76,7 @@ unconstrained fn burn_public_failure_on_behalf_of_other_without_approval() { #[test(should_fail_with = "unauthorized")] unconstrained fn burn_public_failure_on_behalf_of_other_wrong_caller() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); // Burn on behalf of other, wrong designated caller let burn_amount = mint_amount / 10; @@ -91,7 +91,7 @@ unconstrained fn burn_public_failure_on_behalf_of_other_wrong_caller() { #[test] unconstrained fn burn_private_on_behalf_of_self() { let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); let burn_amount = mint_amount / 10; // Burn less than balance @@ -102,7 +102,7 @@ unconstrained fn burn_private_on_behalf_of_self() { #[test] unconstrained fn burn_private_on_behalf_of_other() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); let burn_amount = mint_amount / 10; // Burn on behalf of other @@ -122,7 +122,7 @@ unconstrained fn burn_private_on_behalf_of_other() { #[test(should_fail_with = "Balance too low")] unconstrained fn burn_private_failure_more_than_balance() { let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); // Burn more than balance let burn_amount = mint_amount * 10; @@ -132,7 +132,7 @@ unconstrained fn burn_private_failure_more_than_balance() { #[test(should_fail_with = "invalid nonce")] unconstrained fn burn_private_failure_on_behalf_of_self_non_zero_nonce() { let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); // Burn more than balance let burn_amount = mint_amount / 10; @@ -142,7 +142,7 @@ unconstrained fn burn_private_failure_on_behalf_of_self_non_zero_nonce() { #[test(should_fail_with = "Balance too low")] unconstrained fn burn_private_failure_on_behalf_of_other_more_than_balance() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); // Burn more than balance let burn_amount = mint_amount * 10; @@ -161,7 +161,7 @@ unconstrained fn burn_private_failure_on_behalf_of_other_more_than_balance() { #[test(should_fail_with = "Authorization not found for message hash")] unconstrained fn burn_private_failure_on_behalf_of_other_without_approval() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); // Burn more than balance let burn_amount = mint_amount / 10; @@ -175,7 +175,7 @@ unconstrained fn burn_private_failure_on_behalf_of_other_without_approval() { #[test(should_fail_with = "Authorization not found for message hash")] unconstrained fn burn_private_failure_on_behalf_of_other_wrong_designated_caller() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); // Burn more than balance let burn_amount = mint_amount / 10; diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/test/minting.nr b/noir-projects/noir-contracts/contracts/token_contract/src/test/minting.nr index fb894336bd5..6d2b21207ae 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/test/minting.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/test/minting.nr @@ -5,7 +5,7 @@ use dep::aztec::{hash::compute_secret_hash, oracle::random::random, test::helper #[test] unconstrained fn mint_public_success() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough - let (env, token_contract_address, owner, _) = utils::setup( /* with_account_contracts */ false); + let (env, token_contract_address, owner, _) = utils::setup(/* with_account_contracts */ false); let mint_amount = 10000; Token::at(token_contract_address).mint_public(owner, mint_amount).call(&mut env.public()); @@ -20,7 +20,7 @@ unconstrained fn mint_public_success() { unconstrained fn mint_public_failures() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient) = - utils::setup( /* with_account_contracts */ false); + utils::setup(/* with_account_contracts */ false); // As non-minter let mint_amount = 10000; @@ -60,7 +60,7 @@ unconstrained fn mint_public_failures() { #[test] unconstrained fn mint_private_success() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough - let (env, token_contract_address, owner, _) = utils::setup( /* with_account_contracts */ false); + let (env, token_contract_address, owner, _) = utils::setup(/* with_account_contracts */ false); let mint_amount = 10000; // Mint some tokens let secret = random(); @@ -91,7 +91,7 @@ unconstrained fn mint_private_success() { unconstrained fn mint_private_failure_double_spend() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient) = - utils::setup( /* with_account_contracts */ false); + utils::setup(/* with_account_contracts */ false); let mint_amount = 10000; // Mint some tokens let secret = random(); @@ -127,7 +127,7 @@ unconstrained fn mint_private_failure_double_spend() { unconstrained fn mint_private_failure_non_minter() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, _, recipient) = - utils::setup( /* with_account_contracts */ false); + utils::setup(/* with_account_contracts */ false); let mint_amount = 10000; // Try to mint some tokens impersonating recipient env.impersonate(recipient); @@ -140,7 +140,7 @@ unconstrained fn mint_private_failure_non_minter() { #[test(should_fail_with = "call to assert_max_bit_size")] unconstrained fn mint_private_failure_overflow() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough - let (env, token_contract_address, _, _) = utils::setup( /* with_account_contracts */ false); + let (env, token_contract_address, _, _) = utils::setup(/* with_account_contracts */ false); // Overflow recipient let mint_amount = 2.pow_32(128); @@ -152,7 +152,7 @@ unconstrained fn mint_private_failure_overflow() { #[test(should_fail_with = "attempt to add with overflow")] unconstrained fn mint_private_failure_overflow_recipient() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough - let (env, token_contract_address, owner, _) = utils::setup( /* with_account_contracts */ false); + let (env, token_contract_address, owner, _) = utils::setup(/* with_account_contracts */ false); let mint_amount = 10000; // Mint some tokens let secret = random(); @@ -186,7 +186,7 @@ unconstrained fn mint_private_failure_overflow_recipient() { unconstrained fn mint_private_failure_overflow_total_supply() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient) = - utils::setup( /* with_account_contracts */ false); + utils::setup(/* with_account_contracts */ false); let mint_amount = 10000; // Mint some tokens let secret_owner = random(); diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/test/reading_constants.nr b/noir-projects/noir-contracts/contracts/token_contract/src/test/reading_constants.nr index 6081e27ae4c..af3583f5f25 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/test/reading_constants.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/test/reading_constants.nr @@ -7,7 +7,7 @@ use dep::aztec::test::helpers::cheatcodes; #[test] unconstrained fn check_decimals_private() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough - let (env, token_contract_address, _, _) = utils::setup( /* with_account_contracts */ false); + let (env, token_contract_address, _, _) = utils::setup(/* with_account_contracts */ false); // Check decimals let result = Token::at(token_contract_address).private_get_decimals().view(&mut env.private()); @@ -18,7 +18,7 @@ unconstrained fn check_decimals_private() { #[test] unconstrained fn check_decimals_public() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough - let (env, token_contract_address, _, _) = utils::setup( /* with_account_contracts */ false); + let (env, token_contract_address, _, _) = utils::setup(/* with_account_contracts */ false); // Check decimals let result = Token::at(token_contract_address).public_get_decimals().view(&mut env.public()); diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/test/shielding.nr b/noir-projects/noir-contracts/contracts/token_contract/src/test/shielding.nr index ed49a1807d4..a4b5832e579 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/test/shielding.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/test/shielding.nr @@ -7,7 +7,7 @@ use dep::aztec::{hash::compute_secret_hash, oracle::random::random}; unconstrained fn shielding_on_behalf_of_self() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); let secret = random(); let secret_hash = compute_secret_hash(secret); // Shield tokens @@ -36,7 +36,7 @@ unconstrained fn shielding_on_behalf_of_self() { #[test] unconstrained fn shielding_on_behalf_of_other() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); let secret = random(); let secret_hash = compute_secret_hash(secret); @@ -77,7 +77,7 @@ unconstrained fn shielding_on_behalf_of_other() { unconstrained fn shielding_failure_on_behalf_of_self_more_than_balance() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); let secret = random(); let secret_hash = compute_secret_hash(secret); // Shield tokens @@ -95,7 +95,7 @@ unconstrained fn shielding_failure_on_behalf_of_self_more_than_balance() { unconstrained fn shielding_failure_on_behalf_of_self_invalid_nonce() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); let secret = random(); let secret_hash = compute_secret_hash(secret); // Shield tokens @@ -113,7 +113,7 @@ unconstrained fn shielding_failure_on_behalf_of_self_invalid_nonce() { unconstrained fn shielding_failure_on_behalf_of_other_more_than_balance() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); let secret = random(); let secret_hash = compute_secret_hash(secret); // Shield tokens on behalf of owner @@ -139,7 +139,7 @@ unconstrained fn shielding_failure_on_behalf_of_other_more_than_balance() { unconstrained fn shielding_failure_on_behalf_of_other_wrong_caller() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); let secret = random(); let secret_hash = compute_secret_hash(secret); // Shield tokens on behalf of owner @@ -161,7 +161,7 @@ unconstrained fn shielding_failure_on_behalf_of_other_wrong_caller() { unconstrained fn shielding_failure_on_behalf_of_other_without_approval() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); let secret = random(); let secret_hash = compute_secret_hash(secret); // Shield tokens on behalf of owner diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/test/transfer_private.nr b/noir-projects/noir-contracts/contracts/token_contract/src/test/transfer_private.nr index 8e606030d1c..66d6d13bd0e 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/test/transfer_private.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/test/transfer_private.nr @@ -7,7 +7,7 @@ use dep::aztec::test::helpers::cheatcodes; unconstrained fn transfer_private() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); // docs:start:txe_test_transfer_private // Transfer tokens @@ -23,7 +23,7 @@ unconstrained fn transfer_private() { unconstrained fn transfer_private_to_self() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); // Transfer tokens let transfer_amount = 1000; Token::at(token_contract_address).transfer(owner, transfer_amount).call(&mut env.private()); @@ -36,7 +36,7 @@ unconstrained fn transfer_private_to_self() { unconstrained fn transfer_private_to_non_deployed_account() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); let not_deployed = cheatcodes::create_account(); // Transfer tokens let transfer_amount = 1000; @@ -57,7 +57,7 @@ unconstrained fn transfer_private_to_non_deployed_account() { unconstrained fn transfer_private_on_behalf_of_other() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); // Add authwit // docs:start:private_authwit let transfer_amount = 1000; @@ -82,7 +82,7 @@ unconstrained fn transfer_private_on_behalf_of_other() { unconstrained fn transfer_private_failure_more_than_balance() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, _, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); // Transfer tokens let transfer_amount = mint_amount + 1; Token::at(token_contract_address).transfer(recipient, transfer_amount).call(&mut env.private()); @@ -93,7 +93,7 @@ unconstrained fn transfer_private_failure_more_than_balance() { unconstrained fn transfer_private_failure_on_behalf_of_self_non_zero_nonce() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient, _) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); // Add authwit let transfer_amount = 1000; let transfer_private_from_call_interface = @@ -112,7 +112,7 @@ unconstrained fn transfer_private_failure_on_behalf_of_self_non_zero_nonce() { unconstrained fn transfer_private_failure_on_behalf_of_more_than_balance() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); // Add authwit let transfer_amount = mint_amount + 1; let transfer_private_from_call_interface = @@ -132,7 +132,7 @@ unconstrained fn transfer_private_failure_on_behalf_of_more_than_balance() { unconstrained fn transfer_private_failure_on_behalf_of_other_without_approval() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, token_contract_address, owner, recipient, _) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); // Add authwit let transfer_amount = 1000; let transfer_private_from_call_interface = @@ -147,7 +147,7 @@ unconstrained fn transfer_private_failure_on_behalf_of_other_without_approval() unconstrained fn transfer_private_failure_on_behalf_of_other_wrong_caller() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, token_contract_address, owner, recipient, _) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); // Add authwit let transfer_amount = 1000; let transfer_private_from_call_interface = diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/test/transfer_public.nr b/noir-projects/noir-contracts/contracts/token_contract/src/test/transfer_public.nr index 829fd1a31a6..72a6eb3f029 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/test/transfer_public.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/test/transfer_public.nr @@ -7,7 +7,7 @@ use dep::aztec::oracle::random::random; unconstrained fn public_transfer() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); // Transfer tokens let transfer_amount = mint_amount / 10; Token::at(token_contract_address).transfer_public(owner, recipient, transfer_amount, 0).call( @@ -23,7 +23,7 @@ unconstrained fn public_transfer() { unconstrained fn public_transfer_to_self() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); // Transfer tokens let transfer_amount = mint_amount / 10; // docs:start:call_public @@ -39,7 +39,7 @@ unconstrained fn public_transfer_to_self() { unconstrained fn public_transfer_on_behalf_of_other() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); let transfer_amount = mint_amount / 10; let public_transfer_from_call_interface = Token::at(token_contract_address).transfer_public(owner, recipient, transfer_amount, 1); @@ -61,7 +61,7 @@ unconstrained fn public_transfer_on_behalf_of_other() { unconstrained fn public_transfer_failure_more_than_balance() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); // Transfer tokens let transfer_amount = mint_amount + 1; let public_transfer_call_interface = @@ -74,7 +74,7 @@ unconstrained fn public_transfer_failure_more_than_balance() { unconstrained fn public_transfer_failure_on_behalf_of_self_non_zero_nonce() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); // Transfer tokens let transfer_amount = mint_amount / 10; let public_transfer_call_interface = Token::at(token_contract_address).transfer_public( @@ -96,7 +96,7 @@ unconstrained fn public_transfer_failure_on_behalf_of_self_non_zero_nonce() { unconstrained fn public_transfer_failure_on_behalf_of_other_without_approval() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); let transfer_amount = mint_amount / 10; let public_transfer_from_call_interface = Token::at(token_contract_address).transfer_public(owner, recipient, transfer_amount, 1); @@ -110,7 +110,7 @@ unconstrained fn public_transfer_failure_on_behalf_of_other_without_approval() { unconstrained fn public_transfer_failure_on_behalf_of_other_more_than_balance() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); let transfer_amount = mint_amount + 1; // docs:start:public_authwit let public_transfer_from_call_interface = @@ -131,7 +131,7 @@ unconstrained fn public_transfer_failure_on_behalf_of_other_more_than_balance() unconstrained fn public_transfer_failure_on_behalf_of_other_wrong_caller() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); let transfer_amount = mint_amount / 10; let public_transfer_from_call_interface = Token::at(token_contract_address).transfer_public(owner, recipient, transfer_amount, 1); diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/test/unshielding.nr b/noir-projects/noir-contracts/contracts/token_contract/src/test/unshielding.nr index 60350ca624b..ffe3e55b89c 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/test/unshielding.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/test/unshielding.nr @@ -7,7 +7,7 @@ use dep::aztec::oracle::random::random; unconstrained fn unshield_on_behalf_of_self() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); let unshield_amount = mint_amount / 10; Token::at(token_contract_address).unshield(owner, owner, unshield_amount, 0).call( @@ -20,7 +20,7 @@ unconstrained fn unshield_on_behalf_of_self() { #[test] unconstrained fn unshield_on_behalf_of_other() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); let unshield_amount = mint_amount / 10; let unshield_call_interface = @@ -42,7 +42,7 @@ unconstrained fn unshield_on_behalf_of_other() { unconstrained fn unshield_failure_more_than_balance() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); let unshield_amount = mint_amount + 1; Token::at(token_contract_address).unshield(owner, owner, unshield_amount, 0).call( @@ -54,7 +54,7 @@ unconstrained fn unshield_failure_more_than_balance() { unconstrained fn unshield_failure_on_behalf_of_self_non_zero_nonce() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ false); + utils::setup_and_mint(/* with_account_contracts */ false); let unshield_amount = mint_amount + 1; Token::at(token_contract_address).unshield(owner, owner, unshield_amount, random()).call( @@ -65,7 +65,7 @@ unconstrained fn unshield_failure_on_behalf_of_self_non_zero_nonce() { #[test(should_fail_with = "Balance too low")] unconstrained fn unshield_failure_on_behalf_of_other_more_than_balance() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); let unshield_amount = mint_amount + 1; let unshield_call_interface = @@ -84,7 +84,7 @@ unconstrained fn unshield_failure_on_behalf_of_other_more_than_balance() { #[test(should_fail_with = "Authorization not found for message hash")] unconstrained fn unshield_failure_on_behalf_of_other_invalid_designated_caller() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); let unshield_amount = mint_amount + 1; let unshield_call_interface = @@ -103,7 +103,7 @@ unconstrained fn unshield_failure_on_behalf_of_other_invalid_designated_caller() #[test(should_fail_with = "Authorization not found for message hash")] unconstrained fn unshield_failure_on_behalf_of_other_no_approval() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint( /* with_account_contracts */ true); + utils::setup_and_mint(/* with_account_contracts */ true); let unshield_amount = mint_amount + 1; let unshield_call_interface = diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/test/utils.nr b/noir-projects/noir-contracts/contracts/token_contract/src/test/utils.nr index 7e22bdbfa23..c3f93777556 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/test/utils.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/test/utils.nr @@ -1,8 +1,12 @@ use dep::aztec::{ hash::compute_secret_hash, oracle::{ - execution::{get_block_number, get_contract_address}, random::random, storage::storage_read, - }, prelude::AztecAddress, protocol_types::storage::map::derive_storage_slot_in_map, + execution::{get_block_number, get_contract_address}, + random::random, + storage::storage_read, + }, + prelude::AztecAddress, + protocol_types::storage::map::derive_storage_slot_in_map, test::helpers::{cheatcodes, test_environment::TestEnvironment}, }; diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/types/balance_set.nr b/noir-projects/noir-contracts/contracts/token_contract/src/types/balance_set.nr index 3c31c14c07b..9f650a94291 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/types/balance_set.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/types/balance_set.nr @@ -1,9 +1,11 @@ use crate::types::token_note::OwnedNote; use dep::aztec::{ - context::{PrivateContext, UnconstrainedContext}, keys::getters::get_public_keys, + context::{PrivateContext, UnconstrainedContext}, + keys::getters::get_public_keys, note::{ note_emission::OuterNoteEmission, note_getter::view_notes, note_interface::NullifiableNote, - }, protocol_types::{constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, public_keys::NpkM}, + }, + protocol_types::{constants::MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, public_keys::NpkM}, }; use dep::aztec::prelude::{NoteGetterOptions, NoteInterface, NoteViewerOptions, PrivateSet}; diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/types/token_note.nr b/noir-projects/noir-contracts/contracts/token_contract/src/types/token_note.nr index 69227d04296..677dd918033 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/types/token_note.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/types/token_note.nr @@ -1,6 +1,8 @@ use dep::aztec::{ - keys::getters::get_nsk_app, macros::notes::partial_note, - note::utils::compute_note_hash_for_nullify, oracle::random::random, + keys::getters::get_nsk_app, + macros::notes::partial_note, + note::utils::compute_note_hash_for_nullify, + oracle::random::random, prelude::{NoteHeader, NullifiableNote, PrivateContext}, protocol_types::{ constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/types/transparent_note.nr b/noir-projects/noir-contracts/contracts/token_contract/src/types/transparent_note.nr index 2ab50c3476f..ed1f08e0d74 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/types/transparent_note.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/types/transparent_note.nr @@ -1,6 +1,7 @@ // docs:start:token_types_all use dep::aztec::{ - macros::notes::note, note::utils::compute_note_hash_for_nullify, + macros::notes::note, + note::utils::compute_note_hash_for_nullify, prelude::{NoteHeader, NullifiableNote, PrivateContext}, protocol_types::{ constants::GENERATOR_INDEX__NOTE_NULLIFIER, hash::poseidon2_hash_with_separator, diff --git a/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr b/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr index 1b45f4ee8e6..f1625dc6119 100644 --- a/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/uniswap_contract/src/main.nr @@ -17,7 +17,8 @@ contract Uniswap { use crate::util::{compute_swap_private_content_hash, compute_swap_public_content_hash}; use dep::aztec::macros::{ - functions::{initializer, internal, private, public, view}, storage::storage, + functions::{initializer, internal, private, public, view}, + storage::storage, }; use dep::token::Token; use dep::token_bridge::TokenBridge; diff --git a/noir-projects/noir-protocol-circuits/crates/parity-lib/src/root/root_parity_input.nr b/noir-projects/noir-protocol-circuits/crates/parity-lib/src/root/root_parity_input.nr index b0bc95a1eb9..cb1b2edc1ea 100644 --- a/noir-projects/noir-protocol-circuits/crates/parity-lib/src/root/root_parity_input.nr +++ b/noir-projects/noir-protocol-circuits/crates/parity-lib/src/root/root_parity_input.nr @@ -3,9 +3,11 @@ use dep::types::{ constants::{BASE_PARITY_INDEX, VK_TREE_HEIGHT}, merkle_tree::membership::assert_check_membership, recursion::{ - proof::RecursiveProof, traits::Verifiable, + proof::RecursiveProof, + traits::Verifiable, verification_key::{HonkVerificationKey, VerificationKey}, - }, traits::Empty, + }, + traits::Empty, }; pub struct RootParityInput { diff --git a/noir-projects/noir-protocol-circuits/crates/parity-lib/src/root/root_rollup_parity_input.nr b/noir-projects/noir-protocol-circuits/crates/parity-lib/src/root/root_rollup_parity_input.nr index c31114014c1..dc0c35e2454 100644 --- a/noir-projects/noir-protocol-circuits/crates/parity-lib/src/root/root_rollup_parity_input.nr +++ b/noir-projects/noir-protocol-circuits/crates/parity-lib/src/root/root_rollup_parity_input.nr @@ -3,9 +3,11 @@ use dep::types::{ constants::{ROOT_PARITY_INDEX, VK_TREE_HEIGHT}, merkle_tree::membership::assert_check_membership, recursion::{ - proof::NestedRecursiveProof, traits::Verifiable, + proof::NestedRecursiveProof, + traits::Verifiable, verification_key::{HonkVerificationKey, VerificationKey}, - }, traits::Empty, + }, + traits::Empty, }; pub struct RootRollupParityInput { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/previous_kernel_validator.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/previous_kernel_validator.nr index fdadacfe1ad..4476930b3a4 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/previous_kernel_validator.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/previous_kernel_validator.nr @@ -5,7 +5,9 @@ use crate::components::previous_kernel_validator::previous_kernel_validator_hint }; use dep::types::{ abis::{log_hash::ScopedEncryptedLogHash, private_kernel_data::PrivateKernelData}, - address::AztecAddress, traits::is_empty, utils::arrays::array_length, + address::AztecAddress, + traits::is_empty, + utils::arrays::array_length, }; pub struct PreviousKernelValidator { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/previous_kernel_validator/previous_kernel_validator_hints.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/previous_kernel_validator/previous_kernel_validator_hints.nr index 28719890ab0..23927a82882 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/previous_kernel_validator/previous_kernel_validator_hints.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/previous_kernel_validator/previous_kernel_validator_hints.nr @@ -1,7 +1,9 @@ use dep::types::{ abis::{ kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, note_hash::ScopedNoteHash, - }, constants::{MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX}, utils::arrays::find_index_hint, + }, + constants::{MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX}, + utils::arrays::find_index_hint, }; pub struct PreviousKernelValidatorHints { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_call_data_validator.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_call_data_validator.nr index 2fa422b6c00..24eaeec2842 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_call_data_validator.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_call_data_validator.nr @@ -9,11 +9,17 @@ use crate::components::private_call_data_validator::{ }; use dep::types::{ abis::{ - call_context::CallContext, kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, - note_hash::ScopedNoteHash, private_call_request::PrivateCallRequest, + call_context::CallContext, + kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, + note_hash::ScopedNoteHash, + private_call_request::PrivateCallRequest, private_circuit_public_inputs::PrivateCircuitPublicInputsArrayLengths, - private_kernel::private_call_data::PrivateCallData, side_effect::{Ordered, RangeOrdered}, - }, address::AztecAddress, constants::MAX_FIELD_VALUE, transaction::tx_request::TxRequest, + private_kernel::private_call_data::PrivateCallData, + side_effect::{Ordered, RangeOrdered}, + }, + address::AztecAddress, + constants::MAX_FIELD_VALUE, + transaction::tx_request::TxRequest, utils::arrays::find_index_hint, }; diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_kernel_circuit_output_validator.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_kernel_circuit_output_validator.nr index fcc7ed1819e..9784fefe4d0 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_kernel_circuit_output_validator.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_kernel_circuit_output_validator.nr @@ -3,11 +3,15 @@ use dep::types::{ abis::{ kernel_circuit_public_inputs::{ PrivateKernelCircuitPublicInputs, PrivateKernelCircuitPublicInputsArrayLengths, - }, max_block_number::MaxBlockNumber, + }, + max_block_number::MaxBlockNumber, private_circuit_public_inputs::{ PrivateCircuitPublicInputs, PrivateCircuitPublicInputsArrayLengths, }, - }, address::AztecAddress, traits::is_empty, transaction::tx_request::TxRequest, + }, + address::AztecAddress, + traits::is_empty, + transaction::tx_request::TxRequest, utils::arrays::{ assert_array_appended, assert_array_appended_reversed, assert_array_appended_scoped, assert_array_prepended, diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_kernel_circuit_public_inputs_composer.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_kernel_circuit_public_inputs_composer.nr index 67cfffefe28..f0702793359 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_kernel_circuit_public_inputs_composer.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/private_kernel_circuit_public_inputs_composer.nr @@ -3,9 +3,14 @@ use dep::types::{ combined_constant_data::CombinedConstantData, kernel_circuit_public_inputs::{ PrivateKernelCircuitPublicInputs, PrivateKernelCircuitPublicInputsBuilder, - }, max_block_number::MaxBlockNumber, nullifier::{Nullifier, ScopedNullifier}, + }, + max_block_number::MaxBlockNumber, + nullifier::{Nullifier, ScopedNullifier}, private_circuit_public_inputs::PrivateCircuitPublicInputs, - }, address::AztecAddress, traits::is_empty, transaction::tx_request::TxRequest, + }, + address::AztecAddress, + traits::is_empty, + transaction::tx_request::TxRequest, utils::arrays::{array_length, array_to_bounded_vec, sort_by_counter_asc, sort_by_counter_desc}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer.nr index 486c626fa2b..3d570925058 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer.nr @@ -7,13 +7,16 @@ use dep::reset_kernel_lib::{PrivateValidationRequestProcessor, TransientDataInde use dep::types::{ abis::{ kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, - log_hash::{NoteLogHash, ScopedEncryptedLogHash}, note_hash::ScopedNoteHash, + log_hash::{NoteLogHash, ScopedEncryptedLogHash}, + note_hash::ScopedNoteHash, nullifier::ScopedNullifier, - }, address::AztecAddress, + }, + address::AztecAddress, constants::{ MAX_ENCRYPTED_LOGS_PER_TX, MAX_NOTE_ENCRYPTED_LOGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, - }, hash::{mask_encrypted_log_hash, silo_note_hash, silo_nullifier}, + }, + hash::{mask_encrypted_log_hash, silo_note_hash, silo_nullifier}, utils::arrays::sort_by_counter_asc, }; diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer/reset_output_hints.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer/reset_output_hints.nr index 625023f3f03..a88cbd99565 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer/reset_output_hints.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer/reset_output_hints.nr @@ -14,7 +14,8 @@ use dep::types::{ constants::{ MAX_ENCRYPTED_LOGS_PER_TX, MAX_NOTE_ENCRYPTED_LOGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, - }, utils::arrays::{get_order_hints_asc, OrderHint}, + }, + utils::arrays::{get_order_hints_asc, OrderHint}, }; pub struct ResetOutputHints { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer/reset_output_hints/get_transient_or_propagated_note_hash_indexes_for_logs.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer/reset_output_hints/get_transient_or_propagated_note_hash_indexes_for_logs.nr index 208bfc36c15..d57b7c061d2 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer/reset_output_hints/get_transient_or_propagated_note_hash_indexes_for_logs.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_composer/reset_output_hints/get_transient_or_propagated_note_hash_indexes_for_logs.nr @@ -1,6 +1,7 @@ use dep::reset_kernel_lib::TransientDataIndexHint; use dep::types::{ - abis::{log_hash::NoteLogHash, note_hash::ScopedNoteHash}, utils::arrays::find_index_hint, + abis::{log_hash::NoteLogHash, note_hash::ScopedNoteHash}, + utils::arrays::find_index_hint, }; pub unconstrained fn get_transient_or_propagated_note_hash_indexes_for_logs( diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_validator.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_validator.nr index e0ab7346acc..c126b1ebf5b 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_validator.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/reset_output_validator.nr @@ -5,9 +5,12 @@ use dep::reset_kernel_lib::{ use dep::types::{ abis::{ kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, - log_hash::{NoteLogHash, ScopedEncryptedLogHash}, note_hash::ScopedNoteHash, + log_hash::{NoteLogHash, ScopedEncryptedLogHash}, + note_hash::ScopedNoteHash, nullifier::ScopedNullifier, - }, hash::{mask_encrypted_log_hash, silo_note_hash, silo_nullifier}, traits::is_empty, + }, + hash::{mask_encrypted_log_hash, silo_note_hash, silo_nullifier}, + traits::is_empty, utils::arrays::{ assert_sorted_transformed_value_array, assert_sorted_transformed_value_array_capped_size, }, diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_composer.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_composer.nr index 093fd62d795..44eca05c0f6 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_composer.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_composer.nr @@ -8,9 +8,11 @@ use dep::types::{ abis::{ accumulated_data::combined_accumulated_data::CombinedAccumulatedData, kernel_circuit_public_inputs::{KernelCircuitPublicInputs, PrivateKernelCircuitPublicInputs}, - log_hash::{NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, note_hash::ScopedNoteHash, + log_hash::{NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, + note_hash::ScopedNoteHash, nullifier::ScopedNullifier, - }, messaging::l2_to_l1_message::ScopedL2ToL1Message, + }, + messaging::l2_to_l1_message::ScopedL2ToL1Message, }; pub struct TailOutputComposer { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_composer/meter_gas_used.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_composer/meter_gas_used.nr index f0f5def75b7..7ecd1b59a77 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_composer/meter_gas_used.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_composer/meter_gas_used.nr @@ -6,7 +6,8 @@ use dep::types::{ constants::{ DA_BYTES_PER_FIELD, DA_GAS_PER_BYTE, L2_GAS_PER_LOG_BYTE, L2_GAS_PER_NOTE_HASH, L2_GAS_PER_NULLIFIER, - }, utils::arrays::array_length, + }, + utils::arrays::array_length, }; pub fn meter_gas_used(data: CombinedAccumulatedData, gas_settings: GasSettings) -> Gas { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_validator.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_validator.nr index 87b11475ae8..dbca9f64106 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_validator.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_output_validator.nr @@ -8,7 +8,9 @@ use dep::types::{ abis::{ kernel_circuit_public_inputs::{KernelCircuitPublicInputs, PrivateKernelCircuitPublicInputs}, log_hash::{NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, - }, messaging::l2_to_l1_message::ScopedL2ToL1Message, traits::is_empty, + }, + messaging::l2_to_l1_message::ScopedL2ToL1Message, + traits::is_empty, utils::arrays::assert_exposed_sorted_transformed_value_array, }; diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_composer.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_composer.nr index 241256003e7..b32a7408dce 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_composer.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_composer.nr @@ -11,7 +11,8 @@ use crate::components::{ use dep::types::abis::{ kernel_circuit_public_inputs::{ PrivateKernelCircuitPublicInputs, PublicKernelCircuitPublicInputs, - }, validation_requests::PublicValidationRequests, + }, + validation_requests::PublicValidationRequests, }; pub struct TailToPublicOutputComposer { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_composer/meter_gas_used.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_composer/meter_gas_used.nr index f3b0e8b572e..a338db8f439 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_composer/meter_gas_used.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_composer/meter_gas_used.nr @@ -3,7 +3,8 @@ use dep::types::{ constants::{ DA_BYTES_PER_FIELD, DA_GAS_PER_BYTE, FIXED_AVM_STARTUP_L2_GAS, L2_GAS_PER_LOG_BYTE, L2_GAS_PER_NOTE_HASH, L2_GAS_PER_NULLIFIER, - }, utils::arrays::array_length, + }, + utils::arrays::array_length, }; fn meter_gas_used(data: PublicAccumulatedData) -> Gas { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_validator.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_validator.nr index 55c07a1804e..7201736c70e 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_validator.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_validator.nr @@ -12,10 +12,14 @@ use dep::types::{ abis::{ kernel_circuit_public_inputs::{ PrivateKernelCircuitPublicInputs, PublicKernelCircuitPublicInputs, - }, log_hash::{LogHash, NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, - note_hash::ScopedNoteHash, nullifier::{Nullifier, ScopedNullifier}, + }, + log_hash::{LogHash, NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, + note_hash::ScopedNoteHash, + nullifier::{Nullifier, ScopedNullifier}, public_call_request::PublicCallRequest, - }, messaging::l2_to_l1_message::ScopedL2ToL1Message, traits::is_empty_array, + }, + messaging::l2_to_l1_message::ScopedL2ToL1Message, + traits::is_empty_array, utils::arrays::{ assert_split_sorted_transformed_value_arrays_asc, assert_split_sorted_transformed_value_arrays_desc, assert_split_transformed_value_arrays, diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_validator/tail_to_public_output_hints.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_validator/tail_to_public_output_hints.nr index f46f0af3422..be4038a7515 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_validator/tail_to_public_output_hints.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/components/tail_to_public_output_validator/tail_to_public_output_hints.nr @@ -2,7 +2,8 @@ use dep::types::{ abis::kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, constants::{ MAX_L2_TO_L1_MSGS_PER_TX, MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_UNENCRYPTED_LOGS_PER_TX, - }, utils::arrays::{get_split_order_hints_asc, get_split_order_hints_desc, SplitOrderHints}, + }, + utils::arrays::{get_split_order_hints_asc, get_split_order_hints_desc, SplitOrderHints}, }; pub struct TailToPublicOutputHints { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_empty.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_empty.nr index 803a3207ebe..f1042b6d945 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_empty.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_empty.nr @@ -1,9 +1,12 @@ use dep::types::{ - header::Header, KernelCircuitPublicInputs, + header::Header, + KernelCircuitPublicInputs, recursion::{ - proof::RecursiveProof, traits::Verifiable, + proof::RecursiveProof, + traits::Verifiable, verification_key::{HonkVerificationKey, VerificationKey}, - }, traits::Empty, + }, + traits::Empty, }; pub struct EmptyNestedCircuitPublicInputs { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_init.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_init.nr index 1479b82e45c..5f6eceb0c47 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_init.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_init.nr @@ -8,7 +8,8 @@ use dep::types::{ kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, private_circuit_public_inputs::PrivateCircuitPublicInputs, private_kernel::private_call_data::{PrivateCallData, PrivateCallDataWithoutPublicInputs}, - }, transaction::tx_request::TxRequest, + }, + transaction::tx_request::TxRequest, }; // Initialization struct for private inputs to the private kernel diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_inner.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_inner.nr index f497f1b3fff..b63f31ede3d 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_inner.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_inner.nr @@ -8,7 +8,8 @@ use dep::types::{ abis::{ kernel_circuit_public_inputs::{ PrivateKernelCircuitPublicInputs, PrivateKernelCircuitPublicInputsArrayLengths, - }, private_circuit_public_inputs::PrivateCircuitPublicInputs, + }, + private_circuit_public_inputs::PrivateCircuitPublicInputs, private_kernel::private_call_data::{PrivateCallData, PrivateCallDataWithoutPublicInputs}, private_kernel_data::{PrivateKernelData, PrivateKernelDataWithoutPublicInputs}, }, diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_reset.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_reset.nr index 89772192e7f..682c7a0a521 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_reset.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_reset.nr @@ -135,17 +135,23 @@ mod tests { tests::{ note_hash_read_request_hints_builder::NoteHashReadRequestHintsBuilder, nullifier_read_request_hints_builder::NullifierReadRequestHintsBuilder, - }, TransientDataIndexHint, + }, + TransientDataIndexHint, }; use dep::types::{ abis::{ kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, - log_hash::{NoteLogHash, ScopedEncryptedLogHash}, max_block_number::MaxBlockNumber, - note_hash::ScopedNoteHash, nullifier::ScopedNullifier, - }, address::AztecAddress, hash::{mask_encrypted_log_hash, silo_note_hash, silo_nullifier}, + log_hash::{NoteLogHash, ScopedEncryptedLogHash}, + max_block_number::MaxBlockNumber, + note_hash::ScopedNoteHash, + nullifier::ScopedNullifier, + }, + address::AztecAddress, + hash::{mask_encrypted_log_hash, silo_note_hash, silo_nullifier}, point::Point, tests::{fixture_builder::FixtureBuilder, utils::{assert_array_eq, swap_items}}, - traits::is_empty_array, utils::arrays::find_index_hint, + traits::is_empty_array, + utils::arrays::find_index_hint, }; use dep::types::constants::{ BASE_ROLLUP_INDEX, GENERATOR_INDEX__OVSK_M, MAX_KEY_VALIDATION_REQUESTS_PER_TX, diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail.nr index 52dfac5bc74..8e8268ad5b4 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail.nr @@ -58,8 +58,11 @@ mod tests { abis::{ gas::Gas, kernel_circuit_public_inputs::KernelCircuitPublicInputs, log_hash::ScopedLogHash, max_block_number::MaxBlockNumber, - }, address::{AztecAddress, EthAddress}, point::Point, - tests::fixture_builder::FixtureBuilder, traits::is_empty, + }, + address::{AztecAddress, EthAddress}, + point::Point, + tests::fixture_builder::FixtureBuilder, + traits::is_empty, }; use dep::types::constants::{ BASE_ROLLUP_INDEX, DA_BYTES_PER_FIELD, DA_GAS_PER_BYTE, GENERATOR_INDEX__IVSK_M, diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail_to_public.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail_to_public.nr index 1f0731b8e46..7910463a800 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail_to_public.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/private_kernel_tail_to_public.nr @@ -57,10 +57,15 @@ mod tests { }; use dep::types::{ abis::{ - gas::Gas, kernel_circuit_public_inputs::PublicKernelCircuitPublicInputs, - log_hash::{LogHash, NoteLogHash}, note_hash::ScopedNoteHash, + gas::Gas, + kernel_circuit_public_inputs::PublicKernelCircuitPublicInputs, + log_hash::{LogHash, NoteLogHash}, + note_hash::ScopedNoteHash, nullifier::{Nullifier, ScopedNullifier}, - }, address::{AztecAddress, EthAddress}, constants::PRIVATE_KERNEL_INNER_INDEX, point::Point, + }, + address::{AztecAddress, EthAddress}, + constants::PRIVATE_KERNEL_INNER_INDEX, + point::Point, tests::{fixture_builder::FixtureBuilder, utils::assert_array_eq}, }; use dep::types::constants::{ diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_call_data_validator_builder/mod.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_call_data_validator_builder/mod.nr index 5f0d70f292b..58b753d3b01 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_call_data_validator_builder/mod.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_call_data_validator_builder/mod.nr @@ -15,7 +15,9 @@ use dep::types::{ abis::{ note_hash::ScopedNoteHash, private_call_request::PrivateCallRequest, private_kernel::private_call_data::PrivateCallData, - }, tests::fixture_builder::FixtureBuilder, transaction::tx_request::TxRequest, + }, + tests::fixture_builder::FixtureBuilder, + transaction::tx_request::TxRequest, }; pub struct PrivateCallDataValidatorBuilder { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_kernel_circuit_output_validator_builder/mod.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_kernel_circuit_output_validator_builder/mod.nr index 384fa98417b..0604a83155e 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_kernel_circuit_output_validator_builder/mod.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_kernel_circuit_output_validator_builder/mod.nr @@ -12,7 +12,9 @@ use dep::types::{ kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputsArrayLengths, private_call_request::PrivateCallRequest, private_circuit_public_inputs::PrivateCircuitPublicInputsArrayLengths, - }, constants::PRIVATE_KERNEL_INIT_INDEX, tests::fixture_builder::FixtureBuilder, + }, + constants::PRIVATE_KERNEL_INIT_INDEX, + tests::fixture_builder::FixtureBuilder, transaction::tx_request::TxRequest, }; diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_kernel_circuit_public_inputs_composer_builder/mod.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_kernel_circuit_public_inputs_composer_builder/mod.nr index adc4b05947d..3ccc2438ab7 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_kernel_circuit_public_inputs_composer_builder/mod.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/private_kernel_circuit_public_inputs_composer_builder/mod.nr @@ -7,7 +7,9 @@ use dep::types::{ abis::{ kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, private_call_request::PrivateCallRequest, - }, tests::fixture_builder::FixtureBuilder, transaction::tx_request::TxRequest, + }, + tests::fixture_builder::FixtureBuilder, + transaction::tx_request::TxRequest, }; pub struct PrivateKernelCircuitPublicInputsComposerBuilder { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/reset_output_validator_builder/mod.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/reset_output_validator_builder/mod.nr index 46fbe569a48..71955e0ebd5 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/reset_output_validator_builder/mod.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/reset_output_validator_builder/mod.nr @@ -6,7 +6,8 @@ use crate::components::{ reset_output_validator::ResetOutputValidator, }; use dep::reset_kernel_lib::{ - KeyValidationHint, PrivateValidationRequestProcessor, + KeyValidationHint, + PrivateValidationRequestProcessor, tests::{NoteHashReadRequestHintsBuilder, NullifierReadRequestHintsBuilder}, TransientDataIndexHint, }; diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_output_composer_builder/meter_gas_used.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_output_composer_builder/meter_gas_used.nr index 4b69b82f9dc..3a04eb2c387 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_output_composer_builder/meter_gas_used.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_output_composer_builder/meter_gas_used.nr @@ -4,7 +4,8 @@ use dep::types::{ constants::{ DA_BYTES_PER_FIELD, DA_GAS_PER_BYTE, L2_GAS_PER_LOG_BYTE, L2_GAS_PER_NOTE_HASH, L2_GAS_PER_NULLIFIER, - }, tests::fixture_builder::FixtureBuilder, + }, + tests::fixture_builder::FixtureBuilder, }; fn new_builder() -> FixtureBuilder { diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_output_validator_builder/mod.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_output_validator_builder/mod.nr index e3a784e5081..7bc01c93661 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_output_validator_builder/mod.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_output_validator_builder/mod.nr @@ -6,7 +6,8 @@ mod validate_propagated_values; use crate::components::{ tail_output_composer::meter_gas_used::meter_gas_used, tail_output_validator::{ - tail_output_hints::{generate_tail_output_hints, TailOutputHints}, TailOutputValidator, + tail_output_hints::{generate_tail_output_hints, TailOutputHints}, + TailOutputValidator, }, }; use dep::types::{ diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_to_public_output_composer_builder/meter_gas_used.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_to_public_output_composer_builder/meter_gas_used.nr index d54da7c8ea0..f85e960474e 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_to_public_output_composer_builder/meter_gas_used.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_to_public_output_composer_builder/meter_gas_used.nr @@ -6,7 +6,8 @@ use dep::types::{ constants::{ DA_BYTES_PER_FIELD, DA_GAS_PER_BYTE, FIXED_AVM_STARTUP_L2_GAS, L2_GAS_PER_LOG_BYTE, L2_GAS_PER_NOTE_HASH, L2_GAS_PER_NULLIFIER, - }, tests::fixture_builder::FixtureBuilder, + }, + tests::fixture_builder::FixtureBuilder, }; #[test] diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_to_public_output_composer_builder/tail_to_public_output_composer.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_to_public_output_composer_builder/tail_to_public_output_composer.nr index 6d1e9a4972a..02cea830552 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_to_public_output_composer_builder/tail_to_public_output_composer.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-lib/src/tests/tail_to_public_output_composer_builder/tail_to_public_output_composer.nr @@ -4,7 +4,8 @@ use dep::types::{ constants::{ DA_BYTES_PER_FIELD, DA_GAS_PER_BYTE, FIXED_AVM_STARTUP_L2_GAS, L2_GAS_PER_LOG_BYTE, L2_GAS_PER_NOTE_HASH, L2_GAS_PER_NULLIFIER, - }, tests::utils::{assert_array_eq, swap_items}, + }, + tests::utils::{assert_array_eq, swap_items}, }; #[test] @@ -140,7 +141,7 @@ fn tail_to_public_output_composer_succeeds() { // Gas: revertible let total_num_side_effects = 2 + 1 + 1; let total_log_length = 20 // note_encrypted_log_hash - + 6 + + 6 + 24 // encrypted_log_hash + 4; // unencrypted_log_hash let computed_da_gas = diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-reset-simulated/src/main.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-reset-simulated/src/main.nr index 6e584b61bbe..89199192db0 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-reset-simulated/src/main.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-reset-simulated/src/main.nr @@ -6,7 +6,8 @@ use dep::types::{ MAX_ENCRYPTED_LOGS_PER_TX, MAX_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_NULLIFIERS_PER_TX, - }, PrivateKernelCircuitPublicInputs, + }, + PrivateKernelCircuitPublicInputs, }; use types::abis::private_kernel_data::PrivateKernelDataWithoutPublicInputs; diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-reset/src/main.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-reset/src/main.nr index 67acf1f4e81..a5371db73d7 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-reset/src/main.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-reset/src/main.nr @@ -6,7 +6,8 @@ use dep::types::{ MAX_ENCRYPTED_LOGS_PER_TX, MAX_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_NULLIFIERS_PER_TX, - }, PrivateKernelCircuitPublicInputs, + }, + PrivateKernelCircuitPublicInputs, }; use types::abis::private_kernel_data::PrivateKernelDataWithoutPublicInputs; diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/enqueued_call_data_validator.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/enqueued_call_data_validator.nr index de04e28e871..874779c9b90 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/enqueued_call_data_validator.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/enqueued_call_data_validator.nr @@ -5,7 +5,9 @@ use dep::types::{ kernel_circuit_public_inputs::PublicKernelCircuitPublicInputs, public_call_request::PublicCallRequest, validation_requests::PublicValidationRequestArrayLengths, - }, constants::MAX_L2_GAS_PER_ENQUEUED_CALL, utils::arrays::array_length, + }, + constants::MAX_L2_GAS_PER_ENQUEUED_CALL, + utils::arrays::array_length, }; pub struct EnqueuedCallDataValidator { diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_kernel_output_composer.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_kernel_output_composer.nr index e073a9d9bc5..0c982cd789d 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_kernel_output_composer.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_kernel_output_composer.nr @@ -10,8 +10,10 @@ use dep::types::{ kernel_circuit_public_inputs::{ PublicKernelCircuitPublicInputs, PublicKernelCircuitPublicInputsBuilder, VMCircuitPublicInputs, - }, public_call_request::PublicCallRequest, - }, traits::is_empty, + }, + public_call_request::PublicCallRequest, + }, + traits::is_empty, }; pub struct PublicKernelOutputComposer { diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_kernel_output_validator.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_kernel_output_validator.nr index 52e0af2d111..d54de5d49e6 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_kernel_output_validator.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_kernel_output_validator.nr @@ -3,9 +3,11 @@ use dep::types::{ abis::{ accumulated_data::public_accumulated_data::{ PublicAccumulatedData, PublicAccumulatedDataArrayLengths, - }, kernel_circuit_public_inputs::{PublicKernelCircuitPublicInputs, VMCircuitPublicInputs}, + }, + kernel_circuit_public_inputs::{PublicKernelCircuitPublicInputs, VMCircuitPublicInputs}, validation_requests::public_validation_requests::PublicValidationRequestArrayLengths, - }, traits::is_empty, + }, + traits::is_empty, utils::arrays::{array_length, assert_array_appended, assert_array_prepended}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer.nr index 61a302e5187..70f8219bf52 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer.nr @@ -12,7 +12,9 @@ use crate::components::public_tail_output_composer::{ use dep::types::{ abis::kernel_circuit_public_inputs::{ KernelCircuitPublicInputs, PublicKernelCircuitPublicInputs, - }, data::PublicDataLeafHint, partial_state_reference::PartialStateReference, + }, + data::PublicDataLeafHint, + partial_state_reference::PartialStateReference, }; pub struct PublicTailOutputComposer { diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/combine_data.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/combine_data.nr index 01c537cf41f..e6362a42aa8 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/combine_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/combine_data.nr @@ -2,8 +2,10 @@ use crate::components::public_tail_output_composer::generate_output_hints::Outpu use dep::types::{ abis::{ accumulated_data::{CombinedAccumulatedData, PublicAccumulatedData}, - log_hash::{LogHash, ScopedLogHash}, nullifier::Nullifier, - }, utils::arrays::{array_merge, dedupe_array, sort_by_counter_asc}, + log_hash::{LogHash, ScopedLogHash}, + nullifier::Nullifier, + }, + utils::arrays::{array_merge, dedupe_array, sort_by_counter_asc}, }; pub unconstrained fn combine_data( diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_output_hints.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_output_hints.nr index 3d775538dc7..e36f4ef41a8 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_output_hints.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_output_hints.nr @@ -1,7 +1,8 @@ use crate::components::public_tail_output_composer::{ generate_overridable_public_data_writes::{ generate_overridable_public_data_writes, LinkedIndexHint, - }, generate_public_data_leaves::generate_public_data_leaves, + }, + generate_public_data_leaves::generate_public_data_leaves, }; use dep::types::{ abis::{ @@ -12,7 +13,9 @@ use dep::types::{ MAX_ENCRYPTED_LOGS_PER_TX, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_ENCRYPTED_LOGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_UNENCRYPTED_LOGS_PER_TX, - }, data::{OverridablePublicDataTreeLeaf, PublicDataLeafHint}, hash::silo_note_hash, + }, + data::{OverridablePublicDataTreeLeaf, PublicDataLeafHint}, + hash::silo_note_hash, traits::Empty, utils::arrays::{ array_merge, CombinedOrderHint, get_combined_order_hints_asc, sort_by_counter_asc, diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_overridable_public_data_writes.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_overridable_public_data_writes.nr index f67768f322c..e18193b31be 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_overridable_public_data_writes.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_overridable_public_data_writes.nr @@ -2,7 +2,9 @@ use dep::types::{ abis::{ public_data_update_request::PublicDataUpdateRequest, public_data_write::OverridablePublicDataWrite, - }, data::OverridablePublicDataTreeLeaf, traits::Empty, + }, + data::OverridablePublicDataTreeLeaf, + traits::Empty, utils::arrays::{array_length, find_index_hint}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_public_data_leaves.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_public_data_leaves.nr index 7f73cccfe48..0a2f95e8392 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_public_data_leaves.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_composer/generate_public_data_leaves.nr @@ -1,6 +1,7 @@ use dep::types::{ abis::{public_data_read::PublicDataRead, public_data_update_request::PublicDataUpdateRequest}, - data::{OverridablePublicDataTreeLeaf, PublicDataLeafHint, PublicDataTreeLeaf}, traits::Empty, + data::{OverridablePublicDataTreeLeaf, PublicDataLeafHint, PublicDataTreeLeaf}, + traits::Empty, utils::arrays::{get_sorted_result, SortedResult}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator.nr index 1eb58595ad7..4b5da5a4d8f 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator.nr @@ -13,10 +13,14 @@ use crate::components::{ use dep::types::{ abis::{ kernel_circuit_public_inputs::{KernelCircuitPublicInputs, PublicKernelCircuitPublicInputs}, - log_hash::{LogHash, ScopedLogHash}, note_hash::ScopedNoteHash, nullifier::Nullifier, + log_hash::{LogHash, ScopedLogHash}, + note_hash::ScopedNoteHash, + nullifier::Nullifier, public_data_update_request::PublicDataUpdateRequest, public_data_write::OverridablePublicDataWrite, - }, data::PublicDataLeafHint, hash::silo_note_hash, + }, + data::PublicDataLeafHint, + hash::silo_note_hash, messaging::l2_to_l1_message::ScopedL2ToL1Message, partial_state_reference::PartialStateReference, utils::arrays::{ diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator/validate_linked_public_data_writes.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator/validate_linked_public_data_writes.nr index cda2f56482b..44bea48e398 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator/validate_linked_public_data_writes.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator/validate_linked_public_data_writes.nr @@ -59,7 +59,9 @@ mod tests { abis::{ public_data_update_request::PublicDataUpdateRequest, public_data_write::OverridablePublicDataWrite, - }, data::{OverridablePublicDataTreeLeaf, PublicDataTreeLeaf}, tests::utils::pad_end, + }, + data::{OverridablePublicDataTreeLeaf, PublicDataTreeLeaf}, + tests::utils::pad_end, }; struct TestBuilder { diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator/validate_unique_leaf_slots.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator/validate_unique_leaf_slots.nr index 63fd9ffea1e..e0c3ec42171 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator/validate_unique_leaf_slots.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/public_tail_output_validator/validate_unique_leaf_slots.nr @@ -30,7 +30,8 @@ pub fn validate_unique_leaf_slots( mod tests { use crate::components::public_tail_output_validator::validate_unique_leaf_slots::validate_unique_leaf_slots; use dep::types::{ - data::{OverridablePublicDataTreeLeaf, PublicDataTreeLeaf}, tests::utils::pad_end, + data::{OverridablePublicDataTreeLeaf, PublicDataTreeLeaf}, + tests::utils::pad_end, utils::arrays::SortedResult, }; diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/vm_circuit_output_composer.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/vm_circuit_output_composer.nr index 7d938478c52..2a492590f23 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/vm_circuit_output_composer.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/vm_circuit_output_composer.nr @@ -4,16 +4,20 @@ use crate::components::vm_circuit_output_composer::propagate_accumulated_data::p use dep::types::{ abis::{ accumulated_data::{PublicAccumulatedDataArrayLengths, PublicAccumulatedDataBuilder}, - combined_constant_data::CombinedConstantData, gas::Gas, + combined_constant_data::CombinedConstantData, + gas::Gas, kernel_circuit_public_inputs::vm_circuit_public_inputs::VMCircuitPublicInputs, public_call_request::PublicCallRequest, - public_circuit_public_inputs::PublicCircuitPublicInputs, public_data_read::PublicDataRead, + public_circuit_public_inputs::PublicCircuitPublicInputs, + public_data_read::PublicDataRead, public_inner_call_request::PublicInnerCallRequest, validation_requests::{ public_validation_requests_builder::PublicValidationRequestsBuilder, PublicValidationRequestArrayLengths, }, - }, constants::MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, traits::is_empty, + }, + constants::MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, + traits::is_empty, utils::arrays::array_to_bounded_vec, }; diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/vm_circuit_output_composer/propagate_accumulated_data.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/vm_circuit_output_composer/propagate_accumulated_data.nr index 3c1df8c3fbf..6010ea888b4 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/vm_circuit_output_composer/propagate_accumulated_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/components/vm_circuit_output_composer/propagate_accumulated_data.nr @@ -3,7 +3,8 @@ use dep::types::{ accumulated_data::PublicAccumulatedDataBuilder, nullifier::Nullifier, public_circuit_public_inputs::PublicCircuitPublicInputs, public_data_update_request::PublicDataUpdateRequest, - }, hash::compute_siloed_nullifier, + }, + hash::compute_siloed_nullifier, }; pub fn propagate_accumulated_data( diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_merge.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_merge.nr index 895ddbc8c53..26283872651 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_merge.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_merge.nr @@ -4,14 +4,16 @@ use crate::{ previous_kernel_validator::PreviousKernelValidator, public_kernel_output_composer::PublicKernelOutputComposer, public_kernel_output_validator::PublicKernelOutputValidator, - }, public_kernel_phase::PublicKernelPhase, + }, + public_kernel_phase::PublicKernelPhase, }; use dep::types::{ abis::{ enqueued_call_data::EnqueuedCallData, kernel_circuit_public_inputs::PublicKernelCircuitPublicInputs, public_kernel_data::PublicKernelData, - }, constants::{PUBLIC_KERNEL_MERGE_INDEX, TUBE_INDEX}, + }, + constants::{PUBLIC_KERNEL_MERGE_INDEX, TUBE_INDEX}, }; global ALLOWED_PREVIOUS_CIRCUITS = [TUBE_INDEX, PUBLIC_KERNEL_MERGE_INDEX]; @@ -89,7 +91,8 @@ mod tests { kernel_circuit_public_inputs::PublicKernelCircuitPublicInputs, max_block_number::MaxBlockNumber, validation_requests::PublicValidationRequestArrayLengths, - }, constants::{BASE_ROLLUP_INDEX, PRIVATE_KERNEL_TAIL_TO_PUBLIC_INDEX}, + }, + constants::{BASE_ROLLUP_INDEX, PRIVATE_KERNEL_TAIL_TO_PUBLIC_INDEX}, tests::{fixture_builder::FixtureBuilder, utils::assert_array_eq}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_tail.nr b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_tail.nr index 33f7881cdbf..6f28560c91e 100644 --- a/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_tail.nr +++ b/noir-projects/noir-protocol-circuits/crates/public-kernel-lib/src/public_kernel_tail.nr @@ -3,13 +3,17 @@ use crate::{ previous_kernel_validator::PreviousKernelValidator, public_tail_output_composer::{OutputHints, PublicTailOutputComposer}, public_tail_output_validator::PublicTailOutputValidator, - }, public_kernel_phase::PublicKernelPhase, + }, + public_kernel_phase::PublicKernelPhase, }; use dep::reset_kernel_lib::{ - NullifierNonExistentReadRequestHints, NullifierReadRequestHints, + NullifierNonExistentReadRequestHints, + NullifierReadRequestHints, public_data_read_request_hints::{ build_public_data_read_request_hints, PublicDataReadRequestHints, - }, PublicValidationRequestProcessor, TreeLeafReadRequestHint, + }, + PublicValidationRequestProcessor, + TreeLeafReadRequestHint, }; use dep::types::{ abis::{ @@ -21,7 +25,9 @@ use dep::types::{ MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_PUBLIC_DATA_HINTS, MAX_PUBLIC_DATA_READS_PER_TX, NOTE_HASH_TREE_HEIGHT, PUBLIC_KERNEL_MERGE_INDEX, - }, data::PublicDataLeafHint, partial_state_reference::PartialStateReference, + }, + data::PublicDataLeafHint, + partial_state_reference::PartialStateReference, }; global ALLOWED_PREVIOUS_CIRCUITS = [PUBLIC_KERNEL_MERGE_INDEX]; @@ -97,14 +103,16 @@ mod tests { tests::{ nullifier_non_existent_read_request_hints_builder::NullifierNonExistentReadRequestHintsBuilder, nullifier_read_request_hints_builder::NullifierReadRequestHintsBuilder, - }, TreeLeafReadRequestHint, + }, + TreeLeafReadRequestHint, }; use dep::types::{ abis::{ kernel_circuit_public_inputs::KernelCircuitPublicInputs, nullifier::ScopedNullifier, nullifier_leaf_preimage::NullifierLeafPreimage, public_data_update_request::PublicDataUpdateRequest, - }, address::AztecAddress, + }, + address::AztecAddress, constants::{ BASE_ROLLUP_INDEX, L1_TO_L2_MSG_TREE_HEIGHT, MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NOTE_HASHES_PER_TX, @@ -114,13 +122,18 @@ mod tests { NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, NULLIFIER_TREE_HEIGHT, PUBLIC_DATA_SUBTREE_HEIGHT, PUBLIC_DATA_SUBTREE_SIBLING_PATH_LENGTH, PUBLIC_DATA_TREE_HEIGHT, PUBLIC_KERNEL_MERGE_INDEX, - }, data::{PublicDataLeafHint, PublicDataTreeLeafPreimage}, - hash::{compute_siloed_nullifier, silo_note_hash}, merkle_tree::MembershipWitness, + }, + data::{PublicDataLeafHint, PublicDataTreeLeafPreimage}, + hash::{compute_siloed_nullifier, silo_note_hash}, + merkle_tree::MembershipWitness, partial_state_reference::PartialStateReference, tests::{ - fixture_builder::FixtureBuilder, merkle_tree_utils::NonEmptyMerkleTree, + fixture_builder::FixtureBuilder, + merkle_tree_utils::NonEmptyMerkleTree, utils::{assert_array_eq, pad_end, swap_items}, - }, traits::is_empty, utils::arrays::{array_merge, find_index_hint}, + }, + traits::is_empty, + utils::arrays::{array_merge, find_index_hint}, }; fn build_note_hash_tree( diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/note_hash_read_request_reset.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/note_hash_read_request_reset.nr index 1cfcb5369e4..52aa039a2b6 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/note_hash_read_request_reset.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/note_hash_read_request_reset.nr @@ -52,9 +52,13 @@ mod tests { }; use dep::types::{ abis::{ - note_hash::{NoteHash, ScopedNoteHash}, note_hash_leaf_preimage::NoteHashLeafPreimage, + note_hash::{NoteHash, ScopedNoteHash}, + note_hash_leaf_preimage::NoteHashLeafPreimage, read_request::{ReadRequest, ScopedReadRequest}, - }, address::AztecAddress, constants::NOTE_HASH_TREE_HEIGHT, hash::compute_siloed_note_hash, + }, + address::AztecAddress, + constants::NOTE_HASH_TREE_HEIGHT, + hash::compute_siloed_note_hash, merkle_tree::MembershipWitness, tests::{merkle_tree_utils::NonEmptyMerkleTree, utils::assert_array_eq}, traits::is_empty_array, diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/nullifier_non_existent_read_request_reset.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/nullifier_non_existent_read_request_reset.nr index 496f899bddf..4068202c37b 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/nullifier_non_existent_read_request_reset.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/nullifier_non_existent_read_request_reset.nr @@ -4,7 +4,8 @@ use dep::types::{ constants::{ MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX, MAX_NULLIFIERS_PER_TX, NULLIFIER_TREE_HEIGHT, - }, merkle_tree::MembershipWitness, + }, + merkle_tree::MembershipWitness, }; pub struct NullifierNonMembershipHint { diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/nullifier_read_request_reset.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/nullifier_read_request_reset.nr index 87653104bff..96a5fac86d0 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/nullifier_read_request_reset.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/nullifier_read_request_reset.nr @@ -52,9 +52,13 @@ mod tests { }; use dep::types::{ abis::{ - nullifier::{Nullifier, ScopedNullifier}, nullifier_leaf_preimage::NullifierLeafPreimage, + nullifier::{Nullifier, ScopedNullifier}, + nullifier_leaf_preimage::NullifierLeafPreimage, read_request::{ReadRequest, ScopedReadRequest}, - }, address::AztecAddress, constants::NULLIFIER_TREE_HEIGHT, hash::compute_siloed_nullifier, + }, + address::AztecAddress, + constants::NULLIFIER_TREE_HEIGHT, + hash::compute_siloed_nullifier, merkle_tree::MembershipWitness, tests::{merkle_tree_utils::NonEmptyMerkleTree, utils::assert_array_eq}, traits::is_empty_array, diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/private_validation_request_processor.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/private_validation_request_processor.nr index b424985384f..8f641126807 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/private_validation_request_processor.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/private_validation_request_processor.nr @@ -5,14 +5,16 @@ use crate::{ key_validation_hint::{ get_unverified_key_validation_requests, KeyValidationHint, verify_reset_key_validation_requests, - }, read_request::{get_unverified_read_requests, verify_reset_read_requests}, + }, + read_request::{get_unverified_read_requests, verify_reset_read_requests}, }, }; use dep::types::{ abis::{ note_hash::ScopedNoteHash, nullifier::ScopedNullifier, validation_requests::PrivateValidationRequests, - }, constants::{MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX}, + }, + constants::{MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX}, }; pub struct PrivateValidationRequestProcessor { diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/public_data_read_request_hints.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/public_data_read_request_hints.nr index e54d5e0cc31..2b8effeed0a 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/public_data_read_request_hints.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/public_data_read_request_hints.nr @@ -1,7 +1,8 @@ use crate::reset::{mutable_data_read_request::ReadIndexHint, read_request::ReadRequestStatus}; use dep::types::{ abis::{public_data_read::PublicDataRead, public_data_write::OverridablePublicDataWrite}, - data::OverridablePublicDataTreeLeaf, utils::arrays::find_index_hint, + data::OverridablePublicDataTreeLeaf, + utils::arrays::find_index_hint, }; pub struct PublicDataReadRequestHints { diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/public_validation_request_processor.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/public_validation_request_processor.nr index be593a6df38..103a358d287 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/public_validation_request_processor.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/public_validation_request_processor.nr @@ -19,8 +19,11 @@ use dep::types::{ L1_TO_L2_MSG_TREE_HEIGHT, MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PUBLIC_DATA_READS_PER_TX, NOTE_HASH_TREE_HEIGHT, - }, data::OverridablePublicDataTreeLeaf, hash::compute_siloed_nullifier, - partial_state_reference::PartialStateReference, traits::is_empty, + }, + data::OverridablePublicDataTreeLeaf, + hash::compute_siloed_nullifier, + partial_state_reference::PartialStateReference, + traits::is_empty, utils::arrays::{ array_to_bounded_vec, assert_combined_array, assert_sorted_array, combine_arrays, }, diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/mutable_data_read_request.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/mutable_data_read_request.nr index e321873fc5f..87027b7e18f 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/mutable_data_read_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/mutable_data_read_request.nr @@ -123,13 +123,18 @@ mod tests { mutable_data_read_request::{ ensure_all_read_requests_are_verified, ReadIndexHint, reset_mutable_data_read_requests, validate_leaf_data_read_requests, validate_pending_read_requests, - }, read_request::{ReadRequestState, ReadRequestStatus}, + }, + read_request::{ReadRequestState, ReadRequestStatus}, }; use dep::types::{ abis::{ - public_data_read::PublicDataRead, public_data_update_request::PublicDataUpdateRequest, - public_data_write::OverridablePublicDataWrite, side_effect::{Overridable, Readable}, - }, tests::utils::pad_end, traits::Empty, + public_data_read::PublicDataRead, + public_data_update_request::PublicDataUpdateRequest, + public_data_write::OverridablePublicDataWrite, + side_effect::{Overridable, Readable}, + }, + tests::utils::pad_end, + traits::Empty, }; struct TestLeafData { diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/non_existent_read_request.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/non_existent_read_request.nr index af3ab9a611c..3cd22aa7443 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/non_existent_read_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/non_existent_read_request.nr @@ -112,7 +112,8 @@ mod tests { }; use dep::types::{ - abis::{read_request::ReadRequest, side_effect::OrderedValue}, address::AztecAddress, + abis::{read_request::ReadRequest, side_effect::OrderedValue}, + address::AztecAddress, merkle_tree::{leaf_preimage::IndexedTreeLeafPreimage, membership::MembershipWitness}, tests::merkle_tree_utils::NonEmptyMerkleTree, }; diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/read_request.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/read_request.nr index e32fbb788e7..5e82fc20751 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/read_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/read_request.nr @@ -1,7 +1,8 @@ // This will be moved to a separate Read Request Reset Circuit. use dep::types::{ abis::{read_request::ScopedReadRequest, side_effect::Readable}, - merkle_tree::{assert_check_membership, LeafPreimage, MembershipWitness}, traits::Empty, + merkle_tree::{assert_check_membership, LeafPreimage, MembershipWitness}, + traits::Empty, }; pub struct ReadRequestStateEnum { @@ -199,7 +200,8 @@ mod tests { }; use dep::types::{ abis::{read_request::{ReadRequest, ScopedReadRequest}, side_effect::Readable}, - address::AztecAddress, merkle_tree::{LeafPreimage, MembershipWitness}, + address::AztecAddress, + merkle_tree::{LeafPreimage, MembershipWitness}, tests::{merkle_tree_utils::NonEmptyMerkleTree, utils::assert_array_eq}, traits::{Empty, is_empty_array}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/transient_data.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/transient_data.nr index fad6c81c520..19471c18b8a 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/transient_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/reset/transient_data.nr @@ -198,9 +198,11 @@ mod tests { }; use dep::types::{ abis::{ - log_hash::NoteLogHash, note_hash::{NoteHash, ScopedNoteHash}, + log_hash::NoteLogHash, + note_hash::{NoteHash, ScopedNoteHash}, nullifier::{Nullifier, ScopedNullifier}, - }, address::AztecAddress, + }, + address::AztecAddress, }; global contract_address = AztecAddress::from_field(987654); diff --git a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/tests/nullifier_non_existent_read_request_hints_builder.nr b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/tests/nullifier_non_existent_read_request_hints_builder.nr index 7035c32ede1..a7d48860ad1 100644 --- a/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/tests/nullifier_non_existent_read_request_hints_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/reset-kernel-lib/src/tests/nullifier_non_existent_read_request_hints_builder.nr @@ -6,7 +6,9 @@ use dep::types::{ constants::{ MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX, MAX_NULLIFIERS_PER_TX, NULLIFIER_SUBTREE_HEIGHT, NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, NULLIFIER_TREE_HEIGHT, - }, merkle_tree::MembershipWitness, tests::merkle_tree_utils::NonEmptyMerkleTree, + }, + merkle_tree::MembershipWitness, + tests::merkle_tree_utils::NonEmptyMerkleTree, utils::arrays::{find_index_hint, get_sorted_result}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/base_or_merge_rollup_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/base_or_merge_rollup_public_inputs.nr index f778fa569ce..bd9e7994bbb 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/base_or_merge_rollup_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/base_or_merge_rollup_public_inputs.nr @@ -1,7 +1,9 @@ use crate::abis::constant_rollup_data::ConstantRollupData; use dep::types::{ - constants::BASE_OR_MERGE_PUBLIC_INPUTS_LENGTH, partial_state_reference::PartialStateReference, - traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, + constants::BASE_OR_MERGE_PUBLIC_INPUTS_LENGTH, + partial_state_reference::PartialStateReference, + traits::{Deserialize, Empty, Serialize}, + utils::reader::Reader, }; global BASE_ROLLUP_TYPE = 0; diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/block_root_or_block_merge_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/block_root_or_block_merge_public_inputs.nr index 245b39c702a..5f4d14647f1 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/block_root_or_block_merge_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/block_root_or_block_merge_public_inputs.nr @@ -3,7 +3,9 @@ use dep::types::{ address::EthAddress, constants::{ AZTEC_EPOCH_DURATION, BLOCK_ROOT_OR_BLOCK_MERGE_PUBLIC_INPUTS_LENGTH, FEE_RECIPIENT_LENGTH, - }, traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, + }, + traits::{Deserialize, Empty, Serialize}, + utils::reader::Reader, }; pub struct FeeRecipient { diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/constant_rollup_data.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/constant_rollup_data.nr index 7307ecf4172..1d798746866 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/constant_rollup_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/constant_rollup_data.nr @@ -1,6 +1,7 @@ use dep::types::{ abis::{append_only_tree_snapshot::AppendOnlyTreeSnapshot, global_variables::GlobalVariables}, - constants::CONSTANT_ROLLUP_DATA_LENGTH, traits::{Deserialize, Empty, Serialize}, + constants::CONSTANT_ROLLUP_DATA_LENGTH, + traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_block_data.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_block_data.nr index dd3efcedc72..3a9c2ab9f02 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_block_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_block_data.nr @@ -3,9 +3,12 @@ use dep::types::{ constants::VK_TREE_HEIGHT, merkle_tree::{membership::assert_check_membership, MembershipWitness}, recursion::{ - proof::NestedRecursiveProof, traits::Verifiable, + proof::NestedRecursiveProof, + traits::Verifiable, verification_key::{HonkVerificationKey, VerificationKey}, - }, traits::Empty, utils::arrays::find_index_hint, + }, + traits::Empty, + utils::arrays::find_index_hint, }; pub struct PreviousRollupBlockData { diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_data.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_data.nr index 0deb3b479cb..a9e771d19d1 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/previous_rollup_data.nr @@ -3,9 +3,12 @@ use dep::types::{ constants::VK_TREE_HEIGHT, merkle_tree::{membership::assert_check_membership, MembershipWitness}, recursion::{ - proof::NestedRecursiveProof, traits::Verifiable, + proof::NestedRecursiveProof, + traits::Verifiable, verification_key::{HonkVerificationKey, VerificationKey}, - }, traits::Empty, utils::arrays::find_index_hint, + }, + traits::Empty, + utils::arrays::find_index_hint, }; pub struct PreviousRollupData { diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/base_rollup_inputs.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/base_rollup_inputs.nr index f5d7b6797cc..4b74c94aa43 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/base_rollup_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/base_rollup_inputs.nr @@ -2,7 +2,8 @@ use crate::{ abis::{ base_or_merge_rollup_public_inputs::{BASE_ROLLUP_TYPE, BaseOrMergeRollupPublicInputs}, constant_rollup_data::ConstantRollupData, - }, base::state_diff_hints::StateDiffHints, + }, + base::state_diff_hints::StateDiffHints, components::{compute_kernel_out_hash, compute_tx_effects_hash}, }; use dep::types::{ @@ -10,7 +11,8 @@ use dep::types::{ append_only_tree_snapshot::AppendOnlyTreeSnapshot, kernel_data::KernelData, nullifier_leaf_preimage::NullifierLeafPreimage, public_data_update_request::PublicDataUpdateRequest, - }, address::AztecAddress, + }, + address::AztecAddress, constants::{ ARCHIVE_HEIGHT, FEE_JUICE_ADDRESS, MAX_NOTE_HASHES_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, @@ -21,14 +23,20 @@ use dep::types::{ }, data::{ hash::{compute_public_data_tree_index, compute_public_data_tree_value}, - public_data_hint::PublicDataHint, PublicDataTreeLeaf, PublicDataTreeLeafPreimage, - }, hash::silo_l2_to_l1_message, + public_data_hint::PublicDataHint, + PublicDataTreeLeaf, + PublicDataTreeLeafPreimage, + }, + hash::silo_l2_to_l1_message, merkle_tree::{ append_only_tree, assert_check_membership, calculate_empty_tree_root, calculate_subtree_root, indexed_tree, MembershipWitness, - }, messaging::l2_to_l1_message::ScopedL2ToL1Message, - partial_state_reference::PartialStateReference, storage::map::derive_storage_slot_in_map, - traits::is_empty, utils::field::{full_field_greater_than, full_field_less_than}, + }, + messaging::l2_to_l1_message::ScopedL2ToL1Message, + partial_state_reference::PartialStateReference, + storage::map::derive_storage_slot_in_map, + traits::is_empty, + utils::field::{full_field_greater_than, full_field_less_than}, }; global ALLOWED_PREVIOUS_CIRCUITS = @@ -506,14 +514,16 @@ mod tests { base::{ base_rollup_inputs::{BaseRollupInputs, compute_fee_payer_fee_juice_balance_leaf_slot}, state_diff_hints::StateDiffHints, - }, components::TX_EFFECTS_HASH_INPUT_FIELDS, + }, + components::TX_EFFECTS_HASH_INPUT_FIELDS, }; use dep::types::{ abis::{ append_only_tree_snapshot::AppendOnlyTreeSnapshot, kernel_data::KernelData, nullifier_leaf_preimage::NullifierLeafPreimage, public_data_update_request::PublicDataUpdateRequest, - }, address::{AztecAddress, EthAddress}, + }, + address::{AztecAddress, EthAddress}, constants::{ ARCHIVE_HEIGHT, BASE_ROLLUP_INDEX, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, @@ -524,8 +534,10 @@ mod tests { PROTOCOL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, PUBLIC_DATA_SUBTREE_HEIGHT, PUBLIC_DATA_SUBTREE_SIBLING_PATH_LENGTH, PUBLIC_DATA_TREE_HEIGHT, PUBLIC_KERNEL_TAIL_INDEX, TUBE_INDEX, - }, data::{public_data_hint::PublicDataHint, PublicDataTreeLeaf, PublicDataTreeLeafPreimage}, - hash::silo_l2_to_l1_message, merkle_tree::MembershipWitness, + }, + data::{public_data_hint::PublicDataHint, PublicDataTreeLeaf, PublicDataTreeLeafPreimage}, + hash::silo_l2_to_l1_message, + merkle_tree::MembershipWitness, messaging::l2_to_l1_message::ScopedL2ToL1Message, partial_state_reference::PartialStateReference, tests::{fixture_builder::FixtureBuilder, fixtures, merkle_tree_utils::NonEmptyMerkleTree}, diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/state_diff_hints.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/state_diff_hints.nr index 27c46e2a1b9..5015f7ed779 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/state_diff_hints.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/state_diff_hints.nr @@ -4,7 +4,8 @@ use dep::types::{ MAX_NULLIFIERS_PER_TX, NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH, NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, NULLIFIER_TREE_HEIGHT, PUBLIC_DATA_SUBTREE_SIBLING_PATH_LENGTH, - }, merkle_tree::MembershipWitness, + }, + merkle_tree::MembershipWitness, }; pub struct StateDiffHints { diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/block_root/block_root_rollup_inputs.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/block_root/block_root_rollup_inputs.nr index 748171ffad4..845d5b056ea 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/block_root/block_root_rollup_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/block_root/block_root_rollup_inputs.nr @@ -2,7 +2,8 @@ use crate::{ abis::{ block_root_or_block_merge_public_inputs::{BlockRootOrBlockMergePublicInputs, FeeRecipient}, previous_rollup_data::PreviousRollupData, - }, components, + }, + components, }; use parity_lib::root::root_rollup_parity_input::RootRollupParityInput; use types::{ @@ -11,8 +12,11 @@ use types::{ ARCHIVE_HEIGHT, AZTEC_EPOCH_DURATION, BASE_ROLLUP_INDEX, L1_TO_L2_MSG_SUBTREE_HEIGHT, L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, MERGE_ROLLUP_INDEX, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, - }, content_commitment::ContentCommitment, header::Header, - merkle_tree::{append_only_tree, calculate_empty_tree_root}, state_reference::StateReference, + }, + content_commitment::ContentCommitment, + header::Header, + merkle_tree::{append_only_tree, calculate_empty_tree_root}, + state_reference::StateReference, traits::Empty, }; use types::debug_log::debug_log_format; diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/components.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/components.nr index 06e9c4b7a3a..68bdd43b3d8 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/components.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/components.nr @@ -7,7 +7,8 @@ use crate::abis::{ }; use dep::types::{ abis::{ - accumulated_data::CombinedAccumulatedData, log_hash::{LogHash, ScopedLogHash}, + accumulated_data::CombinedAccumulatedData, + log_hash::{LogHash, ScopedLogHash}, public_data_update_request::PublicDataUpdateRequest, }, constants::{ @@ -18,7 +19,9 @@ use dep::types::{ hash::{ accumulate_sha256, compute_tx_logs_hash, compute_tx_note_logs_hash, silo_encrypted_log_hash, silo_unencrypted_log_hash, - }, merkle_tree::VariableMerkleTree, utils::arrays::{array_length, array_merge}, + }, + merkle_tree::VariableMerkleTree, + utils::arrays::{array_length, array_merge}, }; /** @@ -358,7 +361,7 @@ fn get_all_update_requests_for_tx_effects( #[test] fn consistent_TX_EFFECTS_HASH_INPUT_FIELDS() { let expected_size = 1 // revert code - + 1 // transaction fee + + 1 // transaction fee + MAX_NOTE_HASHES_PER_TX + MAX_NULLIFIERS_PER_TX + MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX * 2 diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/tests/block_root_rollup_inputs.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/tests/block_root_rollup_inputs.nr index 4efd596f174..7a213dc35da 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/tests/block_root_rollup_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/tests/block_root_rollup_inputs.nr @@ -6,7 +6,8 @@ use dep::types::{ constants::{ ARCHIVE_HEIGHT, L1_TO_L2_MSG_SUBTREE_HEIGHT, L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, L1_TO_L2_MSG_TREE_HEIGHT, - }, tests::merkle_tree_utils::compute_zero_hashes, + }, + tests::merkle_tree_utils::compute_zero_hashes, }; pub fn compute_l1_l2_empty_snapshot() -> (AppendOnlyTreeSnapshot, [Field; L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH]) { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/combined_accumulated_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/combined_accumulated_data.nr index 5eac2c67caa..56116a56531 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/combined_accumulated_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/combined_accumulated_data.nr @@ -1,13 +1,16 @@ use crate::{ abis::{ - gas::Gas, log_hash::{LogHash, ScopedLogHash}, + gas::Gas, + log_hash::{LogHash, ScopedLogHash}, public_data_update_request::PublicDataUpdateRequest, }, constants::{ COMBINED_ACCUMULATED_DATA_LENGTH, MAX_ENCRYPTED_LOGS_PER_TX, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_ENCRYPTED_LOGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_UNENCRYPTED_LOGS_PER_TX, - }, messaging::l2_to_l1_message::ScopedL2ToL1Message, traits::{Deserialize, Empty, Serialize}, + }, + messaging::l2_to_l1_message::ScopedL2ToL1Message, + traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/private_accumulated_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/private_accumulated_data.nr index 219b8ac1e55..b7aee6d64c6 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/private_accumulated_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/private_accumulated_data.nr @@ -1,9 +1,13 @@ use crate::{ abis::{ - log_hash::{NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, note_hash::ScopedNoteHash, - nullifier::ScopedNullifier, private_call_request::PrivateCallRequest, + log_hash::{NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, + note_hash::ScopedNoteHash, + nullifier::ScopedNullifier, + private_call_request::PrivateCallRequest, public_call_request::PublicCallRequest, - }, messaging::l2_to_l1_message::ScopedL2ToL1Message, traits::{Deserialize, Empty, Serialize}, + }, + messaging::l2_to_l1_message::ScopedL2ToL1Message, + traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; use crate::constants::{ diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/private_accumulated_data_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/private_accumulated_data_builder.nr index d6620f0244e..3bd58cddbcf 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/private_accumulated_data_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/private_accumulated_data_builder.nr @@ -1,15 +1,19 @@ use crate::{ abis::{ accumulated_data::private_accumulated_data::PrivateAccumulatedData, - log_hash::{NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, note_hash::ScopedNoteHash, - nullifier::ScopedNullifier, private_call_request::PrivateCallRequest, + log_hash::{NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, + note_hash::ScopedNoteHash, + nullifier::ScopedNullifier, + private_call_request::PrivateCallRequest, public_call_request::PublicCallRequest, }, constants::{ MAX_ENCRYPTED_LOGS_PER_TX, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_ENCRYPTED_LOGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_UNENCRYPTED_LOGS_PER_TX, - }, messaging::l2_to_l1_message::ScopedL2ToL1Message, traits::Empty, + }, + messaging::l2_to_l1_message::ScopedL2ToL1Message, + traits::Empty, }; pub struct PrivateAccumulatedDataBuilder { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_data.nr index 1f188520960..4c1ddda3649 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_data.nr @@ -1,7 +1,10 @@ use crate::{ abis::{ - gas::Gas, log_hash::{LogHash, ScopedLogHash}, note_hash::ScopedNoteHash, - nullifier::Nullifier, public_call_request::PublicCallRequest, + gas::Gas, + log_hash::{LogHash, ScopedLogHash}, + note_hash::ScopedNoteHash, + nullifier::Nullifier, + public_call_request::PublicCallRequest, public_data_update_request::PublicDataUpdateRequest, }, constants::{ @@ -9,7 +12,9 @@ use crate::{ MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_UNENCRYPTED_LOGS_PER_TX, NUM_PUBLIC_ACCUMULATED_DATA_ARRAYS, PUBLIC_ACCUMULATED_DATA_LENGTH, - }, messaging::l2_to_l1_message::ScopedL2ToL1Message, traits::{Deserialize, Empty, Serialize}, + }, + messaging::l2_to_l1_message::ScopedL2ToL1Message, + traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_length, reader::Reader}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_data_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_data_builder.nr index 875cc29f53c..98b52060000 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_data_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/accumulated_data/public_accumulated_data_builder.nr @@ -1,14 +1,20 @@ use crate::{ abis::{ - accumulated_data::public_accumulated_data::PublicAccumulatedData, gas::Gas, - log_hash::{LogHash, ScopedLogHash}, note_hash::ScopedNoteHash, nullifier::Nullifier, - public_call_request::PublicCallRequest, public_data_update_request::PublicDataUpdateRequest, + accumulated_data::public_accumulated_data::PublicAccumulatedData, + gas::Gas, + log_hash::{LogHash, ScopedLogHash}, + note_hash::ScopedNoteHash, + nullifier::Nullifier, + public_call_request::PublicCallRequest, + public_data_update_request::PublicDataUpdateRequest, }, constants::{ MAX_ENCRYPTED_LOGS_PER_TX, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_ENCRYPTED_LOGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_UNENCRYPTED_LOGS_PER_TX, - }, messaging::l2_to_l1_message::ScopedL2ToL1Message, traits::Empty, + }, + messaging::l2_to_l1_message::ScopedL2ToL1Message, + traits::Empty, utils::arrays::array_to_bounded_vec, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/call_context.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/call_context.nr index 1743d4ada08..6eafed0eedd 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/call_context.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/call_context.nr @@ -1,6 +1,9 @@ use crate::{ - abis::function_selector::FunctionSelector, address::AztecAddress, - constants::CALL_CONTEXT_LENGTH, traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, + abis::function_selector::FunctionSelector, + address::AztecAddress, + constants::CALL_CONTEXT_LENGTH, + traits::{Deserialize, Empty, Serialize}, + utils::reader::Reader, }; // docs:start:call-context diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/function_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/function_data.nr index 93ec5c40d2d..2366cb99ab7 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/function_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/function_data.nr @@ -1,5 +1,6 @@ use crate::{ - abis::function_selector::FunctionSelector, constants::FUNCTION_DATA_LENGTH, + abis::function_selector::FunctionSelector, + constants::FUNCTION_DATA_LENGTH, traits::{Deserialize, Empty, Serialize}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/gas.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/gas.nr index b1eef3247e0..ccd0c236802 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/gas.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/gas.nr @@ -1,5 +1,6 @@ use crate::{ - abis::gas_fees::GasFees, constants::{FIXED_DA_GAS, FIXED_L2_GAS, GAS_LENGTH}, + abis::gas_fees::GasFees, + constants::{FIXED_DA_GAS, FIXED_L2_GAS, GAS_LENGTH}, traits::{Deserialize, Empty, Serialize}, }; use std::ops::{Add, Sub}; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/gas_settings.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/gas_settings.nr index ba234e90680..bf31b75ac47 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/gas_settings.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/gas_settings.nr @@ -3,7 +3,9 @@ use crate::{ constants::{ DEFAULT_GAS_LIMIT, DEFAULT_INCLUSION_FEE, DEFAULT_MAX_FEE_PER_GAS, DEFAULT_TEARDOWN_GAS_LIMIT, GAS_SETTINGS_LENGTH, - }, traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, + }, + traits::{Deserialize, Empty, Serialize}, + utils::reader::Reader, }; pub struct GasSettings { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/global_variables.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/global_variables.nr index 7c4b277f89d..abcfab91273 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/global_variables.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/global_variables.nr @@ -1,6 +1,8 @@ use crate::{ - abis::gas_fees::GasFees, address::{AztecAddress, EthAddress}, - constants::GLOBAL_VARIABLES_LENGTH, traits::{Deserialize, Empty, Serialize}, + abis::gas_fees::GasFees, + address::{AztecAddress, EthAddress}, + constants::GLOBAL_VARIABLES_LENGTH, + traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/kernel_circuit_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/kernel_circuit_public_inputs.nr index b1c818b30be..5743fdb34a3 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/kernel_circuit_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/kernel_circuit_public_inputs.nr @@ -2,8 +2,11 @@ use crate::{ abis::{ accumulated_data::CombinedAccumulatedData, combined_constant_data::CombinedConstantData, gas_fees::GasFees, validation_requests::RollupValidationRequests, - }, address::AztecAddress, constants::KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH, - partial_state_reference::PartialStateReference, traits::{Deserialize, Empty, Serialize}, + }, + address::AztecAddress, + constants::KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH, + partial_state_reference::PartialStateReference, + traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs.nr index 5788947a74d..647d8d6fc88 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs.nr @@ -2,8 +2,11 @@ use crate::{ abis::{ accumulated_data::PrivateAccumulatedData, combined_constant_data::CombinedConstantData, public_call_request::PublicCallRequest, validation_requests::PrivateValidationRequests, - }, address::AztecAddress, constants::PRIVATE_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH, - traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_length, reader::Reader}, + }, + address::AztecAddress, + constants::PRIVATE_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH, + traits::{Deserialize, Empty, Serialize}, + utils::{arrays::array_length, reader::Reader}, }; pub struct PrivateKernelCircuitPublicInputsArrayLengths { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs_builder.nr index 94a770fbf9d..c602171f27d 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/private_kernel_circuit_public_inputs_builder.nr @@ -5,7 +5,9 @@ use crate::{ kernel_circuit_public_inputs::private_kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, public_call_request::PublicCallRequest, validation_requests::PrivateValidationRequestsBuilder, - }, address::AztecAddress, traits::Empty, + }, + address::AztecAddress, + traits::Empty, }; pub struct PrivateKernelCircuitPublicInputsBuilder { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/public_kernel_circuit_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/public_kernel_circuit_public_inputs.nr index e7134be57c4..7e7921f340e 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/public_kernel_circuit_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/public_kernel_circuit_public_inputs.nr @@ -2,8 +2,11 @@ use crate::{ abis::{ accumulated_data::PublicAccumulatedData, combined_constant_data::CombinedConstantData, public_call_request::PublicCallRequest, validation_requests::PublicValidationRequests, - }, address::AztecAddress, constants::PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH, - traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, + }, + address::AztecAddress, + constants::PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH, + traits::{Deserialize, Empty, Serialize}, + utils::reader::Reader, }; pub struct PublicKernelCircuitPublicInputs { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/public_kernel_circuit_public_inputs_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/public_kernel_circuit_public_inputs_builder.nr index 87d4a1f7e37..f81c736f9bd 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/public_kernel_circuit_public_inputs_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/public_kernel_circuit_public_inputs_builder.nr @@ -5,7 +5,9 @@ use crate::{ kernel_circuit_public_inputs::public_kernel_circuit_public_inputs::PublicKernelCircuitPublicInputs, public_call_request::PublicCallRequest, validation_requests::PublicValidationRequestsBuilder, - }, address::AztecAddress, traits::Empty, + }, + address::AztecAddress, + traits::Empty, }; pub struct PublicKernelCircuitPublicInputsBuilder { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/vm_circuit_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/vm_circuit_public_inputs.nr index 5dd9501d42a..2bfd1cfe59d 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/vm_circuit_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_circuit_public_inputs/vm_circuit_public_inputs.nr @@ -1,11 +1,15 @@ use crate::{ abis::{ accumulated_data::{PublicAccumulatedData, PublicAccumulatedDataArrayLengths}, - combined_constant_data::CombinedConstantData, gas::Gas, - public_call_request::PublicCallRequest, public_inner_call_request::PublicInnerCallRequest, + combined_constant_data::CombinedConstantData, + gas::Gas, + public_call_request::PublicCallRequest, + public_inner_call_request::PublicInnerCallRequest, validation_requests::{PublicValidationRequestArrayLengths, PublicValidationRequests}, - }, constants::{MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, VM_CIRCUIT_PUBLIC_INPUTS_LENGTH}, - traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, + }, + constants::{MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX, VM_CIRCUIT_PUBLIC_INPUTS_LENGTH}, + traits::{Deserialize, Empty, Serialize}, + utils::reader::Reader, }; pub struct VMCircuitPublicInputs { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_data.nr index b44dcb401d5..ba83686a0a8 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/kernel_data.nr @@ -1,9 +1,11 @@ use crate::{ abis::kernel_circuit_public_inputs::KernelCircuitPublicInputs, - constants::{TUBE_INDEX, VK_TREE_HEIGHT}, merkle_tree::membership::check_membership, + constants::{TUBE_INDEX, VK_TREE_HEIGHT}, + merkle_tree::membership::check_membership, recursion::{ proof::NestedRecursiveProof, traits::Verifiable, verification_key::HonkVerificationKey, - }, utils::arrays::find_index_hint, + }, + utils::arrays::find_index_hint, }; pub struct KernelData { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/log_hash.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/log_hash.nr index b35ff5743cc..6969df71a5e 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/log_hash.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/log_hash.nr @@ -1,9 +1,12 @@ use crate::{ - abis::side_effect::{Ordered, OrderedValue, Scoped}, address::AztecAddress, + abis::side_effect::{Ordered, OrderedValue, Scoped}, + address::AztecAddress, constants::{ ENCRYPTED_LOG_HASH_LENGTH, LOG_HASH_LENGTH, NOTE_LOG_HASH_LENGTH, SCOPED_ENCRYPTED_LOG_HASH_LENGTH, SCOPED_LOG_HASH_LENGTH, - }, traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_concat, reader::Reader}, + }, + traits::{Deserialize, Empty, Serialize}, + utils::{arrays::array_concat, reader::Reader}, }; pub struct LogHash { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/note_hash.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/note_hash.nr index f6ab8cd1dba..83063fe84cc 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/note_hash.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/note_hash.nr @@ -1,7 +1,9 @@ use crate::{ abis::{read_request::ScopedReadRequest, side_effect::{Ordered, OrderedValue, Readable, Scoped}}, - address::AztecAddress, constants::{NOTE_HASH_LENGTH, SCOPED_NOTE_HASH_LENGTH}, - traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_concat, reader::Reader}, + address::AztecAddress, + constants::{NOTE_HASH_LENGTH, SCOPED_NOTE_HASH_LENGTH}, + traits::{Deserialize, Empty, Serialize}, + utils::{arrays::array_concat, reader::Reader}, }; pub struct NoteHash { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/note_hash_leaf_preimage.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/note_hash_leaf_preimage.nr index 1c0cedca919..0c8d740f55e 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/note_hash_leaf_preimage.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/note_hash_leaf_preimage.nr @@ -1,8 +1,10 @@ global NOTE_HASH_LEAF_PREIMAGE_LENGTH: u32 = 1; use crate::{ - abis::{read_request::ScopedReadRequest, side_effect::Readable}, hash::compute_siloed_note_hash, - merkle_tree::leaf_preimage::LeafPreimage, traits::Empty, + abis::{read_request::ScopedReadRequest, side_effect::Readable}, + hash::compute_siloed_note_hash, + merkle_tree::leaf_preimage::LeafPreimage, + traits::Empty, }; pub struct NoteHashLeafPreimage { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/nullifier.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/nullifier.nr index ccce9822db2..fdfe8e26425 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/nullifier.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/nullifier.nr @@ -1,7 +1,9 @@ use crate::{ abis::{read_request::ScopedReadRequest, side_effect::{Ordered, OrderedValue, Readable, Scoped}}, - address::AztecAddress, constants::{NULLIFIER_LENGTH, SCOPED_NULLIFIER_LENGTH}, - hash::compute_siloed_nullifier, traits::{Deserialize, Empty, Serialize}, + address::AztecAddress, + constants::{NULLIFIER_LENGTH, SCOPED_NULLIFIER_LENGTH}, + hash::compute_siloed_nullifier, + traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_concat, reader::Reader}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/nullifier_leaf_preimage.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/nullifier_leaf_preimage.nr index cdfcdfb21aa..d9361aa1dec 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/nullifier_leaf_preimage.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/nullifier_leaf_preimage.nr @@ -1,8 +1,10 @@ global NULLIFIER_LEAF_PREIMAGE_LENGTH: u32 = 3; use crate::{ - abis::{read_request::ScopedReadRequest, side_effect::Readable}, hash::compute_siloed_nullifier, - merkle_tree::leaf_preimage::{IndexedTreeLeafPreimage, LeafPreimage}, traits::{Empty, Hash}, + abis::{read_request::ScopedReadRequest, side_effect::Readable}, + hash::compute_siloed_nullifier, + merkle_tree::leaf_preimage::{IndexedTreeLeafPreimage, LeafPreimage}, + traits::{Empty, Hash}, }; pub struct NullifierLeafPreimage { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_call_request.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_call_request.nr index e4014d00fb2..b1585b82e92 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_call_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_call_request.nr @@ -1,6 +1,7 @@ use crate::{ abis::{call_context::CallContext, side_effect::{Ordered, RangeOrdered}}, - constants::PRIVATE_CALL_REQUEST_LENGTH, traits::{Deserialize, Empty, Serialize}, + constants::PRIVATE_CALL_REQUEST_LENGTH, + traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_circuit_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_circuit_public_inputs.nr index 540c741c559..cf1b9b4f8c8 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_circuit_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_circuit_public_inputs.nr @@ -1,9 +1,14 @@ use crate::{ abis::{ - call_context::CallContext, log_hash::{EncryptedLogHash, LogHash, NoteLogHash}, - max_block_number::MaxBlockNumber, note_hash::NoteHash, nullifier::Nullifier, - private_call_request::PrivateCallRequest, public_call_request::PublicCallRequest, - read_request::ReadRequest, validation_requests::KeyValidationRequestAndGenerator, + call_context::CallContext, + log_hash::{EncryptedLogHash, LogHash, NoteLogHash}, + max_block_number::MaxBlockNumber, + note_hash::NoteHash, + nullifier::Nullifier, + private_call_request::PrivateCallRequest, + public_call_request::PublicCallRequest, + read_request::ReadRequest, + validation_requests::KeyValidationRequestAndGenerator, }, constants::{ MAX_ENCRYPTED_LOGS_PER_CALL, MAX_KEY_VALIDATION_REQUESTS_PER_CALL, @@ -12,8 +17,11 @@ use crate::{ MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_NULLIFIERS_PER_CALL, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, MAX_UNENCRYPTED_LOGS_PER_CALL, PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH, - }, header::Header, messaging::l2_to_l1_message::L2ToL1Message, - traits::{Deserialize, Empty, Serialize}, transaction::tx_context::TxContext, + }, + header::Header, + messaging::l2_to_l1_message::L2ToL1Message, + traits::{Deserialize, Empty, Serialize}, + transaction::tx_context::TxContext, utils::{arrays::validate_array, reader::Reader}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel/private_call_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel/private_call_data.nr index 1cf7279ac6c..459aeab8bd2 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel/private_call_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel/private_call_data.nr @@ -2,7 +2,8 @@ use crate::{ abis::private_circuit_public_inputs::PrivateCircuitPublicInputs, address::SaltedInitializationHash, constants::{FUNCTION_TREE_HEIGHT, PROTOCOL_CONTRACT_TREE_HEIGHT}, - merkle_tree::membership::MembershipWitness, public_keys::PublicKeys, + merkle_tree::membership::MembershipWitness, + public_keys::PublicKeys, recursion::verification_key::ClientIVCVerificationKey, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel_data.nr index 813f04794b3..4a8f350de4a 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_kernel_data.nr @@ -2,7 +2,8 @@ use crate::{ abis::kernel_circuit_public_inputs::PrivateKernelCircuitPublicInputs, constants::{PRIVATE_KERNEL_RESET_INDEX, VK_TREE_HEIGHT}, merkle_tree::membership::assert_check_membership, - recursion::verification_key::ClientIVCVerificationKey, utils::arrays::find_index_hint, + recursion::verification_key::ClientIVCVerificationKey, + utils::arrays::find_index_hint, }; pub struct PrivateKernelData { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_call_request.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_call_request.nr index f27a202984a..d8aaf06f80c 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_call_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_call_request.nr @@ -1,6 +1,8 @@ use crate::{ - abis::{call_context::CallContext, side_effect::Ordered}, address::AztecAddress, - constants::PUBLIC_CALL_REQUEST_LENGTH, traits::{Deserialize, Empty, Serialize}, + abis::{call_context::CallContext, side_effect::Ordered}, + address::AztecAddress, + constants::PUBLIC_CALL_REQUEST_LENGTH, + traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_circuit_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_circuit_public_inputs.nr index 7bfaacb5be5..f1171176d09 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_circuit_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_circuit_public_inputs.nr @@ -4,7 +4,8 @@ use crate::{ note_hash::NoteHash, nullifier::Nullifier, public_inner_call_request::PublicInnerCallRequest, read_request::ReadRequest, tree_leaf_read_request::TreeLeafReadRequest, - }, address::AztecAddress, + }, + address::AztecAddress, constants::{ MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_CALL, MAX_L2_TO_L1_MSGS_PER_CALL, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NOTE_HASHES_PER_CALL, @@ -12,9 +13,12 @@ use crate::{ MAX_NULLIFIERS_PER_CALL, MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL, MAX_PUBLIC_DATA_READS_PER_CALL, MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL, MAX_UNENCRYPTED_LOGS_PER_CALL, PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH, - }, contrakt::{storage_read::StorageRead, storage_update_request::StorageUpdateRequest}, - header::Header, messaging::l2_to_l1_message::L2ToL1Message, - traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, + }, + contrakt::{storage_read::StorageRead, storage_update_request::StorageUpdateRequest}, + header::Header, + messaging::l2_to_l1_message::L2ToL1Message, + traits::{Deserialize, Empty, Serialize}, + utils::reader::Reader, }; // Public inputs to public app circuit. diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_read.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_read.nr index 8e088ddc5f1..89427f042c2 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_read.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_read.nr @@ -1,5 +1,7 @@ use crate::{ - abis::side_effect::Ordered, address::AztecAddress, constants::PUBLIC_DATA_READ_LENGTH, + abis::side_effect::Ordered, + address::AztecAddress, + constants::PUBLIC_DATA_READ_LENGTH, contrakt::storage_read::StorageRead, data::hash::{compute_public_data_tree_index, compute_public_data_tree_value}, traits::{Deserialize, Empty, Serialize}, diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_update_request.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_update_request.nr index 1e83aa81e48..6b55882403a 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_update_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_update_request.nr @@ -1,10 +1,13 @@ use crate::{ - abis::side_effect::Ordered, address::AztecAddress, constants::PUBLIC_DATA_UPDATE_REQUEST_LENGTH, + abis::side_effect::Ordered, + address::AztecAddress, + constants::PUBLIC_DATA_UPDATE_REQUEST_LENGTH, contrakt::storage_update_request::StorageUpdateRequest, data::{ hash::{compute_public_data_tree_index, compute_public_data_tree_value}, public_data_tree_leaf::PublicDataTreeLeaf, - }, traits::{Deserialize, Empty, Serialize}, + }, + traits::{Deserialize, Empty, Serialize}, }; // TODO: Rename to PublicDataWrite diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_write.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_write.nr index b829d06d7b4..290c6ca6e31 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_write.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_data_write.nr @@ -1,8 +1,10 @@ use crate::{ abis::{ - public_data_read::PublicDataRead, public_data_update_request::PublicDataUpdateRequest, + public_data_read::PublicDataRead, + public_data_update_request::PublicDataUpdateRequest, side_effect::{Inner, Ordered, Overridable, Readable}, - }, traits::Empty, + }, + traits::Empty, }; pub struct OverridablePublicDataWrite { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_inner_call_request.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_inner_call_request.nr index 00a61e96be9..1535e297904 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_inner_call_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_inner_call_request.nr @@ -1,6 +1,7 @@ use crate::{ abis::{public_call_stack_item_compressed::PublicCallStackItemCompressed, side_effect::Ordered}, - constants::PUBLIC_INNER_CALL_REQUEST_LENGTH, traits::{Deserialize, Empty, Serialize}, + constants::PUBLIC_INNER_CALL_REQUEST_LENGTH, + traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_kernel_data.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_kernel_data.nr index 10853977219..c8e8a15d35e 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_kernel_data.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_kernel_data.nr @@ -1,9 +1,11 @@ use crate::{ abis::kernel_circuit_public_inputs::PublicKernelCircuitPublicInputs, - constants::{TUBE_INDEX, VK_TREE_HEIGHT}, merkle_tree::membership::check_membership, + constants::{TUBE_INDEX, VK_TREE_HEIGHT}, + merkle_tree::membership::check_membership, recursion::{ proof::NestedRecursiveProof, traits::Verifiable, verification_key::HonkVerificationKey, - }, utils::arrays::find_index_hint, + }, + utils::arrays::find_index_hint, }; pub struct PublicKernelData { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/read_request.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/read_request.nr index 41a2740ce56..8191f4ee4dc 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/read_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/read_request.nr @@ -1,7 +1,9 @@ use crate::{ - abis::side_effect::{Ordered, Scoped}, address::AztecAddress, + abis::side_effect::{Ordered, Scoped}, + address::AztecAddress, constants::{READ_REQUEST_LENGTH, SCOPED_READ_REQUEST_LEN}, - traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_concat, reader::Reader}, + traits::{Deserialize, Empty, Serialize}, + utils::{arrays::array_concat, reader::Reader}, }; pub struct ReadRequest { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/key_validation_request_and_generator.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/key_validation_request_and_generator.nr index 3adfc46c9b3..5ae055a5724 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/key_validation_request_and_generator.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/key_validation_request_and_generator.nr @@ -2,8 +2,11 @@ use crate::{ abis::validation_requests::{ key_validation_request::KeyValidationRequest, scoped_key_validation_request_and_generator::ScopedKeyValidationRequestAndGenerator, - }, address::AztecAddress, constants::KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH, - traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_concat, reader::Reader}, + }, + address::AztecAddress, + constants::KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH, + traits::{Deserialize, Empty, Serialize}, + utils::{arrays::array_concat, reader::Reader}, }; pub struct KeyValidationRequestAndGenerator { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/private_validation_requests.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/private_validation_requests.nr index bb407329ceb..f1e6adea10e 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/private_validation_requests.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/private_validation_requests.nr @@ -9,7 +9,9 @@ use crate::{ constants::{ MAX_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, PRIVATE_VALIDATION_REQUESTS_LENGTH, - }, traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, + }, + traits::{Deserialize, Empty, Serialize}, + utils::reader::Reader, }; pub struct PrivateValidationRequests { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/private_validation_requests_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/private_validation_requests_builder.nr index 93630f8005b..1fe0e108e8b 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/private_validation_requests_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/private_validation_requests_builder.nr @@ -1,6 +1,7 @@ use crate::{ abis::{ - max_block_number::MaxBlockNumber, read_request::ScopedReadRequest, + max_block_number::MaxBlockNumber, + read_request::ScopedReadRequest, validation_requests::{ private_validation_requests::PrivateValidationRequests, rollup_validation_requests::RollupValidationRequests, @@ -10,7 +11,8 @@ use crate::{ constants::{ MAX_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, - }, traits::Empty, + }, + traits::Empty, }; pub struct PrivateValidationRequestsBuilder { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/public_validation_requests.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/public_validation_requests.nr index 149b8d6781b..c6d77daadd1 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/public_validation_requests.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/public_validation_requests.nr @@ -9,7 +9,9 @@ use crate::{ MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_PUBLIC_DATA_READS_PER_TX, NUM_PUBLIC_VALIDATION_REQUEST_ARRAYS, PUBLIC_VALIDATION_REQUESTS_LENGTH, - }, traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_length, reader::Reader}, + }, + traits::{Deserialize, Empty, Serialize}, + utils::{arrays::array_length, reader::Reader}, }; pub struct PublicValidationRequests { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/public_validation_requests_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/public_validation_requests_builder.nr index 18ceb1f4e11..b5a45d5faea 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/public_validation_requests_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/public_validation_requests_builder.nr @@ -1,7 +1,9 @@ use crate::{ abis::{ - max_block_number::MaxBlockNumber, public_data_read::PublicDataRead, - read_request::ScopedReadRequest, tree_leaf_read_request::TreeLeafReadRequest, + max_block_number::MaxBlockNumber, + public_data_read::PublicDataRead, + read_request::ScopedReadRequest, + tree_leaf_read_request::TreeLeafReadRequest, validation_requests::{ public_validation_requests::PublicValidationRequests, rollup_validation_requests::RollupValidationRequests, @@ -11,7 +13,9 @@ use crate::{ MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX, MAX_PUBLIC_DATA_READS_PER_TX, - }, traits::Empty, utils::arrays::array_to_bounded_vec, + }, + traits::Empty, + utils::arrays::array_to_bounded_vec, }; pub struct PublicValidationRequestsBuilder { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/rollup_validation_requests.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/rollup_validation_requests.nr index bbfacf3edfd..79ddba32742 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/rollup_validation_requests.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/rollup_validation_requests.nr @@ -1,6 +1,8 @@ use crate::{ - abis::max_block_number::MaxBlockNumber, constants::ROLLUP_VALIDATION_REQUESTS_LENGTH, - traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, + abis::max_block_number::MaxBlockNumber, + constants::ROLLUP_VALIDATION_REQUESTS_LENGTH, + traits::{Deserialize, Empty, Serialize}, + utils::reader::Reader, }; // These are validation requests that cannot be fulfilled in the current context (private or public), and must be diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/scoped_key_validation_request_and_generator.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/scoped_key_validation_request_and_generator.nr index 8329a101b0a..17eda595bc8 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/scoped_key_validation_request_and_generator.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/validation_requests/scoped_key_validation_request_and_generator.nr @@ -2,8 +2,11 @@ use crate::{ abis::{ side_effect::Scoped, validation_requests::key_validation_request_and_generator::KeyValidationRequestAndGenerator, - }, address::AztecAddress, constants::SCOPED_KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH, - traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_concat, reader::Reader}, + }, + address::AztecAddress, + constants::SCOPED_KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH, + traits::{Deserialize, Empty, Serialize}, + utils::{arrays::array_concat, reader::Reader}, }; pub struct ScopedKeyValidationRequestAndGenerator { 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 bec16175bdb..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,25 +1,27 @@ 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, - traits::{Deserialize, Empty, FromField, Serialize, ToField}, utils, + public_keys::{IvpkM, NpkM, OvpkM, PublicKeys, ToPoint, TpkM}, + traits::{Deserialize, Empty, FromField, Serialize, ToField}, + utils, }; // We do below because `use crate::point::Point;` does not work 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-projects/noir-protocol-circuits/crates/types/src/address/partial_address.nr b/noir-projects/noir-protocol-circuits/crates/types/src/address/partial_address.nr index e13e08c196f..e44ff45d7d5 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/address/partial_address.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/address/partial_address.nr @@ -1,7 +1,9 @@ use crate::{ address::{aztec_address::AztecAddress, salted_initialization_hash::SaltedInitializationHash}, - constants::GENERATOR_INDEX__PARTIAL_ADDRESS, contract_class_id::ContractClassId, - hash::poseidon2_hash_with_separator, traits::{Deserialize, Serialize, ToField}, + constants::GENERATOR_INDEX__PARTIAL_ADDRESS, + contract_class_id::ContractClassId, + hash::poseidon2_hash_with_separator, + traits::{Deserialize, Serialize, ToField}, }; global PARTIAL_ADDRESS_LENGTH: u32 = 1; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/contract_instance.nr b/noir-projects/noir-protocol-circuits/crates/types/src/contract_instance.nr index 319b3820dac..dfc372b2037 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/contract_instance.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/contract_instance.nr @@ -2,8 +2,11 @@ use crate::{ address::{ aztec_address::AztecAddress, partial_address::PartialAddress, public_keys_hash::PublicKeysHash, - }, constants::CONTRACT_INSTANCE_LENGTH, contract_class_id::ContractClassId, - public_keys::PublicKeys, traits::{Deserialize, Hash, Serialize}, + }, + constants::CONTRACT_INSTANCE_LENGTH, + contract_class_id::ContractClassId, + public_keys::PublicKeys, + traits::{Deserialize, Hash, Serialize}, }; pub struct ContractInstance { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/contrakt/storage_update_request.nr b/noir-projects/noir-protocol-circuits/crates/types/src/contrakt/storage_update_request.nr index 37cb287f5d2..d9a8071a605 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/contrakt/storage_update_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/contrakt/storage_update_request.nr @@ -1,5 +1,6 @@ use crate::{ - constants::CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH, traits::{Deserialize, Empty, Serialize}, + constants::CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH, + traits::{Deserialize, Empty, Serialize}, }; pub struct StorageUpdateRequest { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/data/public_data_hint.nr b/noir-projects/noir-protocol-circuits/crates/types/src/data/public_data_hint.nr index 7726b63ef89..6adec664620 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/data/public_data_hint.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/data/public_data_hint.nr @@ -1,7 +1,8 @@ use crate::{ constants::PUBLIC_DATA_TREE_HEIGHT, data::public_data_tree_leaf_preimage::PublicDataTreeLeafPreimage, - merkle_tree::{conditionally_assert_check_membership, MembershipWitness}, traits::Empty, + merkle_tree::{conditionally_assert_check_membership, MembershipWitness}, + traits::Empty, }; pub struct PublicDataHint { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/data/public_data_tree_leaf.nr b/noir-projects/noir-protocol-circuits/crates/types/src/data/public_data_tree_leaf.nr index 07c2fd40a6d..64f02300c9e 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/data/public_data_tree_leaf.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/data/public_data_tree_leaf.nr @@ -1,5 +1,6 @@ use crate::{ - abis::{public_data_read::PublicDataRead, side_effect::{Overridable, Readable}}, traits::Empty, + abis::{public_data_read::PublicDataRead, side_effect::{Overridable, Readable}}, + traits::Empty, }; pub struct PublicDataTreeLeaf { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/hash.nr b/noir-projects/noir-protocol-circuits/crates/types/src/hash.nr index 61b746598b6..7ceb2ba0b6e 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/hash.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/hash.nr @@ -2,16 +2,20 @@ use crate::{ abis::{ contract_class_function_leaf_preimage::ContractClassFunctionLeafPreimage, function_selector::FunctionSelector, - log_hash::{LogHash, ScopedEncryptedLogHash, ScopedLogHash}, note_hash::ScopedNoteHash, + log_hash::{LogHash, ScopedEncryptedLogHash, ScopedLogHash}, + note_hash::ScopedNoteHash, nullifier::ScopedNullifier, - }, address::{AztecAddress, EthAddress}, + }, + address::{AztecAddress, EthAddress}, constants::{ FUNCTION_TREE_HEIGHT, GENERATOR_INDEX__NOTE_HASH_NONCE, GENERATOR_INDEX__OUTER_NULLIFIER, GENERATOR_INDEX__SILOED_NOTE_HASH, GENERATOR_INDEX__UNIQUE_NOTE_HASH, GENERATOR_INDEX__VK, MAX_ENCRYPTED_LOGS_PER_TX, MAX_NOTE_ENCRYPTED_LOGS_PER_TX, - }, merkle_tree::root::root_from_sibling_path, + }, + merkle_tree::root::root_from_sibling_path, messaging::l2_to_l1_message::{L2ToL1Message, ScopedL2ToL1Message}, - recursion::verification_key::VerificationKey, traits::{is_empty, ToField}, + recursion::verification_key::VerificationKey, + traits::{is_empty, ToField}, utils::field::field_from_bytes_32_trunc, }; use super::utils::field::field_from_bytes; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/header.nr b/noir-projects/noir-protocol-circuits/crates/types/src/header.nr index 62ce52d86b0..fa4a57da32b 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/header.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/header.nr @@ -6,8 +6,11 @@ use crate::{ constants::{ CONTENT_COMMITMENT_LENGTH, GENERATOR_INDEX__BLOCK_HASH, GLOBAL_VARIABLES_LENGTH, HEADER_LENGTH, STATE_REFERENCE_LENGTH, - }, content_commitment::ContentCommitment, hash::poseidon2_hash_with_separator, - state_reference::StateReference, traits::{Deserialize, Empty, Hash, Serialize}, + }, + content_commitment::ContentCommitment, + hash::poseidon2_hash_with_separator, + state_reference::StateReference, + traits::{Deserialize, Empty, Hash, Serialize}, utils::arr_copy_slice, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/merkle_tree/indexed_tree.nr b/noir-projects/noir-protocol-circuits/crates/types/src/merkle_tree/indexed_tree.nr index 5ca42b3ac56..1a12382093b 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/merkle_tree/indexed_tree.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/merkle_tree/indexed_tree.nr @@ -5,7 +5,9 @@ use crate::{ merkle_tree::{ membership::{assert_check_membership, MembershipWitness}, root::{calculate_empty_tree_root, calculate_subtree_root, root_from_sibling_path}, - }, traits::{Empty, Hash, is_empty}, utils::arrays::check_permutation, + }, + traits::{Empty, Hash, is_empty}, + utils::arrays::check_permutation, }; pub fn batch_insert( diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/merkle_tree/membership.nr b/noir-projects/noir-protocol-circuits/crates/types/src/merkle_tree/membership.nr index f428a8d3549..1d3815dde9a 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/merkle_tree/membership.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/merkle_tree/membership.nr @@ -2,7 +2,8 @@ use crate::{ merkle_tree::{ indexed_tree::check_valid_low_leaf::assert_check_valid_low_leaf, leaf_preimage::IndexedTreeLeafPreimage, root::root_from_sibling_path, - }, traits::Empty, + }, + traits::Empty, }; pub struct MembershipWitness { @@ -89,7 +90,8 @@ mod tests { assert_check_membership, assert_check_non_membership, check_membership, conditionally_assert_check_membership, MembershipWitness, }, - }, tests::merkle_tree_utils::NonEmptyMerkleTree, + }, + tests::merkle_tree_utils::NonEmptyMerkleTree, }; use std::hash::pedersen_hash; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/messaging/l2_to_l1_message.nr b/noir-projects/noir-protocol-circuits/crates/types/src/messaging/l2_to_l1_message.nr index b0e226dc587..b3de63f26b0 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/messaging/l2_to_l1_message.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/messaging/l2_to_l1_message.nr @@ -1,7 +1,9 @@ use crate::{ - abis::side_effect::{Ordered, Scoped}, address::{AztecAddress, EthAddress}, + abis::side_effect::{Ordered, Scoped}, + address::{AztecAddress, EthAddress}, constants::{L2_TO_L1_MESSAGE_LENGTH, SCOPED_L2_TO_L1_MESSAGE_LENGTH}, - traits::{Deserialize, Empty, Serialize}, utils::{arrays::array_concat, reader::Reader}, + traits::{Deserialize, Empty, Serialize}, + utils::{arrays::array_concat, reader::Reader}, }; // Note: Not to be confused with L2ToL1Msg in Solidity diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/partial_state_reference.nr b/noir-projects/noir-protocol-circuits/crates/types/src/partial_state_reference.nr index 0384aa58b94..b85b9b3e328 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/partial_state_reference.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/partial_state_reference.nr @@ -1,6 +1,7 @@ use crate::{ abis::append_only_tree_snapshot::AppendOnlyTreeSnapshot, - constants::PARTIAL_STATE_REFERENCE_LENGTH, traits::{Deserialize, Empty, Serialize}, + constants::PARTIAL_STATE_REFERENCE_LENGTH, + traits::{Deserialize, Empty, Serialize}, }; pub struct PartialStateReference { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/public_keys.nr b/noir-projects/noir-protocol-circuits/crates/types/src/public_keys.nr index a22a2e29c6b..94fae081b85 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/public_keys.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/public_keys.nr @@ -3,7 +3,9 @@ use crate::{ constants::{ DEFAULT_IVPK_M_X, DEFAULT_IVPK_M_Y, DEFAULT_NPK_M_X, DEFAULT_NPK_M_Y, DEFAULT_OVPK_M_X, DEFAULT_OVPK_M_Y, DEFAULT_TPK_M_X, DEFAULT_TPK_M_Y, GENERATOR_INDEX__PUBLIC_KEYS_HASH, - }, hash::poseidon2_hash_with_separator, point::POINT_LENGTH, + }, + hash::poseidon2_hash_with_separator, + point::POINT_LENGTH, traits::{Deserialize, Hash, Serialize}, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/recursion/verification_key.nr b/noir-projects/noir-protocol-circuits/crates/types/src/recursion/verification_key.nr index 9aa057d9dab..a11b7852902 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/recursion/verification_key.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/recursion/verification_key.nr @@ -1,7 +1,8 @@ use crate::{ constants::{ CLIENT_IVC_VERIFICATION_KEY_LENGTH_IN_FIELDS, HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS, - }, traits::{Deserialize, Empty, Serialize}, + }, + traits::{Deserialize, Empty, Serialize}, }; pub struct VerificationKey { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/state_reference.nr b/noir-projects/noir-protocol-circuits/crates/types/src/state_reference.nr index 9c9b0bdf98f..c2ac4b58123 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/state_reference.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/state_reference.nr @@ -1,7 +1,8 @@ use crate::{ abis::append_only_tree_snapshot::{APPEND_ONLY_TREE_SNAPSHOT_LENGTH, AppendOnlyTreeSnapshot}, constants::{PARTIAL_STATE_REFERENCE_LENGTH, STATE_REFERENCE_LENGTH}, - partial_state_reference::PartialStateReference, traits::{Deserialize, Empty, Serialize}, + partial_state_reference::PartialStateReference, + traits::{Deserialize, Empty, Serialize}, utils::arr_copy_slice, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixture_builder.nr b/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixture_builder.nr index 14494cb7bd4..3b121da821c 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixture_builder.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixture_builder.nr @@ -3,31 +3,44 @@ use crate::{ accumulated_data::{ CombinedAccumulatedData, PrivateAccumulatedData, PrivateAccumulatedDataBuilder, PublicAccumulatedData, PublicAccumulatedDataArrayLengths, PublicAccumulatedDataBuilder, - }, call_context::CallContext, combined_constant_data::CombinedConstantData, - enqueued_call_data::{EnqueuedCallData, Proof}, function_data::FunctionData, - function_selector::FunctionSelector, gas::Gas, gas_settings::GasSettings, + }, + call_context::CallContext, + combined_constant_data::CombinedConstantData, + enqueued_call_data::{EnqueuedCallData, Proof}, + function_data::FunctionData, + function_selector::FunctionSelector, + gas::Gas, + gas_settings::GasSettings, global_variables::GlobalVariables, kernel_circuit_public_inputs::{ KernelCircuitPublicInputs, PrivateKernelCircuitPublicInputs, PublicKernelCircuitPublicInputs, VMCircuitPublicInputs, - }, kernel_data::KernelData, + }, + kernel_data::KernelData, log_hash::{EncryptedLogHash, LogHash, NoteLogHash, ScopedEncryptedLogHash, ScopedLogHash}, - max_block_number::MaxBlockNumber, note_hash::{NoteHash, ScopedNoteHash}, - nullifier::{Nullifier, ScopedNullifier}, private_call_request::PrivateCallRequest, + max_block_number::MaxBlockNumber, + note_hash::{NoteHash, ScopedNoteHash}, + nullifier::{Nullifier, ScopedNullifier}, + private_call_request::PrivateCallRequest, private_circuit_public_inputs::PrivateCircuitPublicInputs, - private_kernel::private_call_data::PrivateCallData, private_kernel_data::PrivateKernelData, + private_kernel::private_call_data::PrivateCallData, + private_kernel_data::PrivateKernelData, public_call_data::{Proof as PublicCallDataProof, PublicCallData}, public_call_request::PublicCallRequest, - public_circuit_public_inputs::PublicCircuitPublicInputs, public_data_read::PublicDataRead, + public_circuit_public_inputs::PublicCircuitPublicInputs, + public_data_read::PublicDataRead, public_data_update_request::PublicDataUpdateRequest, - public_inner_call_request::PublicInnerCallRequest, public_kernel_data::PublicKernelData, - read_request::{ReadRequest, ScopedReadRequest}, tree_leaf_read_request::TreeLeafReadRequest, + public_inner_call_request::PublicInnerCallRequest, + public_kernel_data::PublicKernelData, + read_request::{ReadRequest, ScopedReadRequest}, + tree_leaf_read_request::TreeLeafReadRequest, validation_requests::{ KeyValidationRequest, KeyValidationRequestAndGenerator, PrivateValidationRequests, PublicValidationRequestArrayLengths, PublicValidationRequests, RollupValidationRequests, ScopedKeyValidationRequestAndGenerator, }, - }, address::{AztecAddress, EthAddress, PublicKeysHash, SaltedInitializationHash}, + }, + address::{AztecAddress, EthAddress, PublicKeysHash, SaltedInitializationHash}, constants::{ FUNCTION_TREE_HEIGHT, MAX_ENCRYPTED_LOGS_PER_TX, MAX_FIELD_VALUE, MAX_KEY_VALIDATION_REQUESTS_PER_TX, MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_TX, @@ -40,24 +53,33 @@ use crate::{ MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, MAX_UNENCRYPTED_LOGS_PER_TX, PRIVATE_CALL_REQUEST_LENGTH, PROTOCOL_CONTRACT_TREE_HEIGHT, PUBLIC_CALL_REQUEST_LENGTH, VK_TREE_HEIGHT, - }, contrakt::{storage_read::StorageRead, storage_update_request::StorageUpdateRequest}, + }, + contrakt::{storage_read::StorageRead, storage_update_request::StorageUpdateRequest}, hash::{ compute_l2_to_l1_hash, compute_siloed_nullifier, compute_tx_logs_hash, mask_encrypted_log_hash, silo_note_hash, silo_unencrypted_log_hash, - }, header::Header, merkle_tree::{membership::MembershipWitness, MerkleTree}, + }, + header::Header, + merkle_tree::{membership::MembershipWitness, MerkleTree}, messaging::l2_to_l1_message::{L2ToL1Message, ScopedL2ToL1Message}, - partial_state_reference::PartialStateReference, point::Point, public_keys::PublicKeys, + partial_state_reference::PartialStateReference, + point::Point, + public_keys::PublicKeys, recursion::{ proof::NestedRecursiveProof, verification_key::{ClientIVCVerificationKey, HonkVerificationKey, VerificationKey}, }, tests::fixtures::{ - self, contract_functions::ContractFunction, contracts::ContractData, + self, + contract_functions::ContractFunction, + contracts::ContractData, vk_tree::{ generate_fake_client_ivc_vk_for_index, generate_fake_honk_vk_for_index, get_vk_merkle_tree, VK_TREE_WIDTH, }, - }, traits::Empty, transaction::{tx_context::TxContext, tx_request::TxRequest}, + }, + traits::Empty, + transaction::{tx_context::TxContext, tx_request::TxRequest}, }; fn subarray(arr: [T; N]) -> [T; M] { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/contracts.nr b/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/contracts.nr index 5e26fb5575f..462bc8fc975 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/contracts.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/tests/fixtures/contracts.nr @@ -1,7 +1,9 @@ use crate::{ address::{AztecAddress, PartialAddress, PublicKeysHash, SaltedInitializationHash}, - contract_class_id::ContractClassId, hash::private_functions_root_from_siblings, - public_keys::PublicKeys, tests::fixtures::contract_functions::get_protocol_contract_function, + contract_class_id::ContractClassId, + hash::private_functions_root_from_siblings, + public_keys::PublicKeys, + tests::fixtures::contract_functions::get_protocol_contract_function, }; pub struct ContractData { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/tests/merkle_tree_utils.nr b/noir-projects/noir-protocol-circuits/crates/types/src/tests/merkle_tree_utils.nr index 9bb0cf86ac3..b4ff548be02 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/tests/merkle_tree_utils.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/tests/merkle_tree_utils.nr @@ -1,5 +1,6 @@ use crate::{ - hash::merkle_hash, merkle_tree::{calculate_empty_tree_root, merkle_tree, MerkleTree}, + hash::merkle_hash, + merkle_tree::{calculate_empty_tree_root, merkle_tree, MerkleTree}, traits::Empty, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/transaction/tx_context.nr b/noir-projects/noir-protocol-circuits/crates/types/src/transaction/tx_context.nr index 254e7602cfc..25de53247cf 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/transaction/tx_context.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/transaction/tx_context.nr @@ -1,6 +1,8 @@ use crate::{ - abis::gas_settings::GasSettings, constants::TX_CONTEXT_LENGTH, - traits::{Deserialize, Empty, Serialize}, utils::reader::Reader, + abis::gas_settings::GasSettings, + constants::TX_CONTEXT_LENGTH, + traits::{Deserialize, Empty, Serialize}, + utils::reader::Reader, }; // docs:start:tx-context diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/transaction/tx_request.nr b/noir-projects/noir-protocol-circuits/crates/types/src/transaction/tx_request.nr index 0dc45c48ffd..e8f743548db 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/transaction/tx_request.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/transaction/tx_request.nr @@ -1,8 +1,11 @@ use crate::{ - abis::function_data::FunctionData, address::AztecAddress, + abis::function_data::FunctionData, + address::AztecAddress, constants::{GENERATOR_INDEX__TX_REQUEST, TX_REQUEST_LENGTH}, - hash::poseidon2_hash_with_separator, traits::{Deserialize, Empty, Hash, Serialize}, - transaction::tx_context::TxContext, utils::reader::Reader, + hash::poseidon2_hash_with_separator, + traits::{Deserialize, Empty, Hash, Serialize}, + transaction::tx_context::TxContext, + utils::reader::Reader, }; pub struct TxRequest { @@ -75,7 +78,9 @@ mod tests { abis::{ function_data::FunctionData, function_selector::FunctionSelector, gas::Gas, gas_fees::GasFees, gas_settings::GasSettings, - }, address::AztecAddress, transaction::{tx_context::TxContext, tx_request::TxRequest}, + }, + address::AztecAddress, + transaction::{tx_context::TxContext, tx_request::TxRequest}, }; #[test] diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_array_appended.nr b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_array_appended.nr index 1377ada4486..8142b69c430 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_array_appended.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_array_appended.nr @@ -1,5 +1,7 @@ use crate::{ - abis::side_effect::Scoped, address::aztec_address::AztecAddress, traits::{Empty, is_empty}, + abis::side_effect::Scoped, + address::aztec_address::AztecAddress, + traits::{Empty, is_empty}, }; pub fn assert_array_appended( diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_combined_sorted_transformed_value_array.nr b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_combined_sorted_transformed_value_array.nr index af0387c7710..cac15101a86 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_combined_sorted_transformed_value_array.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_combined_sorted_transformed_value_array.nr @@ -1,7 +1,8 @@ mod get_combined_order_hints; use crate::{ - abis::side_effect::Ordered, traits::{Empty, is_empty}, + abis::side_effect::Ordered, + traits::{Empty, is_empty}, utils::arrays::{ array_length, assert_combined_sorted_transformed_value_array::get_combined_order_hints::{ @@ -100,14 +101,16 @@ mod tests { tests::{ types::{ combine_two_values, is_combined_from_two_values, TestCombinedValue, TestTwoValues, - }, utils::pad_end, + }, + utils::pad_end, }, utils::arrays::{ array_merge, assert_combined_sorted_transformed_value_array::{ assert_combined_sorted_transformed_value_array_asc, get_combined_order_hints::{CombinedOrderHint, get_combined_order_hints_asc}, - }, sort_by_counter::sort_by_counter_asc, + }, + sort_by_counter::sort_by_counter_asc, }, }; diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_combined_sorted_transformed_value_array/get_combined_order_hints.nr b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_combined_sorted_transformed_value_array/get_combined_order_hints.nr index f63e5bfbbdc..ac62b93bd14 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_combined_sorted_transformed_value_array/get_combined_order_hints.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_combined_sorted_transformed_value_array/get_combined_order_hints.nr @@ -1,5 +1,6 @@ use crate::{ - abis::side_effect::Ordered, traits::{Empty, is_empty}, + abis::side_effect::Ordered, + traits::{Empty, is_empty}, utils::arrays::{ array_length, get_sorted_tuple::get_sorted_tuple, sort_by_counter::compare_by_counter_empty_padded_asc, diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_deduped_array.nr b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_deduped_array.nr index 17460434e88..af7e9c4bdac 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_deduped_array.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_deduped_array.nr @@ -39,8 +39,10 @@ where mod tests { use crate::{ - abis::side_effect::{Inner, Overridable}, tests::{types::TestValue, utils::pad_end}, - traits::Empty, utils::arrays::assert_deduped_array::{assert_deduped_array, dedupe_array}, + abis::side_effect::{Inner, Overridable}, + tests::{types::TestValue, utils::pad_end}, + traits::Empty, + utils::arrays::assert_deduped_array::{assert_deduped_array, dedupe_array}, }; struct TestItem { diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_exposed_sorted_transformed_value_array.nr b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_exposed_sorted_transformed_value_array.nr index 40f0072676e..eba9fe575a2 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_exposed_sorted_transformed_value_array.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_exposed_sorted_transformed_value_array.nr @@ -1,7 +1,8 @@ mod get_order_hints; use crate::{ - abis::side_effect::Ordered, traits::{Empty, is_empty}, + abis::side_effect::Ordered, + traits::{Empty, is_empty}, utils::arrays::{ array_length, assert_exposed_sorted_transformed_value_array::get_order_hints::OrderHint, }, diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_exposed_sorted_transformed_value_array/get_order_hints.nr b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_exposed_sorted_transformed_value_array/get_order_hints.nr index d9e61497371..145df154174 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_exposed_sorted_transformed_value_array/get_order_hints.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_exposed_sorted_transformed_value_array/get_order_hints.nr @@ -1,5 +1,6 @@ use crate::{ - abis::side_effect::Ordered, traits::Empty, + abis::side_effect::Ordered, + traits::Empty, utils::arrays::{ get_sorted_tuple::get_sorted_tuple, sort_by_counter::{ diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_split_sorted_transformed_value_arrays.nr b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_split_sorted_transformed_value_arrays.nr index d5d058e54ea..36cc3b3d07c 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_split_sorted_transformed_value_arrays.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_split_sorted_transformed_value_arrays.nr @@ -1,7 +1,8 @@ mod get_split_order_hints; use crate::{ - abis::side_effect::Ordered, traits::Empty, + abis::side_effect::Ordered, + traits::Empty, utils::arrays::{ array_length, assert_split_sorted_transformed_value_arrays::get_split_order_hints::SplitOrderHints, diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_split_sorted_transformed_value_arrays/get_split_order_hints.nr b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_split_sorted_transformed_value_arrays/get_split_order_hints.nr index 19a1514599e..2a330cc2fe2 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_split_sorted_transformed_value_arrays/get_split_order_hints.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/utils/arrays/assert_split_sorted_transformed_value_arrays/get_split_order_hints.nr @@ -1,5 +1,6 @@ use crate::{ - abis::side_effect::Ordered, traits::{Empty, is_empty}, + abis::side_effect::Ordered, + traits::{Empty, is_empty}, utils::arrays::{ get_sorted_tuple::get_sorted_tuple, sort_by_counter::{ From 4c373ecb6600fcfb55227b6b5a1d960dcfe4c515 Mon Sep 17 00:00:00 2001 From: Tom French Date: Fri, 25 Oct 2024 11:37:20 +0100 Subject: [PATCH 4/4] . --- .../contracts/avm_test_contract/src/main.nr | 10 +++---- .../nft_contract/src/test/access_control.nr | 2 +- .../nft_contract/src/test/minting.nr | 4 +-- .../src/test/transfer_in_private.nr | 16 ++++++------ .../src/test/transfer_in_public.nr | 14 +++++----- .../src/test/transfer_to_private.nr | 8 +++--- .../src/test/transfer_to_public.nr | 14 +++++----- .../contracts/test_contract/src/main.nr | 6 ++--- .../token_contract/src/test/access_control.nr | 2 +- .../contracts/token_contract/src/test/burn.nr | 26 +++++++++---------- .../token_contract/src/test/minting.nr | 16 ++++++------ .../src/test/reading_constants.nr | 4 +-- .../token_contract/src/test/shielding.nr | 14 +++++----- .../src/test/transfer_private.nr | 18 ++++++------- .../src/test/transfer_public.nr | 16 ++++++------ .../token_contract/src/test/unshielding.nr | 14 +++++----- 16 files changed, 92 insertions(+), 92 deletions(-) diff --git a/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr index 870c967c0b1..ee524904896 100644 --- a/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/avm_test_contract/src/main.nr @@ -210,7 +210,7 @@ contract AvmTest { #[public] fn to_radix_le(input: Field) -> [u8; 10] { - input.to_le_radix(/*base=*/ 2) + input.to_le_radix( /*base=*/ 2) } // Helper functions to demonstrate an internal call stack in error messages @@ -284,7 +284,7 @@ contract AvmTest { #[public] fn pedersen_hash_with_index(data: [Field; 10]) -> Field { - std::hash::pedersen_hash_with_separator(data, /*index=*/ 20) + std::hash::pedersen_hash_with_separator(data, /*index=*/ 20) } /************************************************************************ @@ -404,11 +404,11 @@ contract AvmTest { #[public] fn emit_unencrypted_log() { - context.emit_unencrypted_log(/*message=*/ [10, 20, 30]); - context.emit_unencrypted_log(/*message=*/ "Hello, world!"); + context.emit_unencrypted_log( /*message=*/ [10, 20, 30]); + context.emit_unencrypted_log( /*message=*/ "Hello, world!"); let s: CompressedString<2, 44> = CompressedString::from_string("A long time ago, in a galaxy far far away..."); - context.emit_unencrypted_log(/*message=*/ s); + context.emit_unencrypted_log( /*message=*/ s); } #[public] diff --git a/noir-projects/noir-contracts/contracts/nft_contract/src/test/access_control.nr b/noir-projects/noir-contracts/contracts/nft_contract/src/test/access_control.nr index 42373942d78..fef5a236372 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/test/access_control.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/test/access_control.nr @@ -5,7 +5,7 @@ use crate::test::utils; unconstrained fn access_control() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, owner, recipient) = - utils::setup(/* with_account_contracts */ false); + utils::setup( /* with_account_contracts */ false); // Set a new admin NFT::at(nft_contract_address).set_admin(recipient).call(&mut env.public()); diff --git a/noir-projects/noir-contracts/contracts/nft_contract/src/test/minting.nr b/noir-projects/noir-contracts/contracts/nft_contract/src/test/minting.nr index 5302e0e397d..cc9d12e24dd 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/test/minting.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/test/minting.nr @@ -4,7 +4,7 @@ use crate::test::utils; #[test] unconstrained fn mint_success() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough - let (env, nft_contract_address, owner, _) = utils::setup(/* with_account_contracts */ false); + let (env, nft_contract_address, owner, _) = utils::setup( /* with_account_contracts */ false); let token_id = 10000; NFT::at(nft_contract_address).mint(owner, token_id).call(&mut env.public()); @@ -16,7 +16,7 @@ unconstrained fn mint_success() { unconstrained fn mint_failures() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, owner, recipient) = - utils::setup(/* with_account_contracts */ false); + utils::setup( /* with_account_contracts */ false); // MINTING AS A NON-MINTER let token_id = 10000; diff --git a/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_in_private.nr b/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_in_private.nr index b6b07566bc9..63022cc57a0 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_in_private.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_in_private.nr @@ -8,7 +8,7 @@ use aztec::oracle::random::random; unconstrained fn transfer_in_private() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ false); + utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ false); // Transfer the NFT to the recipient NFT::at(nft_contract_address).transfer_in_private(sender, recipient, token_id, 0).call( @@ -23,7 +23,7 @@ unconstrained fn transfer_in_private() { unconstrained fn transfer_in_private_to_self() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, owner, _, token_id) = - utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ false); + utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ false); // Transfer the NFT back to the owner NFT::at(nft_contract_address).transfer_in_private(owner, owner, token_id, 0).call( @@ -38,7 +38,7 @@ unconstrained fn transfer_in_private_to_self() { unconstrained fn transfer_in_private_to_non_deployed_account() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, sender, _, token_id) = - utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ false); + utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ false); let not_deployed = cheatcodes::create_account(); // Transfer the NFT to the recipient @@ -54,7 +54,7 @@ unconstrained fn transfer_in_private_to_non_deployed_account() { unconstrained fn transfer_in_private_on_behalf_of_other() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ true); + utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ true); // Transfer the NFT to the recipient let transfer_in_private_call_interface = @@ -78,7 +78,7 @@ unconstrained fn transfer_in_private_on_behalf_of_other() { unconstrained fn transfer_in_private_failure_not_an_owner() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, owner, not_owner, token_id) = - utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ false); + utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ false); // Try transferring the NFT from not_owner env.impersonate(not_owner); NFT::at(nft_contract_address).transfer_in_private(not_owner, owner, token_id, 0).call( @@ -92,7 +92,7 @@ unconstrained fn transfer_in_private_failure_on_behalf_of_self_non_zero_nonce() // The nonce check is in the beginning so we don't need to waste time on minting the NFT and transferring // it to private. let (env, nft_contract_address, sender, recipient) = - utils::setup(/* with_account_contracts */ false); + utils::setup( /* with_account_contracts */ false); // We set random value for the token_id as the nonce check is before we use the value. let token_id = random(); @@ -109,7 +109,7 @@ unconstrained fn transfer_in_private_failure_on_behalf_of_other_without_approval // The authwit check is in the beginning so we don't need to waste time on minting the NFT and transferring // it to private. let (env, nft_contract_address, sender, recipient) = - utils::setup(/* with_account_contracts */ true); + utils::setup( /* with_account_contracts */ true); // We set random value for the token_id as the nonce check is before we use the value. let token_id = random(); @@ -128,7 +128,7 @@ unconstrained fn transfer_in_private_failure_on_behalf_of_other_wrong_caller() { // The authwit check is in the beginning so we don't need to waste time on minting the NFT and transferring // it to private. let (env, nft_contract_address, sender, recipient) = - utils::setup(/* with_account_contracts */ true); + utils::setup( /* with_account_contracts */ true); // We set random value for the token_id as the nonce check is before we use the value. let token_id = random(); diff --git a/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_in_public.nr b/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_in_public.nr index f02d84202a7..d64c5180461 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_in_public.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_in_public.nr @@ -7,7 +7,7 @@ use dep::aztec::oracle::random::random; unconstrained fn transfer_in_public() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); // Transfer the NFT NFT::at(nft_contract_address).transfer_in_public(sender, recipient, token_id, 0).call( @@ -21,7 +21,7 @@ unconstrained fn transfer_in_public() { unconstrained fn transfer_in_public_to_self() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, user, _, token_id) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); // Transfer the NFT NFT::at(nft_contract_address).transfer_in_public(user, user, token_id, 0).call(&mut env.public()); @@ -34,7 +34,7 @@ unconstrained fn transfer_in_public_to_self() { unconstrained fn transfer_in_public_on_behalf_of_other() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); let transfer_in_public_from_call_interface = NFT::at(nft_contract_address).transfer_in_public(sender, recipient, token_id, 1); @@ -58,7 +58,7 @@ unconstrained fn transfer_in_public_failure_on_behalf_of_self_non_zero_nonce() { // The authwit check is in the beginning so we don't need to waste time on minting the NFT and transferring // it to private.. let (env, nft_contract_address, sender, recipient) = - utils::setup(/* with_account_contracts */ false); + utils::setup( /* with_account_contracts */ false); // We set random value for the token_id as the nonce check is before we use the value. let token_id = random(); @@ -73,7 +73,7 @@ unconstrained fn transfer_in_public_failure_on_behalf_of_self_non_zero_nonce() { unconstrained fn transfer_in_public_non_existent_nft() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, sender, recipient) = - utils::setup(/* with_account_contracts */ false); + utils::setup( /* with_account_contracts */ false); // Try to transfer the NFT let token_id = 612; @@ -86,7 +86,7 @@ unconstrained fn transfer_in_public_non_existent_nft() { unconstrained fn transfer_in_public_failure_on_behalf_of_other_without_approval() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); // Impersonate recipient to perform the call env.impersonate(recipient); @@ -100,7 +100,7 @@ unconstrained fn transfer_in_public_failure_on_behalf_of_other_without_approval( unconstrained fn transfer_in_public_failure_on_behalf_of_other_wrong_caller() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); let transfer_in_public_from_call_interface = NFT::at(nft_contract_address).transfer_in_public(sender, recipient, token_id, 1); authwit_cheatcodes::add_public_authwit_from_call_interface( diff --git a/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_private.nr b/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_private.nr index 21e109704a7..e70b66e8ab6 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_private.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_private.nr @@ -17,7 +17,7 @@ unconstrained fn transfer_to_private_internal_orchestration() { // in this test we just call it and check the outcome. // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, user, _, token_id) = - utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ false); + utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ false); // User should have the note in their private nfts utils::assert_owns_private_nft(nft_contract_address, user, token_id); @@ -32,7 +32,7 @@ unconstrained fn transfer_to_private_internal_orchestration() { unconstrained fn transfer_to_private_external_orchestration() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, _, recipient, token_id) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); let note_randomness = random(); @@ -77,7 +77,7 @@ unconstrained fn transfer_to_private_external_orchestration() { unconstrained fn transfer_to_private_transfer_not_prepared() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, _, _, token_id) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); // Transfer was not prepared so we can use random value for the hiding point slot let hiding_point_slot = random(); @@ -92,7 +92,7 @@ unconstrained fn transfer_to_private_transfer_not_prepared() { unconstrained fn transfer_to_private_failure_not_an_owner() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, _, not_owner, token_id) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); // (For this specific test we could set a random value for the commitment and not do the call to `prepare...` // as the NFT owner check is before we use the value but that would made the test less robust against changes diff --git a/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_public.nr b/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_public.nr index 83f3690a5dd..0dbec15b255 100644 --- a/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_public.nr +++ b/noir-projects/noir-contracts/contracts/nft_contract/src/test/transfer_to_public.nr @@ -7,7 +7,7 @@ use dep::aztec::oracle::random::random; unconstrained fn transfer_to_public() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ false); + utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ false); NFT::at(nft_contract_address).transfer_to_public(sender, recipient, token_id, 0).call( &mut env.private(), @@ -21,7 +21,7 @@ unconstrained fn transfer_to_public() { unconstrained fn transfer_to_public_to_self() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, user, _, token_id) = - utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ false); + utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ false); NFT::at(nft_contract_address).transfer_to_public(user, user, token_id, 0).call( &mut env.private(), @@ -34,7 +34,7 @@ unconstrained fn transfer_to_public_to_self() { #[test] unconstrained fn transfer_to_public_on_behalf_of_other() { let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ true); + utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ true); let transfer_to_public_call_interface = NFT::at(nft_contract_address).transfer_to_public(sender, recipient, token_id, 0); @@ -56,7 +56,7 @@ unconstrained fn transfer_to_public_on_behalf_of_other() { unconstrained fn transfer_to_public_failure_not_an_owner() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, _, not_owner, token_id) = - utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ false); + utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ false); env.impersonate(not_owner); NFT::at(nft_contract_address).transfer_to_public(not_owner, not_owner, token_id, 0).call( @@ -68,7 +68,7 @@ unconstrained fn transfer_to_public_failure_not_an_owner() { unconstrained fn transfer_to_public_failure_on_behalf_of_self_non_zero_nonce() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, nft_contract_address, user, _, token_id) = - utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ false); + utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ false); NFT::at(nft_contract_address).transfer_to_public(user, user, token_id, random()).call( &mut env.private(), @@ -78,7 +78,7 @@ unconstrained fn transfer_to_public_failure_on_behalf_of_self_non_zero_nonce() { #[test(should_fail_with = "Authorization not found for message hash")] unconstrained fn transfer_to_public_failure_on_behalf_of_other_invalid_designated_caller() { let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ true); + utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ true); let transfer_to_public_call_interface = NFT::at(nft_contract_address).transfer_to_public(sender, recipient, token_id, 0); @@ -96,7 +96,7 @@ unconstrained fn transfer_to_public_failure_on_behalf_of_other_invalid_designate #[test(should_fail_with = "Authorization not found for message hash")] unconstrained fn transfer_to_public_failure_on_behalf_of_other_no_approval() { let (env, nft_contract_address, sender, recipient, token_id) = - utils::setup_mint_and_transfer_to_private(/* with_account_contracts */ true); + utils::setup_mint_and_transfer_to_private( /* with_account_contracts */ true); // Impersonate recipient env.impersonate(recipient); diff --git a/noir-projects/noir-contracts/contracts/test_contract/src/main.nr b/noir-projects/noir-contracts/contracts/test_contract/src/main.nr index 82e254ef37b..c19a1a63ecd 100644 --- a/noir-projects/noir-contracts/contracts/test_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/test_contract/src/main.nr @@ -368,9 +368,9 @@ contract Test { #[public] fn emit_unencrypted(value: Field) { // docs:start:emit_unencrypted - context.emit_unencrypted_log(/*message=*/ value); - context.emit_unencrypted_log(/*message=*/ [10, 20, 30]); - context.emit_unencrypted_log(/*message=*/ "Hello, world!"); + context.emit_unencrypted_log( /*message=*/ value); + context.emit_unencrypted_log( /*message=*/ [10, 20, 30]); + context.emit_unencrypted_log( /*message=*/ "Hello, world!"); // docs:end:emit_unencrypted } diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/test/access_control.nr b/noir-projects/noir-contracts/contracts/token_contract/src/test/access_control.nr index aafe621f498..9cb547b237d 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/test/access_control.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/test/access_control.nr @@ -5,7 +5,7 @@ use crate::Token; unconstrained fn access_control() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient) = - utils::setup(/* with_account_contracts */ false); + utils::setup( /* with_account_contracts */ false); // Set a new admin Token::at(token_contract_address).set_admin(recipient).call(&mut env.public()); diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/test/burn.nr b/noir-projects/noir-contracts/contracts/token_contract/src/test/burn.nr index daa91a0d26c..3fbf1d73c64 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/test/burn.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/test/burn.nr @@ -6,7 +6,7 @@ use dep::aztec::oracle::random::random; #[test] unconstrained fn burn_public_success() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); let burn_amount = mint_amount / 10; // Burn less than balance @@ -17,7 +17,7 @@ unconstrained fn burn_public_success() { #[test] unconstrained fn burn_public_on_behalf_of_other() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); let burn_amount = mint_amount / 10; // Burn on behalf of other @@ -38,7 +38,7 @@ unconstrained fn burn_public_on_behalf_of_other() { #[test(should_fail_with = "attempt to subtract with underflow")] unconstrained fn burn_public_failure_more_than_balance() { let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); // Burn more than balance let burn_amount = mint_amount * 10; @@ -49,7 +49,7 @@ unconstrained fn burn_public_failure_more_than_balance() { #[test(should_fail_with = "invalid nonce")] unconstrained fn burn_public_failure_on_behalf_of_self_non_zero_nonce() { let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); // Burn on behalf of self with non-zero nonce let burn_amount = mint_amount / 10; @@ -62,7 +62,7 @@ unconstrained fn burn_public_failure_on_behalf_of_self_non_zero_nonce() { #[test(should_fail_with = "unauthorized")] unconstrained fn burn_public_failure_on_behalf_of_other_without_approval() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); // Burn on behalf of other without approval let burn_amount = mint_amount / 10; @@ -76,7 +76,7 @@ unconstrained fn burn_public_failure_on_behalf_of_other_without_approval() { #[test(should_fail_with = "unauthorized")] unconstrained fn burn_public_failure_on_behalf_of_other_wrong_caller() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); // Burn on behalf of other, wrong designated caller let burn_amount = mint_amount / 10; @@ -91,7 +91,7 @@ unconstrained fn burn_public_failure_on_behalf_of_other_wrong_caller() { #[test] unconstrained fn burn_private_on_behalf_of_self() { let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); let burn_amount = mint_amount / 10; // Burn less than balance @@ -102,7 +102,7 @@ unconstrained fn burn_private_on_behalf_of_self() { #[test] unconstrained fn burn_private_on_behalf_of_other() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); let burn_amount = mint_amount / 10; // Burn on behalf of other @@ -122,7 +122,7 @@ unconstrained fn burn_private_on_behalf_of_other() { #[test(should_fail_with = "Balance too low")] unconstrained fn burn_private_failure_more_than_balance() { let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); // Burn more than balance let burn_amount = mint_amount * 10; @@ -132,7 +132,7 @@ unconstrained fn burn_private_failure_more_than_balance() { #[test(should_fail_with = "invalid nonce")] unconstrained fn burn_private_failure_on_behalf_of_self_non_zero_nonce() { let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); // Burn more than balance let burn_amount = mint_amount / 10; @@ -142,7 +142,7 @@ unconstrained fn burn_private_failure_on_behalf_of_self_non_zero_nonce() { #[test(should_fail_with = "Balance too low")] unconstrained fn burn_private_failure_on_behalf_of_other_more_than_balance() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); // Burn more than balance let burn_amount = mint_amount * 10; @@ -161,7 +161,7 @@ unconstrained fn burn_private_failure_on_behalf_of_other_more_than_balance() { #[test(should_fail_with = "Authorization not found for message hash")] unconstrained fn burn_private_failure_on_behalf_of_other_without_approval() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); // Burn more than balance let burn_amount = mint_amount / 10; @@ -175,7 +175,7 @@ unconstrained fn burn_private_failure_on_behalf_of_other_without_approval() { #[test(should_fail_with = "Authorization not found for message hash")] unconstrained fn burn_private_failure_on_behalf_of_other_wrong_designated_caller() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); // Burn more than balance let burn_amount = mint_amount / 10; diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/test/minting.nr b/noir-projects/noir-contracts/contracts/token_contract/src/test/minting.nr index 6d2b21207ae..fb894336bd5 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/test/minting.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/test/minting.nr @@ -5,7 +5,7 @@ use dep::aztec::{hash::compute_secret_hash, oracle::random::random, test::helper #[test] unconstrained fn mint_public_success() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough - let (env, token_contract_address, owner, _) = utils::setup(/* with_account_contracts */ false); + let (env, token_contract_address, owner, _) = utils::setup( /* with_account_contracts */ false); let mint_amount = 10000; Token::at(token_contract_address).mint_public(owner, mint_amount).call(&mut env.public()); @@ -20,7 +20,7 @@ unconstrained fn mint_public_success() { unconstrained fn mint_public_failures() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient) = - utils::setup(/* with_account_contracts */ false); + utils::setup( /* with_account_contracts */ false); // As non-minter let mint_amount = 10000; @@ -60,7 +60,7 @@ unconstrained fn mint_public_failures() { #[test] unconstrained fn mint_private_success() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough - let (env, token_contract_address, owner, _) = utils::setup(/* with_account_contracts */ false); + let (env, token_contract_address, owner, _) = utils::setup( /* with_account_contracts */ false); let mint_amount = 10000; // Mint some tokens let secret = random(); @@ -91,7 +91,7 @@ unconstrained fn mint_private_success() { unconstrained fn mint_private_failure_double_spend() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient) = - utils::setup(/* with_account_contracts */ false); + utils::setup( /* with_account_contracts */ false); let mint_amount = 10000; // Mint some tokens let secret = random(); @@ -127,7 +127,7 @@ unconstrained fn mint_private_failure_double_spend() { unconstrained fn mint_private_failure_non_minter() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, _, recipient) = - utils::setup(/* with_account_contracts */ false); + utils::setup( /* with_account_contracts */ false); let mint_amount = 10000; // Try to mint some tokens impersonating recipient env.impersonate(recipient); @@ -140,7 +140,7 @@ unconstrained fn mint_private_failure_non_minter() { #[test(should_fail_with = "call to assert_max_bit_size")] unconstrained fn mint_private_failure_overflow() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough - let (env, token_contract_address, _, _) = utils::setup(/* with_account_contracts */ false); + let (env, token_contract_address, _, _) = utils::setup( /* with_account_contracts */ false); // Overflow recipient let mint_amount = 2.pow_32(128); @@ -152,7 +152,7 @@ unconstrained fn mint_private_failure_overflow() { #[test(should_fail_with = "attempt to add with overflow")] unconstrained fn mint_private_failure_overflow_recipient() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough - let (env, token_contract_address, owner, _) = utils::setup(/* with_account_contracts */ false); + let (env, token_contract_address, owner, _) = utils::setup( /* with_account_contracts */ false); let mint_amount = 10000; // Mint some tokens let secret = random(); @@ -186,7 +186,7 @@ unconstrained fn mint_private_failure_overflow_recipient() { unconstrained fn mint_private_failure_overflow_total_supply() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient) = - utils::setup(/* with_account_contracts */ false); + utils::setup( /* with_account_contracts */ false); let mint_amount = 10000; // Mint some tokens let secret_owner = random(); diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/test/reading_constants.nr b/noir-projects/noir-contracts/contracts/token_contract/src/test/reading_constants.nr index af3583f5f25..6081e27ae4c 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/test/reading_constants.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/test/reading_constants.nr @@ -7,7 +7,7 @@ use dep::aztec::test::helpers::cheatcodes; #[test] unconstrained fn check_decimals_private() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough - let (env, token_contract_address, _, _) = utils::setup(/* with_account_contracts */ false); + let (env, token_contract_address, _, _) = utils::setup( /* with_account_contracts */ false); // Check decimals let result = Token::at(token_contract_address).private_get_decimals().view(&mut env.private()); @@ -18,7 +18,7 @@ unconstrained fn check_decimals_private() { #[test] unconstrained fn check_decimals_public() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough - let (env, token_contract_address, _, _) = utils::setup(/* with_account_contracts */ false); + let (env, token_contract_address, _, _) = utils::setup( /* with_account_contracts */ false); // Check decimals let result = Token::at(token_contract_address).public_get_decimals().view(&mut env.public()); diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/test/shielding.nr b/noir-projects/noir-contracts/contracts/token_contract/src/test/shielding.nr index a4b5832e579..ed49a1807d4 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/test/shielding.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/test/shielding.nr @@ -7,7 +7,7 @@ use dep::aztec::{hash::compute_secret_hash, oracle::random::random}; unconstrained fn shielding_on_behalf_of_self() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); let secret = random(); let secret_hash = compute_secret_hash(secret); // Shield tokens @@ -36,7 +36,7 @@ unconstrained fn shielding_on_behalf_of_self() { #[test] unconstrained fn shielding_on_behalf_of_other() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); let secret = random(); let secret_hash = compute_secret_hash(secret); @@ -77,7 +77,7 @@ unconstrained fn shielding_on_behalf_of_other() { unconstrained fn shielding_failure_on_behalf_of_self_more_than_balance() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); let secret = random(); let secret_hash = compute_secret_hash(secret); // Shield tokens @@ -95,7 +95,7 @@ unconstrained fn shielding_failure_on_behalf_of_self_more_than_balance() { unconstrained fn shielding_failure_on_behalf_of_self_invalid_nonce() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); let secret = random(); let secret_hash = compute_secret_hash(secret); // Shield tokens @@ -113,7 +113,7 @@ unconstrained fn shielding_failure_on_behalf_of_self_invalid_nonce() { unconstrained fn shielding_failure_on_behalf_of_other_more_than_balance() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); let secret = random(); let secret_hash = compute_secret_hash(secret); // Shield tokens on behalf of owner @@ -139,7 +139,7 @@ unconstrained fn shielding_failure_on_behalf_of_other_more_than_balance() { unconstrained fn shielding_failure_on_behalf_of_other_wrong_caller() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); let secret = random(); let secret_hash = compute_secret_hash(secret); // Shield tokens on behalf of owner @@ -161,7 +161,7 @@ unconstrained fn shielding_failure_on_behalf_of_other_wrong_caller() { unconstrained fn shielding_failure_on_behalf_of_other_without_approval() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); let secret = random(); let secret_hash = compute_secret_hash(secret); // Shield tokens on behalf of owner diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/test/transfer_private.nr b/noir-projects/noir-contracts/contracts/token_contract/src/test/transfer_private.nr index 66d6d13bd0e..8e606030d1c 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/test/transfer_private.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/test/transfer_private.nr @@ -7,7 +7,7 @@ use dep::aztec::test::helpers::cheatcodes; unconstrained fn transfer_private() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); // docs:start:txe_test_transfer_private // Transfer tokens @@ -23,7 +23,7 @@ unconstrained fn transfer_private() { unconstrained fn transfer_private_to_self() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); // Transfer tokens let transfer_amount = 1000; Token::at(token_contract_address).transfer(owner, transfer_amount).call(&mut env.private()); @@ -36,7 +36,7 @@ unconstrained fn transfer_private_to_self() { unconstrained fn transfer_private_to_non_deployed_account() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); let not_deployed = cheatcodes::create_account(); // Transfer tokens let transfer_amount = 1000; @@ -57,7 +57,7 @@ unconstrained fn transfer_private_to_non_deployed_account() { unconstrained fn transfer_private_on_behalf_of_other() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); // Add authwit // docs:start:private_authwit let transfer_amount = 1000; @@ -82,7 +82,7 @@ unconstrained fn transfer_private_on_behalf_of_other() { unconstrained fn transfer_private_failure_more_than_balance() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, _, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); // Transfer tokens let transfer_amount = mint_amount + 1; Token::at(token_contract_address).transfer(recipient, transfer_amount).call(&mut env.private()); @@ -93,7 +93,7 @@ unconstrained fn transfer_private_failure_more_than_balance() { unconstrained fn transfer_private_failure_on_behalf_of_self_non_zero_nonce() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient, _) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); // Add authwit let transfer_amount = 1000; let transfer_private_from_call_interface = @@ -112,7 +112,7 @@ unconstrained fn transfer_private_failure_on_behalf_of_self_non_zero_nonce() { unconstrained fn transfer_private_failure_on_behalf_of_more_than_balance() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); // Add authwit let transfer_amount = mint_amount + 1; let transfer_private_from_call_interface = @@ -132,7 +132,7 @@ unconstrained fn transfer_private_failure_on_behalf_of_more_than_balance() { unconstrained fn transfer_private_failure_on_behalf_of_other_without_approval() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, token_contract_address, owner, recipient, _) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); // Add authwit let transfer_amount = 1000; let transfer_private_from_call_interface = @@ -147,7 +147,7 @@ unconstrained fn transfer_private_failure_on_behalf_of_other_without_approval() unconstrained fn transfer_private_failure_on_behalf_of_other_wrong_caller() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, token_contract_address, owner, recipient, _) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); // Add authwit let transfer_amount = 1000; let transfer_private_from_call_interface = diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/test/transfer_public.nr b/noir-projects/noir-contracts/contracts/token_contract/src/test/transfer_public.nr index 72a6eb3f029..829fd1a31a6 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/test/transfer_public.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/test/transfer_public.nr @@ -7,7 +7,7 @@ use dep::aztec::oracle::random::random; unconstrained fn public_transfer() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); // Transfer tokens let transfer_amount = mint_amount / 10; Token::at(token_contract_address).transfer_public(owner, recipient, transfer_amount, 0).call( @@ -23,7 +23,7 @@ unconstrained fn public_transfer() { unconstrained fn public_transfer_to_self() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); // Transfer tokens let transfer_amount = mint_amount / 10; // docs:start:call_public @@ -39,7 +39,7 @@ unconstrained fn public_transfer_to_self() { unconstrained fn public_transfer_on_behalf_of_other() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); let transfer_amount = mint_amount / 10; let public_transfer_from_call_interface = Token::at(token_contract_address).transfer_public(owner, recipient, transfer_amount, 1); @@ -61,7 +61,7 @@ unconstrained fn public_transfer_on_behalf_of_other() { unconstrained fn public_transfer_failure_more_than_balance() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); // Transfer tokens let transfer_amount = mint_amount + 1; let public_transfer_call_interface = @@ -74,7 +74,7 @@ unconstrained fn public_transfer_failure_more_than_balance() { unconstrained fn public_transfer_failure_on_behalf_of_self_non_zero_nonce() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); // Transfer tokens let transfer_amount = mint_amount / 10; let public_transfer_call_interface = Token::at(token_contract_address).transfer_public( @@ -96,7 +96,7 @@ unconstrained fn public_transfer_failure_on_behalf_of_self_non_zero_nonce() { unconstrained fn public_transfer_failure_on_behalf_of_other_without_approval() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); let transfer_amount = mint_amount / 10; let public_transfer_from_call_interface = Token::at(token_contract_address).transfer_public(owner, recipient, transfer_amount, 1); @@ -110,7 +110,7 @@ unconstrained fn public_transfer_failure_on_behalf_of_other_without_approval() { unconstrained fn public_transfer_failure_on_behalf_of_other_more_than_balance() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); let transfer_amount = mint_amount + 1; // docs:start:public_authwit let public_transfer_from_call_interface = @@ -131,7 +131,7 @@ unconstrained fn public_transfer_failure_on_behalf_of_other_more_than_balance() unconstrained fn public_transfer_failure_on_behalf_of_other_wrong_caller() { // Setup with account contracts. Slower since we actually deploy them, but needed for authwits. let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); let transfer_amount = mint_amount / 10; let public_transfer_from_call_interface = Token::at(token_contract_address).transfer_public(owner, recipient, transfer_amount, 1); diff --git a/noir-projects/noir-contracts/contracts/token_contract/src/test/unshielding.nr b/noir-projects/noir-contracts/contracts/token_contract/src/test/unshielding.nr index ffe3e55b89c..60350ca624b 100644 --- a/noir-projects/noir-contracts/contracts/token_contract/src/test/unshielding.nr +++ b/noir-projects/noir-contracts/contracts/token_contract/src/test/unshielding.nr @@ -7,7 +7,7 @@ use dep::aztec::oracle::random::random; unconstrained fn unshield_on_behalf_of_self() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); let unshield_amount = mint_amount / 10; Token::at(token_contract_address).unshield(owner, owner, unshield_amount, 0).call( @@ -20,7 +20,7 @@ unconstrained fn unshield_on_behalf_of_self() { #[test] unconstrained fn unshield_on_behalf_of_other() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); let unshield_amount = mint_amount / 10; let unshield_call_interface = @@ -42,7 +42,7 @@ unconstrained fn unshield_on_behalf_of_other() { unconstrained fn unshield_failure_more_than_balance() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); let unshield_amount = mint_amount + 1; Token::at(token_contract_address).unshield(owner, owner, unshield_amount, 0).call( @@ -54,7 +54,7 @@ unconstrained fn unshield_failure_more_than_balance() { unconstrained fn unshield_failure_on_behalf_of_self_non_zero_nonce() { // Setup without account contracts. We are not using authwits here, so dummy accounts are enough let (env, token_contract_address, owner, _, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ false); + utils::setup_and_mint( /* with_account_contracts */ false); let unshield_amount = mint_amount + 1; Token::at(token_contract_address).unshield(owner, owner, unshield_amount, random()).call( @@ -65,7 +65,7 @@ unconstrained fn unshield_failure_on_behalf_of_self_non_zero_nonce() { #[test(should_fail_with = "Balance too low")] unconstrained fn unshield_failure_on_behalf_of_other_more_than_balance() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); let unshield_amount = mint_amount + 1; let unshield_call_interface = @@ -84,7 +84,7 @@ unconstrained fn unshield_failure_on_behalf_of_other_more_than_balance() { #[test(should_fail_with = "Authorization not found for message hash")] unconstrained fn unshield_failure_on_behalf_of_other_invalid_designated_caller() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); let unshield_amount = mint_amount + 1; let unshield_call_interface = @@ -103,7 +103,7 @@ unconstrained fn unshield_failure_on_behalf_of_other_invalid_designated_caller() #[test(should_fail_with = "Authorization not found for message hash")] unconstrained fn unshield_failure_on_behalf_of_other_no_approval() { let (env, token_contract_address, owner, recipient, mint_amount) = - utils::setup_and_mint(/* with_account_contracts */ true); + utils::setup_and_mint( /* with_account_contracts */ true); let unshield_amount = mint_amount + 1; let unshield_call_interface =