diff --git a/halo2_proofs/src/dev.rs b/halo2_proofs/src/dev.rs index 8dd647517b..ca85811b0f 100644 --- a/halo2_proofs/src/dev.rs +++ b/halo2_proofs/src/dev.rs @@ -962,8 +962,7 @@ impl MockProver { /// Returns `Ok(())` if this `MockProver` is satisfied, or a list of errors indicating /// the reasons that the circuit is not satisfied. - /// Constraints are only checked at `gate_row_ids`, - /// and lookup inputs are only checked at `lookup_input_row_ids`, parallelly. + /// Constraints are only checked at `gate_row_ids`, and lookup inputs are only checked at `lookup_input_row_ids`, parallelly. pub fn verify_at_rows_par>( &self, gate_row_ids: I, @@ -1359,6 +1358,31 @@ impl MockProver { } } + /// Panics if the circuit being checked by this `MockProver` is not satisfied. + /// + /// Any verification failures will be pretty-printed to stderr before the function + /// panics. + /// + /// Constraints are only checked at `gate_row_ids`, and lookup inputs are only checked at `lookup_input_row_ids`, parallelly. + /// + /// Apart from the stderr output, this method is equivalent to: + /// ```ignore + /// assert_eq!(prover.verify_at_rows_par(), Ok(())); + /// ``` + pub fn assert_satisfied_at_rows_par>( + &self, + gate_row_ids: I, + lookup_input_row_ids: I, + ) { + if let Err(errs) = self.verify_at_rows_par(gate_row_ids, lookup_input_row_ids) { + for err in errs { + err.emit(self); + eprintln!(); + } + panic!("circuit was not satisfied"); + } + } + /// Returns the list of Fixed Columns used within a MockProver instance and the associated values contained on each Cell. pub fn fixed(&self) -> &Vec>> { &self.fixed