@@ -50,7 +50,7 @@ mod tests {
50
50
use crate :: error:: Error ;
51
51
use crate :: implementations:: binary_implementation:: BinaryHWIImplementation ;
52
52
use crate :: implementations:: python_implementation:: PythonHWIImplementation ;
53
- use crate :: types:: { self , HWIBinaryExecutor , HWIDeviceType , TESTNET } ;
53
+ use crate :: types:: { self , HWIBinaryExecutor , HWIDeviceType , HWIImplementation , TESTNET } ;
54
54
use crate :: HWIClient ;
55
55
use std:: collections:: BTreeMap ;
56
56
use std:: str:: FromStr ;
@@ -447,27 +447,6 @@ mod tests {
447
447
}
448
448
}
449
449
}
450
-
451
- #[ test]
452
- #[ serial]
453
- #[ ignore]
454
- fn test_wipe_device( ) {
455
- let devices = HWIClient :: <$impl>:: enumerate( ) . unwrap( ) ;
456
- let unsupported = [
457
- HWIDeviceType :: Ledger ,
458
- HWIDeviceType :: Coldcard ,
459
- HWIDeviceType :: Jade ,
460
- ] ;
461
- for device in devices {
462
- let device = device. unwrap( ) ;
463
- if unsupported. contains( & device. device_type) {
464
- // These devices don't support wipe
465
- continue ;
466
- }
467
- let client = HWIClient :: <$impl>:: get_client( & device, true , TESTNET ) . unwrap( ) ;
468
- client. wipe_device( ) . unwrap( ) ;
469
- }
470
- }
471
450
} ;
472
451
}
473
452
@@ -495,4 +474,36 @@ mod tests {
495
474
fn test_install_hwi ( ) {
496
475
HWIClient :: < PythonHWIImplementation > :: install_hwilib ( Some ( "2.1.1" ) ) . unwrap ( ) ;
497
476
}
477
+
478
+ #[ test]
479
+ #[ serial]
480
+ #[ ignore]
481
+ fn test_wipe_device_pyhton ( ) {
482
+ wipe_device :: < PythonHWIImplementation > ( ) ;
483
+ }
484
+
485
+ #[ test]
486
+ #[ serial]
487
+ #[ ignore]
488
+ fn test_wipe_device_binary ( ) {
489
+ wipe_device :: < BinaryHWIImplementation < HWIBinaryExecutorImpl > > ( ) ;
490
+ }
491
+
492
+ fn wipe_device < T : HWIImplementation > ( ) {
493
+ let devices = HWIClient :: < T > :: enumerate ( ) . unwrap ( ) ;
494
+ let unsupported = [
495
+ HWIDeviceType :: Ledger ,
496
+ HWIDeviceType :: Coldcard ,
497
+ HWIDeviceType :: Jade ,
498
+ ] ;
499
+ for device in devices {
500
+ let device = device. unwrap ( ) ;
501
+ if unsupported. contains ( & device. device_type ) {
502
+ // These devices don't support wipe
503
+ continue ;
504
+ }
505
+ let client = HWIClient :: < T > :: get_client ( & device, true , TESTNET ) . unwrap ( ) ;
506
+ client. wipe_device ( ) . unwrap ( ) ;
507
+ }
508
+ }
498
509
}
0 commit comments