@@ -50,7 +50,7 @@ mod tests {
5050 use crate :: error:: Error ;
5151 use crate :: implementations:: binary_implementation:: BinaryHWIImplementation ;
5252 use crate :: implementations:: python_implementation:: PythonHWIImplementation ;
53- use crate :: types:: { self , HWIBinaryExecutor , HWIDeviceType , TESTNET } ;
53+ use crate :: types:: { self , HWIBinaryExecutor , HWIDeviceType , HWIImplementation , TESTNET } ;
5454 use crate :: HWIClient ;
5555 use std:: collections:: BTreeMap ;
5656 use std:: str:: FromStr ;
@@ -447,27 +447,6 @@ mod tests {
447447 }
448448 }
449449 }
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- }
471450 } ;
472451 }
473452
@@ -495,4 +474,36 @@ mod tests {
495474 fn test_install_hwi ( ) {
496475 HWIClient :: < PythonHWIImplementation > :: install_hwilib ( Some ( "2.1.1" ) ) . unwrap ( ) ;
497476 }
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+ }
498509}
0 commit comments