@@ -2268,14 +2268,17 @@ mod tests {
2268
2268
use crate :: ln:: types:: { PaymentHash , PaymentPreimage } ;
2269
2269
use crate :: ln:: channelmanager:: { PaymentId , RecipientOnionFields } ;
2270
2270
use crate :: ln:: features:: { Bolt12InvoiceFeatures , ChannelFeatures , NodeFeatures } ;
2271
+ use crate :: ln:: inbound_payment:: ExpandedKey ;
2271
2272
use crate :: ln:: msgs:: { ErrorAction , LightningError } ;
2272
2273
use crate :: ln:: outbound_payment:: { Bolt12PaymentError , OutboundPayments , PendingOutboundPayment , Retry , RetryableSendFailure , StaleExpiration } ;
2273
2274
#[ cfg( feature = "std" ) ]
2274
2275
use crate :: offers:: invoice:: DEFAULT_RELATIVE_EXPIRY ;
2276
+ use crate :: offers:: nonce:: Nonce ;
2275
2277
use crate :: offers:: offer:: OfferBuilder ;
2276
2278
use crate :: offers:: test_utils:: * ;
2277
2279
use crate :: routing:: gossip:: NetworkGraph ;
2278
2280
use crate :: routing:: router:: { InFlightHtlcs , Path , PaymentParameters , Route , RouteHop , RouteParameters } ;
2281
+ use crate :: sign:: KeyMaterial ;
2279
2282
use crate :: sync:: { Arc , Mutex , RwLock } ;
2280
2283
use crate :: util:: errors:: APIError ;
2281
2284
use crate :: util:: hash_tables:: new_hash_map;
@@ -2620,6 +2623,8 @@ mod tests {
2620
2623
let router = test_utils:: TestRouter :: new ( network_graph, & logger, & scorer) ;
2621
2624
let secp_ctx = Secp256k1 :: new ( ) ;
2622
2625
let keys_manager = test_utils:: TestKeysInterface :: new ( & [ 0 ; 32 ] , Network :: Testnet ) ;
2626
+ let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
2627
+ let nonce = Nonce ( [ 0 ; 16 ] ) ;
2623
2628
2624
2629
let pending_events = Mutex :: new ( VecDeque :: new ( ) ) ;
2625
2630
let outbound_payments = OutboundPayments :: new ( new_hash_map ( ) ) ;
@@ -2637,9 +2642,8 @@ mod tests {
2637
2642
let invoice = OfferBuilder :: new ( recipient_pubkey ( ) )
2638
2643
. amount_msats ( 1000 )
2639
2644
. build ( ) . unwrap ( )
2640
- . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
2641
- . build ( ) . unwrap ( )
2642
- . sign ( payer_sign) . unwrap ( )
2645
+ . request_invoice ( & expanded_key, nonce, & secp_ctx, payment_id) . unwrap ( )
2646
+ . build_and_sign ( ) . unwrap ( )
2643
2647
. respond_with_no_std ( payment_paths ( ) , payment_hash ( ) , created_at) . unwrap ( )
2644
2648
. build ( ) . unwrap ( )
2645
2649
. sign ( recipient_sign) . unwrap ( ) ;
@@ -2676,15 +2680,16 @@ mod tests {
2676
2680
2677
2681
let pending_events = Mutex :: new ( VecDeque :: new ( ) ) ;
2678
2682
let outbound_payments = OutboundPayments :: new ( new_hash_map ( ) ) ;
2683
+ let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
2684
+ let nonce = Nonce ( [ 0 ; 16 ] ) ;
2679
2685
let payment_id = PaymentId ( [ 0 ; 32 ] ) ;
2680
2686
let expiration = StaleExpiration :: AbsoluteTimeout ( Duration :: from_secs ( 100 ) ) ;
2681
2687
2682
2688
let invoice = OfferBuilder :: new ( recipient_pubkey ( ) )
2683
2689
. amount_msats ( 1000 )
2684
2690
. build ( ) . unwrap ( )
2685
- . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
2686
- . build ( ) . unwrap ( )
2687
- . sign ( payer_sign) . unwrap ( )
2691
+ . request_invoice ( & expanded_key, nonce, & secp_ctx, payment_id) . unwrap ( )
2692
+ . build_and_sign ( ) . unwrap ( )
2688
2693
. respond_with_no_std ( payment_paths ( ) , payment_hash ( ) , now ( ) ) . unwrap ( )
2689
2694
. build ( ) . unwrap ( )
2690
2695
. sign ( recipient_sign) . unwrap ( ) ;
@@ -2737,15 +2742,16 @@ mod tests {
2737
2742
2738
2743
let pending_events = Mutex :: new ( VecDeque :: new ( ) ) ;
2739
2744
let outbound_payments = OutboundPayments :: new ( new_hash_map ( ) ) ;
2745
+ let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
2746
+ let nonce = Nonce ( [ 0 ; 16 ] ) ;
2740
2747
let payment_id = PaymentId ( [ 0 ; 32 ] ) ;
2741
2748
let expiration = StaleExpiration :: AbsoluteTimeout ( Duration :: from_secs ( 100 ) ) ;
2742
2749
2743
2750
let invoice = OfferBuilder :: new ( recipient_pubkey ( ) )
2744
2751
. amount_msats ( 1000 )
2745
2752
. build ( ) . unwrap ( )
2746
- . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
2747
- . build ( ) . unwrap ( )
2748
- . sign ( payer_sign) . unwrap ( )
2753
+ . request_invoice ( & expanded_key, nonce, & secp_ctx, payment_id) . unwrap ( )
2754
+ . build_and_sign ( ) . unwrap ( )
2749
2755
. respond_with_no_std ( payment_paths ( ) , payment_hash ( ) , now ( ) ) . unwrap ( )
2750
2756
. build ( ) . unwrap ( )
2751
2757
. sign ( recipient_sign) . unwrap ( ) ;
0 commit comments