From a0683ffb0a4aa09a24d041d2a37fd470758d917a Mon Sep 17 00:00:00 2001 From: Jean M <132435771+jeanmon@users.noreply.github.com> Date: Fri, 9 Jun 2023 19:36:40 +0200 Subject: [PATCH] 789 housekeeping (#790) * 789: remove struct typedefs kind of idioms * Include barretenberg header using angle bracket and not double quote * Remove barretenberg headers which are not barretenberg.hpp * Remove obsolete comment * Fix yarn issue --------- Co-authored-by: David Banks <47112877+dbanks12@users.noreply.github.com> --- circuits/cpp/src/aztec3/circuits/apps/.test.cpp | 15 ++++----------- .../test_apps/basic_contract_deployment/init.hpp | 11 +++-------- .../circuits/apps/test_apps/escrow/init.hpp | 11 +++-------- .../private_to_private_function_call/init.hpp | 8 ++------ circuits/cpp/src/aztec3/circuits/hash.hpp | 1 - .../src/aztec3/circuits/kernel/private/c_bind.cpp | 4 ---- .../native_private_kernel_circuit.test.cpp | 4 +--- .../circuits/kernel/private/testing_harness.cpp | 4 +--- .../circuits/kernel/private/testing_harness.hpp | 4 +--- circuits/cpp/src/aztec3/utils/array.hpp | 1 - yarn-project/yarn.lock | 2 +- 11 files changed, 16 insertions(+), 49 deletions(-) diff --git a/circuits/cpp/src/aztec3/circuits/apps/.test.cpp b/circuits/cpp/src/aztec3/circuits/apps/.test.cpp index a486fe4da8b..8f60b0eed1c 100644 --- a/circuits/cpp/src/aztec3/circuits/apps/.test.cpp +++ b/circuits/cpp/src/aztec3/circuits/apps/.test.cpp @@ -55,17 +55,10 @@ using aztec3::circuits::apps::notes::DefaultPrivateNote; using aztec3::circuits::apps::notes::DefaultSingletonPrivateNote; // State variables -// Get rid of ugle `Composer` template arg from our state var types: -template struct SpecialisedTypes { - using mapping = MappingStateVar; - using utxo = UTXOStateVar; - using utxo_set = UTXOSetStateVar; -}; - -template using Mapping = typename SpecialisedTypes::mapping; - -template using UTXO = typename SpecialisedTypes::utxo; -template using UTXOSet = typename SpecialisedTypes::utxo_set; +// Get rid of ugly `Composer` template arg from our state var types: +template using Mapping = MappingStateVar; +template using UTXO = UTXOStateVar; +template using UTXOSet = UTXOSetStateVar; using Field = FieldStateVar; } // namespace diff --git a/circuits/cpp/src/aztec3/circuits/apps/test_apps/basic_contract_deployment/init.hpp b/circuits/cpp/src/aztec3/circuits/apps/test_apps/basic_contract_deployment/init.hpp index e3ae322d1f2..d24db87213d 100644 --- a/circuits/cpp/src/aztec3/circuits/apps/test_apps/basic_contract_deployment/init.hpp +++ b/circuits/cpp/src/aztec3/circuits/apps/test_apps/basic_contract_deployment/init.hpp @@ -34,14 +34,9 @@ using aztec3::utils::types::to_ct; using apps::state_vars::MappingStateVar; using apps::state_vars::UTXOSetStateVar; -// Get rid of ugle `Composer` template arg from our state var types: -template struct SpecialisedTypes { - using mapping = MappingStateVar; - using utxo_set = UTXOSetStateVar; -}; - -template using Mapping = typename SpecialisedTypes::mapping; -template using UTXOSet = typename SpecialisedTypes::utxo_set; +// Get rid of ugly `Composer` template arg from our state var types: +template using Mapping = MappingStateVar; +template using UTXOSet = UTXOSetStateVar; using DefaultNote = apps::notes::DefaultPrivateNote; diff --git a/circuits/cpp/src/aztec3/circuits/apps/test_apps/escrow/init.hpp b/circuits/cpp/src/aztec3/circuits/apps/test_apps/escrow/init.hpp index b4af4a00540..757b8e5e49e 100644 --- a/circuits/cpp/src/aztec3/circuits/apps/test_apps/escrow/init.hpp +++ b/circuits/cpp/src/aztec3/circuits/apps/test_apps/escrow/init.hpp @@ -34,14 +34,9 @@ using aztec3::utils::types::to_ct; using apps::state_vars::MappingStateVar; using apps::state_vars::UTXOSetStateVar; -// Get rid of ugle `Composer` template arg from our state var types: -template struct SpecialisedTypes { - using mapping = MappingStateVar; - using utxo_set = UTXOSetStateVar; -}; - -template using Mapping = typename SpecialisedTypes::mapping; -template using UTXOSet = typename SpecialisedTypes::utxo_set; +// Get rid of ugly `Composer` template arg from our state var types: +template using Mapping = MappingStateVar; +template using UTXOSet = UTXOSetStateVar; using DefaultNote = apps::notes::DefaultPrivateNote; diff --git a/circuits/cpp/src/aztec3/circuits/apps/test_apps/private_to_private_function_call/init.hpp b/circuits/cpp/src/aztec3/circuits/apps/test_apps/private_to_private_function_call/init.hpp index 44816fcbc2e..26712cc998e 100644 --- a/circuits/cpp/src/aztec3/circuits/apps/test_apps/private_to_private_function_call/init.hpp +++ b/circuits/cpp/src/aztec3/circuits/apps/test_apps/private_to_private_function_call/init.hpp @@ -32,12 +32,8 @@ using aztec3::utils::types::to_ct; // StateVars using apps::state_vars::UTXOStateVar; -// Get rid of ugle `Composer` template arg from our state var types: -template struct SpecialisedTypes { - using utxo = UTXOStateVar; -}; - -template using UTXO = typename SpecialisedTypes::utxo; +// Get rid of ugly `Composer` template arg from our state var types: +template using UTXO = UTXOStateVar; using Note = apps::notes::DefaultSingletonPrivateNote; diff --git a/circuits/cpp/src/aztec3/circuits/hash.hpp b/circuits/cpp/src/aztec3/circuits/hash.hpp index 414e3cd5e6f..7fe0f5f31c6 100644 --- a/circuits/cpp/src/aztec3/circuits/hash.hpp +++ b/circuits/cpp/src/aztec3/circuits/hash.hpp @@ -6,7 +6,6 @@ #include "aztec3/constants.hpp" #include "aztec3/utils/circuit_errors.hpp" -#include "barretenberg/common/throw_or_abort.hpp" #include #include diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/c_bind.cpp b/circuits/cpp/src/aztec3/circuits/kernel/private/c_bind.cpp index 96c3764c55a..8a9bbe2fc9d 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/c_bind.cpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/c_bind.cpp @@ -58,10 +58,6 @@ WASM_EXPORT size_t private_kernel__init_verification_key(uint8_t const* pk_buf, CBIND(private_kernel__dummy_previous_kernel, []() { return dummy_previous_kernel(); }); - -// TODO(jeanmon) We will need two versions of this one to expose to ts. -// First let us try to get it compiled with one function (the inner one). - // TODO(dbanks12): comment about how public_inputs is a confusing name // returns size of public inputs WASM_EXPORT uint8_t* private_kernel__sim_init(uint8_t const* signed_tx_request_buf, diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit.test.cpp b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit.test.cpp index 74e56424e26..6f8cfa487de 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit.test.cpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit.test.cpp @@ -5,9 +5,7 @@ #include "aztec3/circuits/apps/test_apps/escrow/deposit.hpp" #include "aztec3/utils/circuit_errors.hpp" -#include "barretenberg/numeric/random/engine.hpp" -#include "barretenberg/serialize/test_helper.hpp" -#include +#include #include diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/testing_harness.cpp b/circuits/cpp/src/aztec3/circuits/kernel/private/testing_harness.cpp index af02e32c8e9..1ed43fbd214 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/testing_harness.cpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/testing_harness.cpp @@ -23,9 +23,7 @@ #include "aztec3/circuits/hash.hpp" #include "aztec3/circuits/kernel/private/utils.hpp" -#include "barretenberg/plonk/proof_system/prover/prover.hpp" -#include -#include +#include namespace aztec3::circuits::kernel::private_kernel::testing_harness { diff --git a/circuits/cpp/src/aztec3/circuits/kernel/private/testing_harness.hpp b/circuits/cpp/src/aztec3/circuits/kernel/private/testing_harness.hpp index f3b4dc0a535..36c5f7f10c0 100644 --- a/circuits/cpp/src/aztec3/circuits/kernel/private/testing_harness.hpp +++ b/circuits/cpp/src/aztec3/circuits/kernel/private/testing_harness.hpp @@ -10,9 +10,7 @@ #include "aztec3/circuits/hash.hpp" #include "aztec3/circuits/kernel/private/utils.hpp" -#include -#include - +#include namespace { diff --git a/circuits/cpp/src/aztec3/utils/array.hpp b/circuits/cpp/src/aztec3/utils/array.hpp index 92b2eb0725c..7d8ec6f350e 100644 --- a/circuits/cpp/src/aztec3/utils/array.hpp +++ b/circuits/cpp/src/aztec3/utils/array.hpp @@ -3,7 +3,6 @@ #include "aztec3/utils/circuit_errors.hpp" -#include "barretenberg/proof_system/types/composer_type.hpp" #include /** diff --git a/yarn-project/yarn.lock b/yarn-project/yarn.lock index 3d64822481a..68b1fb3c669 100644 --- a/yarn-project/yarn.lock +++ b/yarn-project/yarn.lock @@ -183,7 +183,6 @@ __metadata: "@rushstack/eslint-patch": ^1.1.4 "@types/jest": ^29.5.0 "@types/node": ^18.7.23 - browserify-cipher: ^1.0.1 jest: ^29.5.0 jest-mock-extended: ^3.0.3 sha3: ^2.1.4 @@ -642,6 +641,7 @@ __metadata: "@types/lodash.clonedeep": ^4.5.7 "@types/lodash.times": ^4.3.7 "@types/node": ^18.7.23 + browserify-cipher: ^1.0.1 jest: ^29.5.0 jest-mock-extended: ^3.0.3 lodash.clonedeep: ^4.5.0