3#include <gmock/gmock.h>
4#include <gtest/gtest.h>
12using ::testing::Return;
13using ::testing::StrictMock;
20TEST(AvmSimulationRetrievedBytecodesTreeCheck, ContainsNotExists)
22 StrictMock<MockIndexedTreeCheck> mock_indexed_tree_check;
37 EXPECT_CALL(mock_indexed_tree_check,
38 assert_read(class_id,
NO_SILOING,
false, expected_leaf_data, low_leaf_index, _, snapshot));
41 EXPECT_FALSE(bytecodes_check.
contains(class_id));
44TEST(AvmSimulationRetrievedBytecodesTreeCheck, ContainsExists)
46 StrictMock<MockIndexedTreeCheck> mock_indexed_tree_check;
62 EXPECT_CALL(mock_indexed_tree_check,
63 assert_read(class_id,
NO_SILOING,
true, expected_leaf_data, low_leaf_index, _, snapshot));
66 EXPECT_TRUE(bytecodes_check.
contains(class_id));
69TEST(AvmSimulationRetrievedBytecodesTreeCheck, InsertExists)
71 StrictMock<MockIndexedTreeCheck> mock_indexed_tree_check;
79 .WillOnce(Return(snapshot));
82 bytecodes_check.
insert(class_id);
86TEST(AvmSimulationRetrievedBytecodesTreeCheck, InsertAppend)
88 StrictMock<MockIndexedTreeCheck> mock_indexed_tree_check;
100 .WillOnce(Return(next_snapshot));
103 bytecodes_check.
insert(class_id);
104 EXPECT_EQ(bytecodes_check.
get_snapshot(), next_snapshot);
AppendOnlyTreeSnapshot get_snapshot() const
SequentialInsertionResult< LeafType > insert_indexed_leaves(std::span< const LeafType > leaves)
GetLowIndexedLeafResponse get_low_indexed_leaf(const FF &key) const
IndexedLeaf< LeafType > get_leaf_preimage(size_t leaf_index) const
bool contains(const FF &class_id) override
Checks whether a contract class ID exists in the retrieved bytecodes tree.
void insert(const FF &class_id) override
Inserts a contract class ID into the retrieved bytecodes tree.
AppendOnlyTreeSnapshot get_snapshot() const override
Returns the current tree snapshot.
IndexedTreeLeafData low_leaf
AVM range check gadget for witness generation.
const std::optional< uint64_t > NO_PUBLIC_INPUTS_INDEX
RetrievedBytecodesTree build_retrieved_bytecodes_tree()
const std::optional< IndexedTreeSiloingParameters > NO_SILOING
void write(B &buf, field2< base_field, Params > const &value)
TEST(BoomerangMegaCircuitBuilder, BasicCircuit)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept