Skip to content

Commit

Permalink
error-chain_prover: Add new ProveError type and use it.
Browse files Browse the repository at this point in the history
  • Loading branch information
ceyhunsen committed Oct 28, 2024
1 parent 7b7673b commit f609aa3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/src/chain_prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
3 changes: 3 additions & 0 deletions core/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ pub enum BridgeError {

#[error("Musig2 error: {0}")]
Musig2Error(#[from] musig2::secp256k1::Error),

#[error("Proving error: {0}")]
ProveError(String),
}

impl From<BridgeError> for ErrorObject<'static> {
Expand Down

0 comments on commit f609aa3

Please sign in to comment.