diff --git a/core/src/chain_prover.rs b/core/src/chain_prover.rs index 28f9dd67..18522a1f 100644 --- a/core/src/chain_prover.rs +++ b/core/src/chain_prover.rs @@ -233,10 +233,10 @@ where let prover = risc0_zkvm::default_prover(); - let receipt = prover - .prove(env, verifier_circuit::GUEST_ELF) - .unwrap() - .receipt; + let receipt = match prover.prove(env, verifier_circuit::GUEST_ELF) { + Ok(proove_info) => proove_info.receipt, + Err(e) => return Err(BridgeError::ProveError(e.to_string())), + }; let output: ([u32; 8], [u8; 32], u32, [u8; 32], [u8; 32]) = receipt.journal.decode().unwrap(); diff --git a/core/src/errors.rs b/core/src/errors.rs index 1559c78f..e507a609 100644 --- a/core/src/errors.rs +++ b/core/src/errors.rs @@ -176,6 +176,9 @@ pub enum BridgeError { #[error("Musig2 error: {0}")] Musig2Error(#[from] musig2::secp256k1::Error), + + #[error("Proving error: {0}")] + ProveError(String), } impl From for ErrorObject<'static> {