25 std::vector<FF> fields;
27 for (
size_t i = 0; i < n; ++i) {
28 fields.push_back(FF::random_element());
35 std::vector<uint8_t> bytes;
37 for (
size_t i = 0; i < n; ++i) {
38 bytes.push_back(
static_cast<uint8_t
>(rand() % 256));
47 for (
size_t i = 0; i < n; ++i) {
52 .content = FF::random_element(),
54 .contractAddress = FF::random_element(),
64 for (
size_t i = 0; i < n; ++i) {
68 .contractAddress = FF::random_element(),
69 .isStaticCall = rand() % 2 == 0,
80 const uint8_t* pos_ptr = &rand_bytes.at(0);
82 switch (operand_type) {
83 case OperandType::INDIRECT8:
84 case OperandType::UINT8: {
85 uint8_t operand_u8 = 0;
87 return Operand::from<uint8_t>(operand_u8);
89 case OperandType::TAG: {
90 uint8_t operand_u8 = 0;
92 return Operand::from<uint8_t>(operand_u8 %
static_cast<uint8_t
>(
MemoryTag::MAX) +
95 case OperandType::INDIRECT16:
96 case OperandType::UINT16: {
97 uint16_t operand_u16 = 0;
99 return Operand::from<uint16_t>(operand_u16);
101 case OperandType::UINT32: {
102 uint32_t operand_u32 = 0;
104 return Operand::from<uint32_t>(operand_u32);
106 case OperandType::UINT64: {
107 uint64_t operand_u64 = 0;
109 return Operand::from<uint64_t>(operand_u64);
111 case OperandType::UINT128: {
114 return Operand::from<uint128_t>(operand_u128);
116 case OperandType::FF:
117 return Operand::from<FF>(FF::random_element());
122 __builtin_unreachable();
129 uint16_t indirect = 0;
130 operands.reserve(
format.size());
132 for (
const auto& operand_type :
format) {
133 switch (operand_type) {
134 case OperandType::INDIRECT8:
137 case OperandType::INDIRECT16:
148 .indirect = indirect,
161 .deployer_addr = FF::random_element(),
162 .current_class_id = FF::random_element(),
163 .original_class_id = FF::random_element(),
164 .initialisation_hash = FF::random_element(),
177 .private_function_root = FF::random_element(),
178 .public_bytecode_commitment = FF::random_element(),
185 auto data =
read_file(
"../src/barretenberg/vm2/testing/minimal_tx.testdata.bin");
190 auto events = simulation_helper.
simulate();
simulation::EventsContainer simulate()
tracegen::TraceContainer generate_trace(simulation::EventsContainer &&events, const PublicInputs &public_inputs)
static TestTraceContainer from_rows(const std::vector< AvmFullRow > &rows)
static affine_element random_element(numeric::RNG *engine=nullptr) noexcept
Samples a random point on the curve.
std::string format(Args... args)
const std::vector< FF > data
const std::unordered_map< OperandType, uint32_t > & get_operand_type_sizes()
const std::unordered_map< WireOpCode, std::vector< OperandType > > & get_instruction_wire_formats()
std::vector< PublicCallRequestWithCalldata > random_enqueued_calls(size_t n)
ContractClass random_contract_class(size_t bytecode_size)
std::vector< uint8_t > random_bytes(size_t n)
Operand random_operand(OperandType operand_type)
bool skip_slow_tests()
Check if slow tests should be skipped.
Instruction random_instruction(WireOpCode w_opcode)
ContractInstance random_contract_instance()
TestTraceContainer empty_trace()
std::vector< ScopedL2ToL1Message > random_l2_to_l1_messages(size_t n)
std::vector< FF > random_fields(size_t n)
std::pair< tracegen::TraceContainer, PublicInputs > get_minimal_trace_with_pi()
std::vector< uint8_t > read_file(const std::string &filename, size_t bytes=0)
void read(auto &it, msgpack_concepts::HasMsgPack auto &obj)
Automatically derived read for any object that defines .msgpack() (implicitly defined by MSGPACK_FIEL...
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
unsigned __int128 uint128_t
PublicCallRequest request
AffinePoint nullifier_key