mirror of
https://github.com/codex-storage/circom-compat.git
synced 2025-01-27 11:14:48 +00:00
When constraints are unsatisfied, show first one (#21)
Useful for debugging
This commit is contained in:
parent
e81fd92a67
commit
d0478d1538
@ -83,7 +83,15 @@ impl<E: PairingEngine> CircomBuilder<E> {
|
|||||||
use ark_relations::r1cs::{ConstraintSynthesizer, ConstraintSystem};
|
use ark_relations::r1cs::{ConstraintSynthesizer, ConstraintSystem};
|
||||||
let cs = ConstraintSystem::<E::Fr>::new_ref();
|
let cs = ConstraintSystem::<E::Fr>::new_ref();
|
||||||
circom.clone().generate_constraints(cs.clone()).unwrap();
|
circom.clone().generate_constraints(cs.clone()).unwrap();
|
||||||
cs.is_satisfied().unwrap()
|
let is_satisfied = cs.is_satisfied().unwrap();
|
||||||
|
if !is_satisfied {
|
||||||
|
println!(
|
||||||
|
"Unsatisfied constraint: {:?}",
|
||||||
|
cs.which_is_unsatisfied().unwrap()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
is_satisfied
|
||||||
});
|
});
|
||||||
|
|
||||||
Ok(circom)
|
Ok(circom)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user