mirror of
https://github.com/arnaucube/ark-r1cs-std.git
synced 2026-01-11 08:21:30 +01:00
Apply suggestions from code review
Co-Authored-By: Pratyush Mishra <pratyushmishra@berkeley.edu>
This commit is contained in:
committed by
Pratyush Mishra
parent
f4e030793c
commit
0ffa409ec1
@@ -3,15 +3,15 @@ use algebra::Field;
|
|||||||
use r1cs_core::{ConstraintSystem, Index, LinearCombination, SynthesisError, Variable};
|
use r1cs_core::{ConstraintSystem, Index, LinearCombination, SynthesisError, Variable};
|
||||||
|
|
||||||
/// Constraint counter for testing purposes.
|
/// Constraint counter for testing purposes.
|
||||||
pub struct TestConstraintCounter {
|
pub struct ConstraintCounter {
|
||||||
pub num_inputs: usize,
|
pub num_inputs: usize,
|
||||||
pub num_aux: usize,
|
pub num_aux: usize,
|
||||||
pub num_constraints: usize,
|
pub num_constraints: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TestConstraintCounter {
|
impl ConstraintCounter {
|
||||||
pub fn new() -> TestConstraintCounter {
|
pub fn new() -> Self {
|
||||||
TestConstraintCounter {
|
Self {
|
||||||
num_aux: 0,
|
num_aux: 0,
|
||||||
num_inputs: 0,
|
num_inputs: 0,
|
||||||
num_constraints: 0,
|
num_constraints: 0,
|
||||||
@@ -23,7 +23,7 @@ impl TestConstraintCounter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<ConstraintF: Field> ConstraintSystem<ConstraintF> for TestConstraintCounter {
|
impl<ConstraintF: Field> ConstraintSystem<ConstraintF> for ConstraintCounter {
|
||||||
type Root = Self;
|
type Root = Self;
|
||||||
|
|
||||||
fn alloc<F, A, AR>(&mut self, _: A, _: F) -> Result<Variable, SynthesisError>
|
fn alloc<F, A, AR>(&mut self, _: A, _: F) -> Result<Variable, SynthesisError>
|
||||||
@@ -114,7 +114,7 @@ mod tests {
|
|||||||
let empty_circuit = TestCircuit::<Fq>(None);
|
let empty_circuit = TestCircuit::<Fq>(None);
|
||||||
let populated_circuit = TestCircuit(Some(Fq::from(10u32)));
|
let populated_circuit = TestCircuit(Some(Fq::from(10u32)));
|
||||||
|
|
||||||
let mut counter = TestConstraintCounter::new();
|
let mut counter = ConstraintCounter::new();
|
||||||
let mut cs = TestConstraintSystem::new();
|
let mut cs = TestConstraintSystem::new();
|
||||||
|
|
||||||
empty_circuit
|
empty_circuit
|
||||||
|
|||||||
Reference in New Issue
Block a user