Skip to content

Commit

Permalink
Expose mockprover data (#245)
Browse files Browse the repository at this point in the history
* Expose mockprover data

* Fix issue
  • Loading branch information
zemse authored Jan 9, 2024
1 parent 3c02d03 commit 5b2f5f6
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion halo2_proofs/src/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,12 @@ pub struct MockProver<F: Field> {
current_phase: sealed::Phase,
}

/// Instance Value
#[derive(Debug, Clone, PartialEq, Eq)]
enum InstanceValue<F: Field> {
pub enum InstanceValue<F: Field> {
/// Assigned instance value
Assigned(F),
/// Padding
Padding,
}

Expand Down Expand Up @@ -1687,11 +1690,36 @@ impl<F: FromUniformBytes<64> + Ord> MockProver<F> {
}
}

/// Returns the constraint system
pub fn cs(&self) -> &ConstraintSystem<F> {
&self.cs
}

/// Returns the usable rows
pub fn usable_rows(&self) -> &Range<usize> {
&self.usable_rows
}

/// Returns the list of Advice Columns used within a MockProver instance and the associated values contained on each Cell.
pub fn advice(&self) -> &Vec<Vec<CellValue<F>>> {
&self.advice
}

/// Returns the list of Fixed Columns used within a MockProver instance and the associated values contained on each Cell.
pub fn fixed(&self) -> &Vec<Vec<CellValue<F>>> {
&self.fixed
}

/// Returns the list of Selector Columns used within a MockProver instance and the associated values contained on each Cell.
pub fn selectors(&self) -> &Vec<Vec<bool>> {
&self.selectors
}

/// Returns the list of Instance Columns used within a MockProver instance and the associated values contained on each Cell.
pub fn instance(&self) -> &Vec<Vec<InstanceValue<F>>> {
&self.instance
}

/// Returns the permutation argument (`Assembly`) used within a MockProver instance.
pub fn permutation(&self) -> &Assembly {
&self.permutation
Expand Down

0 comments on commit 5b2f5f6

Please sign in to comment.