File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ use circom_prover::{
1616} ;
1717use num_bigint:: BigUint ;
1818use num_traits:: { Zero , identities:: One } ;
19- use std:: { collections:: HashMap , str:: FromStr , time :: Instant } ;
19+ use std:: { collections:: HashMap , str:: FromStr } ;
2020
2121pub type PackedGroth16Proof = [ BigUint ; 8 ] ;
2222
Original file line number Diff line number Diff line change @@ -44,14 +44,12 @@ pub fn download_zkey(depth: u16) -> Result<String, Box<dyn Error>> {
4444 let filename = format ! ( "semaphore-{}.zkey" , depth) ;
4545 let out_dir = std:: env:: temp_dir ( ) ;
4646 let dest_path = out_dir. join ( filename. clone ( ) ) ;
47- if dest_path. exists ( ) {
48- return Ok ( dest_path. to_string_lossy ( ) . into_owned ( ) ) ;
47+ if !dest_path. exists ( ) {
48+ let url = format ! ( "{}{}" , base_url, filename) ;
49+ let client = Client :: new ( ) ;
50+ let mut resp = client. get ( & url) . send ( ) ?. error_for_status ( ) ?;
51+ let mut out = File :: create ( & dest_path) ?;
52+ copy ( & mut resp, & mut out) ?;
4953 }
50- let url = format ! ( "{}{}" , base_url, filename) ;
51- let client = Client :: new ( ) ;
52- let mut resp = client. get ( & url) . send ( ) ?. error_for_status ( ) ?;
53- let mut out = File :: create ( & dest_path) ?;
54- copy ( & mut resp, & mut out) ?;
55- eprintln ! ( "Saved as {}" , dest_path. display( ) ) ;
5654 Ok ( dest_path. to_string_lossy ( ) . into_owned ( ) )
5755}
You can’t perform that action at this time.
0 commit comments