Skip to content
This repository has been archived by the owner on Feb 17, 2025. It is now read-only.

Commit

Permalink
Enabble assigner_runner test
Browse files Browse the repository at this point in the history
  • Loading branch information
akokoshn committed Aug 24, 2024
1 parent a2d2690 commit c3bf049
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions tests/libs/assigner_runner/runner_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,33 @@

#include "zkevm_framework/preset/preset.hpp"

// TEST(runner_test, check_block) {
// using BlueprintFieldType = typename nil::crypto3::algebra::curves::pallas::base_field_type;
// using ArithmetizationType =
// nil::crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType>;

// zkevm_circuits<ArithmetizationType> circuits;

// std::unordered_map<nil::evm_assigner::zkevm_circuit,
// nil::blueprint::assignment<ArithmetizationType>>
// assignments;

// auto err = initialize_circuits<BlueprintFieldType>(circuits, assignments);
// ASSERT_FALSE(err.has_value());
// single_thread_runner<BlueprintFieldType> runner(assignments, 0 /*shad id*/,
// circuits.get_circuit_names());
// err = runner.extract_block_with_messages("", BLOCK_CONFIG);
// ASSERT_FALSE(err.has_value());
// err = runner.extract_accounts_with_storage(STATE_CONFIG);
// ASSERT_FALSE(err.has_value());
// err = runner.run("", std::nullopt);
// ASSERT_FALSE(err.has_value());

// Checks below are disabled due to frequent changes in filling assignment tables
/*
auto assignments = runner.get_assignments();
ASSERT_EQ(assignments.size(), 2);
ASSERT_EQ(assignments[1].witness(0, 0), 8);
ASSERT_EQ(assignments[1].witness(0, 1), 4);
*/
//}
TEST(runner_test, check_block) {
using BlueprintFieldType = typename nil::crypto3::algebra::curves::pallas::base_field_type;
using ArithmetizationType =
nil::crypto3::zk::snark::plonk_constraint_system<BlueprintFieldType>;

zkevm_circuits<ArithmetizationType> circuits;

std::unordered_map<nil::evm_assigner::zkevm_circuit,
nil::blueprint::assignment<ArithmetizationType>>
assignments;

auto err = initialize_circuits<BlueprintFieldType>(circuits, assignments);
ASSERT_FALSE(err.has_value());
single_thread_runner<BlueprintFieldType> runner(assignments, 0 /*shad id*/,
circuits.get_circuit_names());
err = runner.extract_block_with_messages("", BLOCK_CONFIG);
ASSERT_FALSE(err.has_value());
err = runner.extract_accounts_with_storage(STATE_CONFIG);
ASSERT_FALSE(err.has_value());
err = runner.run("", std::nullopt);
ASSERT_FALSE(err.has_value());

// Checks below are disabled due to frequent changes in filling assignment tables
/*
auto assignments = runner.get_assignments();
ASSERT_EQ(assignments.size(), 2);
ASSERT_EQ(assignments[1].witness(0, 0), 8);
ASSERT_EQ(assignments[1].witness(0, 1), 4);
*/
}

0 comments on commit c3bf049

Please sign in to comment.