Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
colinlyguo committed Aug 29, 2023
1 parent daf8e19 commit ffc0e58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions common/libzkp/impl/src/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ pub unsafe extern "C" fn check_chunk_proofs(chunk_proofs: *const c_char) -> *con
return Err("provided chunk proofs are empty.".to_string());
}

let prover_ref = PROVER
.get()
.ok_or_else(|| "failed to get reference to PROVER.".to_string())?;
let prover_ref = PROVER.get().expect("failed to get reference to PROVER.");

let valid = prover_ref.check_chunk_proofs(&chunk_proofs);
Ok(valid)
Expand Down Expand Up @@ -117,7 +115,7 @@ pub unsafe extern "C" fn gen_batch_proof(

let proof = PROVER
.get_mut()
.ok_or_else(|| "failed to get mutable reference to PROVER.".to_string())?
.expect("failed to get mutable reference to PROVER.")
.gen_agg_evm_proof(chunk_hashes_proofs, None, OUTPUT_DIR.as_deref())
.map_err(|e| format!("failed to generate proof: {e:?}"))?;

Expand Down
2 changes: 1 addition & 1 deletion common/libzkp/impl/src/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub unsafe extern "C" fn gen_chunk_proof(block_traces: *const c_char) -> *const

let proof = PROVER
.get_mut()
.ok_or_else(|| "failed to get mutable reference to PROVER.".to_string())?
.expect("failed to get mutable reference to PROVER.")
.gen_chunk_proof(block_traces, None, OUTPUT_DIR.as_deref())
.map_err(|e| format!("failed to generate proof: {e:?}"))?;

Expand Down

0 comments on commit ffc0e58

Please sign in to comment.