@@ -3,7 +3,7 @@ use futures::Future;
3
3
use indicatif:: { MultiProgress , ProgressBar } ;
4
4
use std:: time:: Duration ;
5
5
6
- use super :: CardanoDbUnpackerError ;
6
+ use super :: CardanoDbDownloadCheckerError ;
7
7
use mithril_client:: { MithrilError , MithrilResult } ;
8
8
9
9
/// Utility functions for to the CardanoDb commands
@@ -12,11 +12,11 @@ pub struct CardanoDbUtils;
12
12
impl CardanoDbUtils {
13
13
/// Handle the error return by `check_prerequisites`
14
14
pub fn check_disk_space_error ( error : MithrilError ) -> MithrilResult < String > {
15
- if let Some ( CardanoDbUnpackerError :: NotEnoughSpace {
15
+ if let Some ( CardanoDbDownloadCheckerError :: NotEnoughSpace {
16
16
left_space : _,
17
17
pathdir : _,
18
18
archive_size : _,
19
- } ) = error. downcast_ref :: < CardanoDbUnpackerError > ( )
19
+ } ) = error. downcast_ref :: < CardanoDbDownloadCheckerError > ( )
20
20
{
21
21
Ok ( format ! ( "Warning: {}" , error) )
22
22
} else {
@@ -51,7 +51,7 @@ mod test {
51
51
52
52
#[ test]
53
53
fn check_disk_space_error_should_return_warning_message_if_error_is_not_enough_space ( ) {
54
- let not_enough_space_error = CardanoDbUnpackerError :: NotEnoughSpace {
54
+ let not_enough_space_error = CardanoDbDownloadCheckerError :: NotEnoughSpace {
55
55
left_space : 1_f64 ,
56
56
pathdir : PathBuf :: new ( ) ,
57
57
archive_size : 2_f64 ,
@@ -66,15 +66,15 @@ mod test {
66
66
67
67
#[ test]
68
68
fn check_disk_space_error_should_return_error_if_error_is_not_error_not_enough_space ( ) {
69
- let error = CardanoDbUnpackerError :: UnpackDirectoryAlreadyExists ( PathBuf :: new ( ) ) ;
69
+ let error = CardanoDbDownloadCheckerError :: UnpackDirectoryNotEmpty ( PathBuf :: new ( ) ) ;
70
70
71
71
let error = CardanoDbUtils :: check_disk_space_error ( anyhow ! ( error) )
72
72
. expect_err ( "check_disk_space_error should fail" ) ;
73
73
74
74
assert ! (
75
75
matches!(
76
- error. downcast_ref:: <CardanoDbUnpackerError >( ) ,
77
- Some ( CardanoDbUnpackerError :: UnpackDirectoryAlreadyExists ( _) )
76
+ error. downcast_ref:: <CardanoDbDownloadCheckerError >( ) ,
77
+ Some ( CardanoDbDownloadCheckerError :: UnpackDirectoryNotEmpty ( _) )
78
78
) ,
79
79
"Unexpected error: {:?}" ,
80
80
error
0 commit comments