Skip to content

Commit

Permalink
chore: Little cpp style improvements (#4528)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanmon committed Feb 9, 2024
1 parent e58eda8 commit dcc9ba4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
#include "barretenberg/proof_system/circuit_builder/generated/AvmMini_circuit_builder.hpp"
#include <cstdint>

namespace avm_trace {

using Flavor = bb::AvmMiniFlavor;
using FF = Flavor::FF;
using Row = bb::AvmMiniFullRow<bb::fr>;

namespace avm_trace {

// Number of rows
static const size_t AVM_TRACE_SIZE = 256;
enum class IntermRegister : uint32_t { IA = 0, IB = 1, IC = 2 };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#pragma once

#include <cstddef>
#include <cstdint>
#include <unordered_map>

namespace avm_trace {
using std::size_t;

/**
* All AVM opcodes (Keep in sync with TS counterpart code opcodes.ts)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@
#include <string>
#include <utility>

namespace tests_avm {

using namespace bb;
using namespace avm_trace;
using namespace testing;

using bb::utils::hex_to_bytes;

namespace {

void gen_proof_and_validate(std::vector<uint8_t> const& bytecode,
std::vector<Row>&& trace,
std::vector<FF> const& calldata)
Expand All @@ -32,10 +39,6 @@ void gen_proof_and_validate(std::vector<uint8_t> const& bytecode,
}
} // namespace

namespace tests_avm {
using namespace avm_trace;
using bb::utils::hex_to_bytes;

class AvmMiniExecutionTests : public ::testing::Test {
public:
AvmMiniTraceBuilder trace_builder;
Expand Down
5 changes: 5 additions & 0 deletions barretenberg/cpp/src/barretenberg/vm/tests/helpers.test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
EXPECT_TRUE(message.find(expectedMessage) != std::string::npos); \
}
namespace tests_avm {

using Flavor = bb::AvmMiniFlavor;
using FF = Flavor::FF;
using Row = bb::AvmMiniFullRow<bb::fr>;

void validate_trace_proof(std::vector<Row>&& trace);
void mutate_ic_in_trace(std::vector<Row>& trace,
std::function<bool(Row)>&& selectRow,
Expand Down

0 comments on commit dcc9ba4

Please sign in to comment.