R1CSVar: Option::None -> ConstraintSystemRef::None (#281)

This commit is contained in:
Pratyush Mishra
2020-09-16 23:09:41 -07:00
committed by GitHub
parent 13332bcc1d
commit 99e489cac7
14 changed files with 98 additions and 112 deletions

View File

@@ -37,7 +37,7 @@ where
// proof.
let leaf_bits = leaf.to_bytes()?;
let leaf_hash = CRHGadget::evaluate(parameters, &leaf_bits)?;
let cs = leaf_hash.cs().or(root.cs()).unwrap();
let cs = leaf_hash.cs().or(root.cs());
// Check if leaf is one of the bottom-most siblings.
let leaf_is_left = Boolean::new_witness(r1cs_core::ns!(cs, "leaf_is_left"), || {

View File

@@ -350,7 +350,7 @@ impl<ConstraintF: PrimeField> AllocVar<[u8; 32], ConstraintF> for OutputVar<Cons
impl<F: PrimeField> R1CSVar<F> for OutputVar<F> {
type Value = [u8; 32];
fn cs(&self) -> Option<ConstraintSystemRef<F>> {
fn cs(&self) -> ConstraintSystemRef<F> {
self.0.cs()
}