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;
16
18
19TEST(ClassIdDerivationTraceGenTest, TraceGeneration)
20{
21 TestTraceContainer trace;
22 ClassIdDerivationTraceBuilder builder;
23
24 simulation::ClassIdDerivationEvent class_event{
25 .class_id = FF(0xdeadbeef),
26 .artifact_hash = FF(12),
27 .private_functions_root = FF(23),
28 .public_bytecode_commitment = FF(45),
29 };
30 builder.process({ { class_event } }, trace);
31
32 EXPECT_THAT(trace.as_rows(),
33 ElementsAre(
34 // Only one row.
35 AllOf(ROW_FIELD_EQ(class_id_derivation_sel, 1),
36 ROW_FIELD_EQ(class_id_derivation_class_id, FF(0xdeadbeef)),
37 ROW_FIELD_EQ(class_id_derivation_artifact_hash, FF(12)),
38 ROW_FIELD_EQ(class_id_derivation_private_functions_root, FF(23)),
39 ROW_FIELD_EQ(class_id_derivation_public_bytecode_commitment, FF(45)))));
40}
41
42} // namespace
43} // 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)