Skip to content

Commit

Permalink
Add a trait for Circuit with default inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
nyunyunyunyu committed Nov 28, 2023
1 parent 12e07e1 commit 0d19e4a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions halo2-base/src/utils/halo2.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use halo2_proofs_axiom::plonk::Circuit;

use crate::ff::Field;
use crate::halo2_proofs::{
circuit::{AssignedCell, Cell, Region, Value},
Expand Down Expand Up @@ -113,3 +115,9 @@ pub fn constrain_virtual_equals_external<F: Field + Ord>(
let acell = copy_manager.assigned_advices.get(&ctx_cell).expect("cell not assigned");
region.constrain_equal(*acell, external_cell);
}

/// Circuit with default values.
pub trait CircuitWithDefault<F: Field>: Circuit<F> {
/// Return Circuit with default inputs for the given params.
fn default(witness_gen_only: bool, params: Self::Params) -> Self;
}

0 comments on commit 0d19e4a

Please sign in to comment.