Skip to content

Commit c20f240

Browse files
committed
FIX: b1342f7 use constraint_tracker in unit tests that print constraint numbers
1 parent 4b247e1 commit c20f240

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

libsnark/gadgetlib1/tests/test_r1cs_gg_ppzksnark_verifier_gadget.cpp

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ static constraints_tracker constraints;
2626

2727
/// This test generates a valid proof and checks that this valid proof
2828
/// is succesfully verified by the groth16 verifier gadget
29-
template<typename ppT_A, typename ppT_B>
30-
void test_verifier(
31-
const std::string &annotation_A, const std::string &annotation_B)
29+
template<typename ppT_A, typename ppT_B> void test_verifier()
3230
{
3331
using FieldT_A = libff::Fr<ppT_A>;
3432
using FieldT_B = libff::Fr<ppT_B>;
@@ -106,13 +104,10 @@ void test_verifier(
106104
PRINT_CONSTRAINT_PROFILING();
107105

108106
constraints.add_measurement<ppT_B>(
109-
"r1cs_gg_ppzksnark_verifier - " + annotation_B + " - " + annotation_A,
110-
pb.num_constraints());
107+
"r1cs_gg_ppzksnark_verifier - " + ppT_A::name, pb.num_constraints());
111108
}
112109

113-
template<typename ppT_A, typename ppT_B>
114-
void test_hardcoded_verifier(
115-
const std::string &annotation_A, const std::string &annotation_B)
110+
template<typename ppT_A, typename ppT_B> void test_hardcoded_verifier()
116111
{
117112
using FieldT_A = libff::Fr<ppT_A>;
118113
using FieldT_B = libff::Fr<ppT_B>;
@@ -192,27 +187,24 @@ void test_hardcoded_verifier(
192187
PRINT_CONSTRAINT_PROFILING();
193188

194189
constraints.add_measurement<ppT_B>(
195-
"r1cs_gg_ppzksnark_verifier - hardcoded - " + annotation_B + " - " +
196-
annotation_A,
190+
"r1cs_gg_ppzksnark_verifier - hardcoded - " + ppt_A::name,
197191
pb.num_constraints());
198192
}
199193

200194
TEST(Groth16VerifierGadgetTests, MntGroth16VerifierGadget)
201195
{
202-
test_verifier<libff::mnt4_pp, libff::mnt6_pp>("mnt4", "mnt6");
203-
test_verifier<libff::mnt6_pp, libff::mnt4_pp>("mnt6", "mnt4");
196+
test_verifier<libff::mnt4_pp, libff::mnt6_pp>();
197+
test_verifier<libff::mnt6_pp, libff::mnt4_pp>();
204198

205-
test_hardcoded_verifier<libff::mnt4_pp, libff::mnt6_pp>("mnt4", "mnt6");
206-
test_hardcoded_verifier<libff::mnt6_pp, libff::mnt4_pp>("mnt6", "mnt4");
199+
test_hardcoded_verifier<libff::mnt4_pp, libff::mnt6_pp>();
200+
test_hardcoded_verifier<libff::mnt6_pp, libff::mnt4_pp>();
207201
}
208202

209203
TEST(Groth16VerifierGadgetTests, BlsGroth16VerifierGadget)
210204
{
211-
test_verifier<libff::bls12_377_pp, libff::bw6_761_pp>(
212-
"bls12-377", "bw6-761");
205+
test_verifier<libff::bls12_377_pp, libff::bw6_761_pp>();
213206

214-
test_hardcoded_verifier<libff::bls12_377_pp, libff::bw6_761_pp>(
215-
"bls12-377", "bw6-761");
207+
test_hardcoded_verifier<libff::bls12_377_pp, libff::bw6_761_pp>();
216208
}
217209

218210
} // namespace

0 commit comments

Comments
 (0)