pub struct TestConstraintSystem<E: Engine> { /* private fields */ }Expand description
Constraint system for testing purposes.
Implementations§
Source§impl<E: Engine> TestConstraintSystem<E>
impl<E: Engine> TestConstraintSystem<E>
pub fn new() -> TestConstraintSystem<E>
pub fn pretty_print(&self) -> String
pub fn find_unconstrained(&self) -> String
pub fn hash(&self) -> String
pub fn which_is_unsatisfied(&self) -> Option<&str>
pub fn is_satisfied(&self) -> bool
pub fn num_constraints(&self) -> usize
pub fn set(&mut self, path: &str, to: E::Fr)
pub fn verify(&self, expected: &[E::Fr]) -> bool
pub fn num_inputs(&self) -> usize
pub fn get_input(&mut self, index: usize, path: &str) -> E::Fr
pub fn get(&mut self, path: &str) -> E::Fr
Trait Implementations§
Source§impl<E: Engine> ConstraintSystem<E> for TestConstraintSystem<E>
impl<E: Engine> ConstraintSystem<E> for TestConstraintSystem<E>
Source§type Root = TestConstraintSystem<E>
type Root = TestConstraintSystem<E>
Represents the type of the “root” of this constraint system
so that nested namespaces can minimize indirection.
Source§fn alloc<F, A, AR>(
&mut self,
annotation: A,
f: F,
) -> Result<Variable, SynthesisError>
fn alloc<F, A, AR>( &mut self, annotation: A, f: F, ) -> Result<Variable, SynthesisError>
Allocate a private variable in the constraint system. The provided function is used to
determine the assignment of the variable. The given
annotation function is invoked
in testing contexts in order to derive a unique name for this variable in the current
namespace.Source§fn alloc_input<F, A, AR>(
&mut self,
annotation: A,
f: F,
) -> Result<Variable, SynthesisError>
fn alloc_input<F, A, AR>( &mut self, annotation: A, f: F, ) -> Result<Variable, SynthesisError>
Allocate a public variable in the constraint system. The provided function is used to
determine the assignment of the variable.
Source§fn enforce<A, AR, LA, LB, LC>(&mut self, annotation: A, a: LA, b: LB, c: LC)where
A: FnOnce() -> AR,
AR: Into<String>,
LA: FnOnce(LinearCombination<E>) -> LinearCombination<E>,
LB: FnOnce(LinearCombination<E>) -> LinearCombination<E>,
LC: FnOnce(LinearCombination<E>) -> LinearCombination<E>,
fn enforce<A, AR, LA, LB, LC>(&mut self, annotation: A, a: LA, b: LB, c: LC)where
A: FnOnce() -> AR,
AR: Into<String>,
LA: FnOnce(LinearCombination<E>) -> LinearCombination<E>,
LB: FnOnce(LinearCombination<E>) -> LinearCombination<E>,
LC: FnOnce(LinearCombination<E>) -> LinearCombination<E>,
Enforce that
A * B = C. The annotation function is invoked in testing contexts
in order to derive a unique name for the constraint in the current namespace.Source§fn push_namespace<NR, N>(&mut self, name_fn: N)
fn push_namespace<NR, N>(&mut self, name_fn: N)
Create a new (sub)namespace and enter into it. Not intended
for downstream use; use
namespace instead.Source§fn pop_namespace(&mut self)
fn pop_namespace(&mut self)
Exit out of the existing namespace. Not intended for
downstream use; use
namespace instead.Auto Trait Implementations§
impl<E> Freeze for TestConstraintSystem<E>
impl<E> RefUnwindSafe for TestConstraintSystem<E>
impl<E> Send for TestConstraintSystem<E>
impl<E> Sync for TestConstraintSystem<E>
impl<E> Unpin for TestConstraintSystem<E>
impl<E> UnwindSafe for TestConstraintSystem<E>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more