@@ -2205,14 +2205,17 @@ mod tests {
2205
2205
use crate :: ln:: types:: { PaymentHash , PaymentPreimage } ;
2206
2206
use crate :: ln:: channelmanager:: { PaymentId , RecipientOnionFields } ;
2207
2207
use crate :: ln:: features:: { Bolt12InvoiceFeatures , ChannelFeatures , NodeFeatures } ;
2208
+ use crate :: ln:: inbound_payment:: ExpandedKey ;
2208
2209
use crate :: ln:: msgs:: { ErrorAction , LightningError } ;
2209
2210
use crate :: ln:: outbound_payment:: { Bolt12PaymentError , OutboundPayments , PendingOutboundPayment , Retry , RetryableSendFailure , StaleExpiration } ;
2210
2211
#[ cfg( feature = "std" ) ]
2211
2212
use crate :: offers:: invoice:: DEFAULT_RELATIVE_EXPIRY ;
2213
+ use crate :: offers:: nonce:: Nonce ;
2212
2214
use crate :: offers:: offer:: OfferBuilder ;
2213
2215
use crate :: offers:: test_utils:: * ;
2214
2216
use crate :: routing:: gossip:: NetworkGraph ;
2215
2217
use crate :: routing:: router:: { InFlightHtlcs , Path , PaymentParameters , Route , RouteHop , RouteParameters } ;
2218
+ use crate :: sign:: KeyMaterial ;
2216
2219
use crate :: sync:: { Arc , Mutex , RwLock } ;
2217
2220
use crate :: util:: errors:: APIError ;
2218
2221
use crate :: util:: hash_tables:: new_hash_map;
@@ -2557,6 +2560,8 @@ mod tests {
2557
2560
let router = test_utils:: TestRouter :: new ( network_graph, & logger, & scorer) ;
2558
2561
let secp_ctx = Secp256k1 :: new ( ) ;
2559
2562
let keys_manager = test_utils:: TestKeysInterface :: new ( & [ 0 ; 32 ] , Network :: Testnet ) ;
2563
+ let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
2564
+ let nonce = Nonce ( [ 0 ; 16 ] ) ;
2560
2565
2561
2566
let pending_events = Mutex :: new ( VecDeque :: new ( ) ) ;
2562
2567
let outbound_payments = OutboundPayments :: new ( new_hash_map ( ) ) ;
@@ -2574,9 +2579,8 @@ mod tests {
2574
2579
let invoice = OfferBuilder :: new ( recipient_pubkey ( ) )
2575
2580
. amount_msats ( 1000 )
2576
2581
. build ( ) . unwrap ( )
2577
- . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
2578
- . build ( ) . unwrap ( )
2579
- . sign ( payer_sign) . unwrap ( )
2582
+ . request_invoice ( & expanded_key, nonce, & secp_ctx, payment_id) . unwrap ( )
2583
+ . build_and_sign ( ) . unwrap ( )
2580
2584
. respond_with_no_std ( payment_paths ( ) , payment_hash ( ) , created_at) . unwrap ( )
2581
2585
. build ( ) . unwrap ( )
2582
2586
. sign ( recipient_sign) . unwrap ( ) ;
@@ -2613,15 +2617,16 @@ mod tests {
2613
2617
2614
2618
let pending_events = Mutex :: new ( VecDeque :: new ( ) ) ;
2615
2619
let outbound_payments = OutboundPayments :: new ( new_hash_map ( ) ) ;
2620
+ let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
2621
+ let nonce = Nonce ( [ 0 ; 16 ] ) ;
2616
2622
let payment_id = PaymentId ( [ 0 ; 32 ] ) ;
2617
2623
let expiration = StaleExpiration :: AbsoluteTimeout ( Duration :: from_secs ( 100 ) ) ;
2618
2624
2619
2625
let invoice = OfferBuilder :: new ( recipient_pubkey ( ) )
2620
2626
. amount_msats ( 1000 )
2621
2627
. build ( ) . unwrap ( )
2622
- . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
2623
- . build ( ) . unwrap ( )
2624
- . sign ( payer_sign) . unwrap ( )
2628
+ . request_invoice ( & expanded_key, nonce, & secp_ctx, payment_id) . unwrap ( )
2629
+ . build_and_sign ( ) . unwrap ( )
2625
2630
. respond_with_no_std ( payment_paths ( ) , payment_hash ( ) , now ( ) ) . unwrap ( )
2626
2631
. build ( ) . unwrap ( )
2627
2632
. sign ( recipient_sign) . unwrap ( ) ;
@@ -2674,15 +2679,16 @@ mod tests {
2674
2679
2675
2680
let pending_events = Mutex :: new ( VecDeque :: new ( ) ) ;
2676
2681
let outbound_payments = OutboundPayments :: new ( new_hash_map ( ) ) ;
2682
+ let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
2683
+ let nonce = Nonce ( [ 0 ; 16 ] ) ;
2677
2684
let payment_id = PaymentId ( [ 0 ; 32 ] ) ;
2678
2685
let expiration = StaleExpiration :: AbsoluteTimeout ( Duration :: from_secs ( 100 ) ) ;
2679
2686
2680
2687
let invoice = OfferBuilder :: new ( recipient_pubkey ( ) )
2681
2688
. amount_msats ( 1000 )
2682
2689
. build ( ) . unwrap ( )
2683
- . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
2684
- . build ( ) . unwrap ( )
2685
- . sign ( payer_sign) . unwrap ( )
2690
+ . request_invoice ( & expanded_key, nonce, & secp_ctx, payment_id) . unwrap ( )
2691
+ . build_and_sign ( ) . unwrap ( )
2686
2692
. respond_with_no_std ( payment_paths ( ) , payment_hash ( ) , now ( ) ) . unwrap ( )
2687
2693
. build ( ) . unwrap ( )
2688
2694
. sign ( recipient_sign) . unwrap ( ) ;
0 commit comments