File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
storage-proofs/src/circuit Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 4444 let fr = if alloc_bits[ 0 ] . get_value ( ) . is_some ( ) {
4545 let be_bits = alloc_bits
4646 . iter ( )
47- . map ( |v| v. get_value ( ) . unwrap ( ) )
48- . collect :: < Vec < bool > > ( ) ;
47+ . map ( |v| v. get_value ( ) . ok_or ( SynthesisError :: AssignmentMissing ) )
48+ . collect :: < Result < Vec < bool > , SynthesisError > > ( ) ? ;
4949
5050 let le_bits = be_bits
5151 . chunks ( 8 )
Original file line number Diff line number Diff line change 11use std:: fmt;
22
3+ use anyhow:: Result ;
4+
35use bellperson:: gadgets:: num:: AllocatedNum ;
46use bellperson:: { ConstraintSystem , SynthesisError } ;
57use paired:: Engine ;
@@ -39,8 +41,8 @@ impl<E: Engine> Root<E> {
3941 }
4042 }
4143
42- pub fn var < CS : ConstraintSystem < E > > ( cs : CS , fr : E :: Fr ) -> Self {
43- Root :: Var ( AllocatedNum :: alloc ( cs, || Ok ( fr) ) . unwrap ( ) )
44+ pub fn var < CS : ConstraintSystem < E > > ( cs : CS , fr : E :: Fr ) -> Result < Self > {
45+ Ok ( Root :: Var ( AllocatedNum :: alloc ( cs, || Ok ( fr) ) ? ) )
4446 }
4547
4648 pub fn is_some ( & self ) -> bool {
You can’t perform that action at this time.
0 commit comments