From 5b2f5f67d8d7376267eb84c190ecade74fc6f62f Mon Sep 17 00:00:00 2001 From: soham <22412996+zemse@users.noreply.github.com> Date: Tue, 9 Jan 2024 16:50:16 +0530 Subject: [PATCH] Expose mockprover data (#245) * Expose mockprover data * Fix issue --- halo2_proofs/src/dev.rs | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/halo2_proofs/src/dev.rs b/halo2_proofs/src/dev.rs index 48dcca5ba0..192c55b982 100644 --- a/halo2_proofs/src/dev.rs +++ b/halo2_proofs/src/dev.rs @@ -319,9 +319,12 @@ pub struct MockProver { current_phase: sealed::Phase, } +/// Instance Value #[derive(Debug, Clone, PartialEq, Eq)] -enum InstanceValue { +pub enum InstanceValue { + /// Assigned instance value Assigned(F), + /// Padding Padding, } @@ -1687,11 +1690,36 @@ impl + Ord> MockProver { } } + /// Returns the constraint system + pub fn cs(&self) -> &ConstraintSystem { + &self.cs + } + + /// Returns the usable rows + pub fn usable_rows(&self) -> &Range { + &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>> { + &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>> { &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> { + &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>> { + &self.instance + } + /// Returns the permutation argument (`Assembly`) used within a MockProver instance. pub fn permutation(&self) -> &Assembly { &self.permutation