@@ -41,12 +41,12 @@ pub mod types;
41
41
42
42
#[ cfg( test) ]
43
43
mod tests {
44
- use crate :: types:: { self , HWIDeviceType , TESTNET } ;
44
+ use crate :: types:: { self , HWIChain , HWIDevice , HWIDeviceType , TESTNET } ;
45
45
use crate :: HWIClient ;
46
46
use std:: collections:: BTreeMap ;
47
47
use std:: str:: FromStr ;
48
48
49
- use bitcoin:: bip32:: { DerivationPath , KeySource } ;
49
+ use bitcoin:: bip32:: { DerivationPath , Fingerprint , KeySource } ;
50
50
use bitcoin:: locktime:: absolute;
51
51
use bitcoin:: psbt:: { Input , Output } ;
52
52
use bitcoin:: { secp256k1, Transaction } ;
@@ -435,6 +435,41 @@ mod tests {
435
435
}
436
436
}
437
437
438
+ #[ test]
439
+ #[ serial]
440
+ #[ ignore = "Needs a Trezor One device for the test" ]
441
+ fn test_prompt_pin_to_trezor_device ( ) {
442
+ let client = HWIClient :: find_device (
443
+ None ,
444
+ Some ( HWIDeviceType :: Trezor ) ,
445
+ None ,
446
+ false ,
447
+ Network :: Testnet ,
448
+ )
449
+ . unwrap ( ) ;
450
+ client. prompt_pin ( ) . unwrap ( ) ;
451
+ }
452
+
453
+ #[ test]
454
+ #[ serial]
455
+ #[ ignore = "Needs a Trezor One device for the test" ]
456
+ fn test_send_pin_to_trezor_device ( ) {
457
+ let client = HWIClient :: get_client (
458
+ & HWIDevice {
459
+ device_type : HWIDeviceType :: Trezor ,
460
+ model : "trezor_1" . to_string ( ) ,
461
+ path : "webusb:000:1:2" . to_string ( ) ,
462
+ needs_pin_sent : true ,
463
+ needs_passphrase_sent : false ,
464
+ fingerprint : Fingerprint :: from_str ( "00000000" ) . unwrap ( ) ,
465
+ } ,
466
+ false ,
467
+ HWIChain :: from ( Network :: Testnet ) ,
468
+ )
469
+ . unwrap ( ) ;
470
+ client. send_pin ( "123456" ) . unwrap ( ) ;
471
+ }
472
+
438
473
#[ test]
439
474
#[ serial]
440
475
#[ ignore]
0 commit comments