Skip to content

Commit

Permalink
chore: remove usage of expect in Backend
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Sep 1, 2023
1 parent 7de4cac commit 0fcc1b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions crates/acvm_backend_barretenberg/src/proof_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ impl Backend {
witness_path,
proof_path: proof_path.clone(),
}
.run(&binary_path)
.expect("prove command failed");
.run(&binary_path)?;

let proof_with_public_inputs = read_bytes_from_file(&proof_path).unwrap();

Expand Down Expand Up @@ -146,8 +145,7 @@ impl Backend {
bytecode_path,
vk_path_output: vk_path.clone(),
}
.run(&binary_path)
.expect("write vk command failed");
.run(&binary_path)?;

// Verify the proof
let valid_proof = VerifyCommand {
Expand Down
6 changes: 2 additions & 4 deletions crates/acvm_backend_barretenberg/src/smart_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ impl Backend {
bytecode_path,
vk_path_output: vk_path.clone(),
}
.run(&binary_path)
.expect("write vk command failed");
.run(&binary_path)?;

let contract_path = temp_directory_path.join("contract");
ContractCommand {
Expand All @@ -42,8 +41,7 @@ impl Backend {
vk_path,
contract_path: contract_path.clone(),
}
.run(&binary_path)
.expect("contract command failed");
.run(&binary_path)?;

let verification_key_library_bytes = read_bytes_from_file(&contract_path).unwrap();
let verification_key_library = String::from_utf8(verification_key_library_bytes).unwrap();
Expand Down

0 comments on commit 0fcc1b7

Please sign in to comment.