Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::stdlib::test_utils Namespace Reference

Functions

template<typename Builder >
void check_circuit_and_gate_count (Builder &builder, uint32_t expected_gates_without_base)
 Utility function for gate count checking and circuit verification.
 

Function Documentation

◆ check_circuit_and_gate_count()

template<typename Builder >
void bb::stdlib::test_utils::check_circuit_and_gate_count ( Builder builder,
uint32_t  expected_gates_without_base 
)

Utility function for gate count checking and circuit verification.

This function finalizes the circuit, checks the gate count against an expected value, and runs the circuit checker. The expected gate count should be provided WITHOUT the fixed number of gates that result from default constants added in the builder:

  • 1 base gate for UltraCircuitBuilder (fixed constant 0)
  • 4 base gates for MegaCircuitBuilder (fixed constants 0, 3, 4, 8 for ecc op codes)
Template Parameters
BuilderThe circuit builder type
Parameters
builderThe circuit builder instance
expected_gates_without_baseExpected number of gates excluding base gates

Definition at line 21 of file test_utils.hpp.