Skip to content

Commit

Permalink
[feat] Trait for Circuit with Default Inputs (#223)
Browse files Browse the repository at this point in the history
* Add a trait for Circuit with default inputs

* Fix lint

* Remove witness_gen_only
  • Loading branch information
jonathanpwang committed Nov 30, 2023
1 parent b6625fa commit d92ecfc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion halo2-base/src/utils/halo2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::collections::hash_map::Entry;
use crate::ff::Field;
use crate::halo2_proofs::{
circuit::{AssignedCell, Cell, Region, Value},
plonk::{Advice, Assigned, Column, Fixed},
plonk::{Advice, Assigned, Circuit, Column, Fixed},
};
use crate::virtual_region::copy_constraints::{CopyConstraintManager, EXTERNAL_CELL_TYPE_ID};
use crate::AssignedValue;
Expand Down Expand Up @@ -106,3 +106,9 @@ pub fn constrain_virtual_equals_external<F: Field + Ord>(
}
}
}

/// Circuit with default values.
pub trait CircuitWithDefault<F: Field>: Circuit<F> {
/// Return Circuit with default inputs for the given params. Return struct could be used for pkey generation.
fn default(params: Self::Params) -> Self;
}

0 comments on commit d92ecfc

Please sign in to comment.