Skip to content

Commit

Permalink
789 housekeeping (#790)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
jeanmon and dbanks12 authored Jun 9, 2023
1 parent f22b675 commit a0683ff
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 49 deletions.
15 changes: 4 additions & 11 deletions circuits/cpp/src/aztec3/circuits/apps/.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T> struct SpecialisedTypes {
using mapping = MappingStateVar<C, T>;
using utxo = UTXOStateVar<C, T>;
using utxo_set = UTXOSetStateVar<C, T>;
};

template <typename V> using Mapping = typename SpecialisedTypes<V>::mapping;

template <typename Note> using UTXO = typename SpecialisedTypes<Note>::utxo;
template <typename Note> using UTXOSet = typename SpecialisedTypes<Note>::utxo_set;
// Get rid of ugly `Composer` template arg from our state var types:
template <typename V> using Mapping = MappingStateVar<C, V>;
template <typename Note> using UTXO = UTXOStateVar<C, Note>;
template <typename Note> using UTXOSet = UTXOSetStateVar<C, Note>;

using Field = FieldStateVar<C>;
} // namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T> struct SpecialisedTypes {
using mapping = MappingStateVar<C, T>;
using utxo_set = UTXOSetStateVar<C, T>;
};

template <typename V> using Mapping = typename SpecialisedTypes<V>::mapping;
template <typename Note> using UTXOSet = typename SpecialisedTypes<Note>::utxo_set;
// Get rid of ugly `Composer` template arg from our state var types:
template <typename V> using Mapping = MappingStateVar<C, V>;
template <typename Note> using UTXOSet = UTXOSetStateVar<C, Note>;

using DefaultNote = apps::notes::DefaultPrivateNote<C, CT::fr>;

Expand Down
11 changes: 3 additions & 8 deletions circuits/cpp/src/aztec3/circuits/apps/test_apps/escrow/init.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T> struct SpecialisedTypes {
using mapping = MappingStateVar<C, T>;
using utxo_set = UTXOSetStateVar<C, T>;
};

template <typename V> using Mapping = typename SpecialisedTypes<V>::mapping;
template <typename Note> using UTXOSet = typename SpecialisedTypes<Note>::utxo_set;
// Get rid of ugly `Composer` template arg from our state var types:
template <typename V> using Mapping = MappingStateVar<C, V>;
template <typename Note> using UTXOSet = UTXOSetStateVar<C, Note>;

using DefaultNote = apps::notes::DefaultPrivateNote<C, CT::fr>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T> struct SpecialisedTypes {
using utxo = UTXOStateVar<C, T>;
};

template <typename Note> using UTXO = typename SpecialisedTypes<Note>::utxo;
// Get rid of ugly `Composer` template arg from our state var types:
template <typename Note> using UTXO = UTXOStateVar<C, Note>;

using Note = apps::notes::DefaultSingletonPrivateNote<C, CT::fr>;

Expand Down
1 change: 0 additions & 1 deletion circuits/cpp/src/aztec3/circuits/hash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "aztec3/constants.hpp"
#include "aztec3/utils/circuit_errors.hpp"

#include "barretenberg/common/throw_or_abort.hpp"
#include <barretenberg/barretenberg.hpp>

#include <array>
Expand Down
4 changes: 0 additions & 4 deletions circuits/cpp/src/aztec3/circuits/kernel/private/c_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <barretenberg/common/test.hpp>
#include <barretenberg/barretenberg.hpp>

#include <gtest/gtest.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <barretenberg/common/map.hpp>
#include <barretenberg/stdlib/merkle_tree/membership.hpp>
#include <barretenberg/barretenberg.hpp>

namespace aztec3::circuits::kernel::private_kernel::testing_harness {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
#include "aztec3/circuits/hash.hpp"
#include "aztec3/circuits/kernel/private/utils.hpp"

#include <barretenberg/common/map.hpp>
#include <barretenberg/stdlib/merkle_tree/membership.hpp>

#include <barretenberg/barretenberg.hpp>

namespace {

Expand Down
1 change: 0 additions & 1 deletion circuits/cpp/src/aztec3/utils/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include "aztec3/utils/circuit_errors.hpp"

#include "barretenberg/proof_system/types/composer_type.hpp"
#include <barretenberg/barretenberg.hpp>

/**
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a0683ff

Please sign in to comment.