From 28489d03ad2d385609847da3045315c0f5bc7d4e Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Mon, 20 Dec 2021 14:45:56 +0000 Subject: [PATCH] Rename `VerifyFailure::Cell` to `VerifyFailure::CellNotAssigned` Closes zcash/halo2#381. --- CHANGELOG.md | 1 + src/dev.rs | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9add34da..c152e9ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ and this project adheres to Rust's notion of - `halo2::dev::CircuitLayout::render` now takes `k` as a `u32`, matching the regular parameter APIs. - `halo2::dev::VerifyFailure` has been overhauled: + - `VerifyFailure::Cell` has been renamed to `VerifyFailure::CellNotAssigned`. - `VerifyFailure::ConstraintNotSatisfied` now has a `cell_values` field, storing the values of the cells used in the unsatisfied constraint. - The `row` field of `VerifyFailure::Lookup` has been replaced by a `location` diff --git a/src/dev.rs b/src/dev.rs index 6bc1f04f..ab357d2e 100644 --- a/src/dev.rs +++ b/src/dev.rs @@ -61,7 +61,7 @@ pub enum LookupFailure { #[derive(Debug, PartialEq)] pub enum VerifyFailure { /// A cell used in an active gate was not assigned to. - Cell { + CellNotAssigned { /// The index of the active gate. gate: metadata::Gate, /// The region in which this cell should be assigned. @@ -108,7 +108,7 @@ pub enum VerifyFailure { impl fmt::Display for VerifyFailure { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::Cell { + Self::CellNotAssigned { gate, region, column, @@ -695,7 +695,7 @@ impl MockProver { if r.cells.contains(&(cell.column, cell_row)) { None } else { - Some(VerifyFailure::Cell { + Some(VerifyFailure::CellNotAssigned { gate: (gate_index, gate.name()).into(), region: (r_i, r.name.clone()).into(), column: cell.column, @@ -1059,7 +1059,7 @@ mod tests { let prover = MockProver::run(K, &FaultyCircuit {}, vec![]).unwrap(); assert_eq!( prover.verify(), - Err(vec![VerifyFailure::Cell { + Err(vec![VerifyFailure::CellNotAssigned { gate: (0, "Equality check").into(), region: (0, "Faulty synthesis".to_owned()).into(), column: Column::new(1, Any::Advice),