Skip to content

Commit

Permalink
[cli] update prove command to propagate errors
Browse files Browse the repository at this point in the history
  • Loading branch information
emmazzz committed Jul 8, 2022
1 parent b391847 commit a4207b1
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions crates/sui/src/sui_move/prove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,20 @@ impl Prove {
let mut options = move_prover::cli::Options::create_from_args(&args)?;

// provide Sui-specific Boogie template for the native functions to the prover.
options.backend.custom_natives =
Some(move_prover_boogie_backend::options::CustomNativeOptions {
template_bytes: SUI_NATIVE_TEMPLATE.to_vec(),
module_instance_names: vec![
(
"0x2::transfer".to_string(),
"transfer_instances".to_string(),
),
("0x2::id".to_string(), "id_instances".to_string()),
("0x2::event".to_string(), "sui_event_instances".to_string()),
],
});
if options.backend.custom_natives.is_none() {
options.backend.custom_natives =
Some(move_prover_boogie_backend::options::CustomNativeOptions {
template_bytes: SUI_NATIVE_TEMPLATE.to_vec(),
module_instance_names: vec![
(
"0x2::transfer".to_string(),
"transfer_instances".to_string(),
),
("0x2::id".to_string(), "id_instances".to_string()),
("0x2::event".to_string(), "sui_event_instances".to_string()),
],
});
}

let prover_result = std::thread::spawn(move || {
prove::run_move_prover(
Expand All @@ -58,7 +60,8 @@ impl Prove {
options,
)
});

prover_result.join().expect("move prover thread panicked")
prover_result
.join()
.unwrap_or_else(|err| Err(anyhow::anyhow!("{:?}", err)))
}
}

0 comments on commit a4207b1

Please sign in to comment.