@@ -43,6 +43,7 @@ use lightning::ln::channelmanager::{
43
43
ChainParameters , ChannelManager , InterceptId , PaymentId , RecipientOnionFields , Retry ,
44
44
} ;
45
45
use lightning:: ln:: functional_test_utils:: * ;
46
+ use lightning:: ln:: inbound_payment:: ExpandedKey ;
46
47
use lightning:: ln:: msgs:: { self , DecodeError } ;
47
48
use lightning:: ln:: peer_handler:: {
48
49
IgnoringMessageHandler , MessageHandler , PeerManager , SocketDescriptor ,
@@ -56,9 +57,7 @@ use lightning::routing::router::{
56
57
InFlightHtlcs , PaymentParameters , Route , RouteParameters , Router ,
57
58
} ;
58
59
use lightning:: routing:: utxo:: UtxoLookup ;
59
- use lightning:: sign:: {
60
- EntropySource , InMemorySigner , KeyMaterial , NodeSigner , Recipient , SignerProvider ,
61
- } ;
60
+ use lightning:: sign:: { EntropySource , InMemorySigner , NodeSigner , Recipient , SignerProvider } ;
62
61
use lightning:: types:: payment:: { PaymentHash , PaymentPreimage , PaymentSecret } ;
63
62
use lightning:: util:: config:: { ChannelConfig , UserConfig } ;
64
63
use lightning:: util:: errors:: APIError ;
@@ -79,7 +78,6 @@ use bitcoin::secp256k1::{self, Message, PublicKey, Scalar, Secp256k1, SecretKey}
79
78
80
79
use std:: cell:: RefCell ;
81
80
use std:: cmp;
82
- use std:: convert:: TryInto ;
83
81
use std:: sync:: atomic:: { AtomicBool , AtomicU64 , AtomicUsize , Ordering } ;
84
82
use std:: sync:: { Arc , Mutex } ;
85
83
@@ -364,7 +362,7 @@ impl<'a> Drop for MoneyLossDetector<'a> {
364
362
365
363
struct KeyProvider {
366
364
node_secret : SecretKey ,
367
- inbound_payment_key : KeyMaterial ,
365
+ inbound_payment_key : ExpandedKey ,
368
366
counter : AtomicU64 ,
369
367
signer_state : RefCell < HashMap < u8 , ( bool , Arc < Mutex < EnforcementState > > ) > > ,
370
368
}
@@ -402,8 +400,8 @@ impl NodeSigner for KeyProvider {
402
400
Ok ( SharedSecret :: new ( other_key, & node_secret) )
403
401
}
404
402
405
- fn get_inbound_payment_key_material ( & self ) -> KeyMaterial {
406
- self . inbound_payment_key . clone ( )
403
+ fn get_inbound_payment_key ( & self ) -> ExpandedKey {
404
+ self . inbound_payment_key
407
405
}
408
406
409
407
fn sign_invoice (
@@ -636,7 +634,7 @@ pub fn do_test(mut data: &[u8], logger: &Arc<dyn Logger>) {
636
634
637
635
let keys_manager = Arc :: new ( KeyProvider {
638
636
node_secret : our_network_key. clone ( ) ,
639
- inbound_payment_key : KeyMaterial ( inbound_payment_key. try_into ( ) . unwrap ( ) ) ,
637
+ inbound_payment_key : ExpandedKey :: new ( inbound_payment_key) ,
640
638
counter : AtomicU64 :: new ( 0 ) ,
641
639
signer_state : RefCell :: new ( new_hash_map ( ) ) ,
642
640
} ) ;
0 commit comments