Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
acir_format::TestBase Concept Reference

Concept defining the requirements for the Base template parameter of TestClass. More...

#include <test_class.hpp>

Concept definition

template<typename T>
concept acir_format::TestBase = requires {
typename T::Builder;
typename T::AcirConstraint;
typename T::InvalidWitness;
typename T::InvalidWitness::Target;
{ T::InvalidWitness::Target::None };
{ T::InvalidWitness::get_labels() } -> std::same_as<std::vector<std::string>>;
requires requires(T& instance,
typename T::AcirConstraint& constraint,
WitnessVector& witness_values,
const typename T::InvalidWitness::Target& invalid_witness_target) {
{ instance.generate_constraints(constraint, witness_values) } -> std::same_as<void>;
{ instance.invalidate_witness(constraint, witness_values, invalid_witness_target) } -> std::same_as<void>;
};
}
std::shared_ptr< Napi::ThreadSafeFunction > instance
Concept defining the requirements for the Base template parameter of TestClass.
std::vector< bb::fr > WitnessVector
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13

Detailed Description

Concept defining the requirements for the Base template parameter of TestClass.

Base must provide:

  • A class InvalidWitness, which specifies how to invalidate witness values to make the constraints unsatisfied. InvalidWitness must specify an enum class Target, which details the different invalidation targets, and two functions get_all() and get_labels() to iterate over all the possible invalidation targets.
  • Type aliases: Builder and AcirConstraint, specifying the Builder and constraint we are working with.
  • Static methods: generate_constraints (to generate valid constraints), invalidate_witness (to invalidate witness values to produce unsatisfied constraints).

Definition at line 522 of file test_class.hpp.