diff --git a/relations/src/sr1cs/mod.rs b/relations/src/sr1cs/mod.rs index 9261d8133..1909d5af1 100644 --- a/relations/src/sr1cs/mod.rs +++ b/relations/src/sr1cs/mod.rs @@ -125,6 +125,7 @@ impl Sr1csAdapter { cs: &ConstraintSystemRef, ) -> Result, SynthesisError> { assert_eq!(cs.num_predicates(), 1); + assert!(cs.has_predicate(R1CS_PREDICATE_LABEL)); let matrices = &cs.to_matrices().unwrap()[R1CS_PREDICATE_LABEL]; let mut public_variables = BTreeMap::new(); let mut witness_variables = BTreeMap::new(); @@ -187,10 +188,11 @@ impl Sr1csAdapter { /// /// # Panics /// - /// Panics is the constraint system does not have the R1CS predicate registered. + /// Panics if the constraint system does not have the R1CS predicate registered. pub fn r1cs_to_sr1cs_with_assignment( cs: &mut ConstraintSystem, ) -> Result, SynthesisError> { + assert!(cs.has_predicate(R1CS_PREDICATE_LABEL)); let matrices = &cs.to_matrices().unwrap()[R1CS_PREDICATE_LABEL]; let mut public_variables = BTreeMap::new(); let mut witness_variables = BTreeMap::new();