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 44
44
let fr = if alloc_bits[ 0 ] . get_value ( ) . is_some ( ) {
45
45
let be_bits = alloc_bits
46
46
. 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 > > ( ) ? ;
49
49
50
50
let le_bits = be_bits
51
51
. chunks ( 8 )
Original file line number Diff line number Diff line change 1
1
use std:: fmt;
2
2
3
+ use anyhow:: Result ;
4
+
3
5
use bellperson:: gadgets:: num:: AllocatedNum ;
4
6
use bellperson:: { ConstraintSystem , SynthesisError } ;
5
7
use paired:: Engine ;
@@ -39,8 +41,8 @@ impl<E: Engine> Root<E> {
39
41
}
40
42
}
41
43
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) ) ? ) )
44
46
}
45
47
46
48
pub fn is_some ( & self ) -> bool {
You can’t perform that action at this time.
0 commit comments