@@ -2,9 +2,9 @@ use std::fs::{File, OpenOptions};
22use std:: time:: Duration ;
33use std:: { io, u32} ;
44
5+ use anyhow:: bail;
56use bellperson:: Circuit ;
67use chrono:: Utc ;
7- use failure:: bail;
88use log:: info;
99use memmap:: MmapMut ;
1010use memmap:: MmapOptions ;
@@ -25,7 +25,7 @@ use storage_proofs::stacked::{
2525} ;
2626use tempfile:: TempDir ;
2727
28- fn file_backed_mmap_from_zeroes ( n : usize , use_tmp : bool ) -> Result < MmapMut , failure :: Error > {
28+ fn file_backed_mmap_from_zeroes ( n : usize , use_tmp : bool ) -> anyhow :: Result < MmapMut > {
2929 let file: File = if use_tmp {
3030 tempfile:: tempfile ( ) . unwrap ( )
3131 } else {
@@ -46,7 +46,7 @@ fn file_backed_mmap_from_zeroes(n: usize, use_tmp: bool) -> Result<MmapMut, fail
4646
4747fn dump_proof_bytes < H : Hasher > (
4848 all_partition_proofs : & [ stacked:: Proof < H , Sha256Hasher > ] ,
49- ) -> Result < ( ) , failure :: Error > {
49+ ) -> anyhow :: Result < ( ) > {
5050 let file = OpenOptions :: new ( )
5151 . write ( true )
5252 . create ( true )
@@ -90,10 +90,7 @@ impl From<Params> for Inputs {
9090 }
9191}
9292
93- fn generate_report < H : ' static > (
94- params : Params ,
95- cache_dir : & TempDir ,
96- ) -> Result < Report , failure:: Error >
93+ fn generate_report < H : ' static > ( params : Params , cache_dir : & TempDir ) -> anyhow:: Result < Report >
9794where
9895 H : Hasher ,
9996{
@@ -220,7 +217,6 @@ where
220217 & priv_inputs,
221218 * partitions,
222219 )
223- . map_err ( |err| err. into ( ) )
224220 } ) ?;
225221
226222 report. outputs . vanilla_proving_wall_time_us =
@@ -296,7 +292,6 @@ where
296292 & data,
297293 Some ( store_config. clone ( ) ) ,
298294 )
299- . map_err ( |err| err. into ( ) )
300295 } ) ?;
301296
302297 assert_ne ! ( & ( * data) , m. return_value. as_slice( ) ) ;
@@ -331,7 +326,7 @@ fn do_circuit_work<H: 'static + Hasher>(
331326 priv_in : Option < <StackedDrg < H , Sha256Hasher > as ProofScheme >:: PrivateInputs > ,
332327 params : & Params ,
333328 report : & mut Report ,
334- ) -> Result < CircuitWorkMeasurement , failure :: Error > {
329+ ) -> anyhow :: Result < CircuitWorkMeasurement > {
335330 let mut proving_wall_time = Duration :: new ( 0 , 0 ) ;
336331 let mut proving_cpu_time = Duration :: new ( 0 , 0 ) ;
337332
@@ -382,7 +377,6 @@ fn do_circuit_work<H: 'static + Hasher>(
382377 return_value,
383378 } = measure ( || {
384379 StackedCompound :: prove ( & compound_public_params, & pub_inputs, & priv_inputs, & gparams)
385- . map_err ( |err| err. into ( ) )
386380 } ) ?;
387381 proving_wall_time += wall_time;
388382 proving_cpu_time += cpu_time;
@@ -405,7 +399,6 @@ fn do_circuit_work<H: 'static + Hasher>(
405399 minimum_challenges : 1 ,
406400 } ,
407401 )
408- . map_err ( |err| err. into ( ) )
409402 } ) ?;
410403
411404 // If one verification fails, result becomes permanently false.
@@ -503,7 +496,7 @@ pub struct RunOpts {
503496 pub size : usize ,
504497}
505498
506- pub fn run ( opts : RunOpts ) -> Result < ( ) , failure :: Error > {
499+ pub fn run ( opts : RunOpts ) -> anyhow :: Result < ( ) > {
507500 let config = StackedConfig :: new ( opts. layers , opts. window_challenges , opts. wrapper_challenges ) ;
508501
509502 let params = Params {
0 commit comments