Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Little cpp style improvements #4528

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
jeanmon marked this conversation as resolved.
Show resolved Hide resolved

/**
* 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
Loading