Skip to content

Commit ab095bd

Browse files
author
Gemini Agent
committed
Fix missing vars in test_faulty_sectors_inner and update TempDir::keep usage
1 parent f7b89ce commit ab095bd

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

rust/src/proofs/api.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,7 +1718,7 @@ pub mod tests {
17181718
let registered_proof_window_post = RegisteredPoStProof::StackedDrgWindow2KiBV1_1;
17191719

17201720
let cache_dir = tempfile::tempdir()?;
1721-
let cache_dir_path = cache_dir.keep().unwrap();
1721+
let cache_dir_path = cache_dir.keep().map_err(|e| anyhow::anyhow!(e))?;
17221722
let cache_dir_path_ref = as_bytes(&cache_dir_path);
17231723

17241724
let prover_id = [1u8; 32];
@@ -1962,9 +1962,9 @@ pub mod tests {
19621962
let registered_proof_empty_sector_update = RegisteredUpdateProof::StackedDrg2KiBV1;
19631963

19641964
let new_cache_dir = tempfile::tempdir()?;
1965-
let new_cache_dir_path = new_cache_dir.keep().unwrap();
1965+
let new_cache_dir_path = new_cache_dir.keep().map_err(|e| anyhow::anyhow!(e))?;
19661966
let removed_data_dir = tempfile::tempdir()?;
1967-
let removed_data_dir_path = removed_data_dir.keep().unwrap();
1967+
let removed_data_dir_path = removed_data_dir.keep().map_err(|e| anyhow::anyhow!(e))?;
19681968

19691969
let buf_b: Vec<u8> = (0..2032).map(|_| rng.gen()).collect();
19701970
let mut piece_file_c = tempfile::tempfile()?;
@@ -2817,7 +2817,10 @@ pub mod tests {
28172817

28182818
fn test_faulty_sectors_inner(registered_proof_seal: RegisteredSealProof) -> Result<()> {
28192819
// miscellaneous setup and shared values
2820-
let cache_dir_path = cache_dir.keep().unwrap();
2820+
let registered_proof_window_post = RegisteredPoStProof::StackedDrgWindow2KiBV1_1;
2821+
2822+
let cache_dir = tempfile::tempdir()?;
2823+
let cache_dir_path = cache_dir.keep().map_err(|e| anyhow::anyhow!(e))?;
28212824
let cache_dir_path_ref = as_bytes(&cache_dir_path);
28222825

28232826
let prover_id = [1u8; 32];
@@ -3006,7 +3009,7 @@ pub mod tests {
30063009
) -> Result<()> {
30073010
// miscellaneous setup and shared values
30083011
let cache_dir = tempfile::tempdir()?;
3009-
let cache_dir_path = cache_dir.keep().unwrap();
3012+
let cache_dir_path = cache_dir.keep().map_err(|e| anyhow::anyhow!(e))?;
30103013
let cache_dir_path_ref = as_bytes(&cache_dir_path);
30113014

30123015
let prover_id = [1u8; 32];

0 commit comments

Comments
 (0)