diff --git a/common/libzkp/impl/src/batch.rs b/common/libzkp/impl/src/batch.rs index 62aa099c92..24581c0b3a 100644 --- a/common/libzkp/impl/src/batch.rs +++ b/common/libzkp/impl/src/batch.rs @@ -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) @@ -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:?}"))?; diff --git a/common/libzkp/impl/src/chunk.rs b/common/libzkp/impl/src/chunk.rs index 371bf2da0f..73a4ab1c8b 100644 --- a/common/libzkp/impl/src/chunk.rs +++ b/common/libzkp/impl/src/chunk.rs @@ -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:?}"))?;