Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
class_id_derivation_trace.test.cpp
Go to the documentation of this file.
1#include <gmock/gmock.h>
2#include <gtest/gtest.h>
3
4#include <cstdint>
5
11
12namespace bb::avm2::tracegen {
13namespace {
14
15using testing::ElementsAre;
16using testing::Field;
17
19
20TEST(ClassIdDerivationTraceGenTest, TraceGeneration)
21{
22 TestTraceContainer trace;
23 ClassIdDerivationTraceBuilder builder;
24
25 simulation::ClassIdDerivationEvent class_event{
26 .class_id = FF(0xdeadbeef),
27 .artifact_hash = FF(12),
28 .private_functions_root = FF(23),
29 .public_bytecode_commitment = FF(45),
30 };
31 builder.process({ { class_event } }, trace);
32
33 EXPECT_THAT(trace.as_rows(),
34 ElementsAre(
35 // Only one row.
36 AllOf(ROW_FIELD_EQ(class_id_derivation_sel, 1),
37 ROW_FIELD_EQ(class_id_derivation_class_id, FF(0xdeadbeef)),
38 ROW_FIELD_EQ(class_id_derivation_artifact_hash, FF(12)),
39 ROW_FIELD_EQ(class_id_derivation_private_functions_root, FF(23)),
40 ROW_FIELD_EQ(class_id_derivation_public_bytecode_commitment, FF(45)))));
41}
42
43} // namespace
44} // namespace bb::avm2::tracegen
void process(const simulation::EventEmitterInterface< simulation::AluEvent >::Container &events, TraceContainer &trace)
Process the ALU events and populate the ALU relevant columns in the trace.
std::vector< AvmFullRowConstRef > as_rows() const
AluTraceBuilder builder
Definition alu.test.cpp:124
TestTraceContainer trace
#define ROW_FIELD_EQ(field_name, expression)
Definition macros.hpp:7
AvmFlavorSettings::FF FF
Definition field.hpp:10
TEST(BoomerangMegaCircuitBuilder, BasicCircuit)