@@ -2268,14 +2268,17 @@ mod tests {
22682268 use crate :: ln:: types:: { PaymentHash , PaymentPreimage } ;
22692269 use crate :: ln:: channelmanager:: { PaymentId , RecipientOnionFields } ;
22702270 use crate :: ln:: features:: { Bolt12InvoiceFeatures , ChannelFeatures , NodeFeatures } ;
2271+ use crate :: ln:: inbound_payment:: ExpandedKey ;
22712272 use crate :: ln:: msgs:: { ErrorAction , LightningError } ;
22722273 use crate :: ln:: outbound_payment:: { Bolt12PaymentError , OutboundPayments , PendingOutboundPayment , Retry , RetryableSendFailure , StaleExpiration } ;
22732274 #[ cfg( feature = "std" ) ]
22742275 use crate :: offers:: invoice:: DEFAULT_RELATIVE_EXPIRY ;
2276+ use crate :: offers:: nonce:: Nonce ;
22752277 use crate :: offers:: offer:: OfferBuilder ;
22762278 use crate :: offers:: test_utils:: * ;
22772279 use crate :: routing:: gossip:: NetworkGraph ;
22782280 use crate :: routing:: router:: { InFlightHtlcs , Path , PaymentParameters , Route , RouteHop , RouteParameters } ;
2281+ use crate :: sign:: KeyMaterial ;
22792282 use crate :: sync:: { Arc , Mutex , RwLock } ;
22802283 use crate :: util:: errors:: APIError ;
22812284 use crate :: util:: hash_tables:: new_hash_map;
@@ -2620,6 +2623,8 @@ mod tests {
26202623 let router = test_utils:: TestRouter :: new ( network_graph, & logger, & scorer) ;
26212624 let secp_ctx = Secp256k1 :: new ( ) ;
26222625 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 ] ) ;
26232628
26242629 let pending_events = Mutex :: new ( VecDeque :: new ( ) ) ;
26252630 let outbound_payments = OutboundPayments :: new ( new_hash_map ( ) ) ;
@@ -2637,9 +2642,8 @@ mod tests {
26372642 let invoice = OfferBuilder :: new ( recipient_pubkey ( ) )
26382643 . amount_msats ( 1000 )
26392644 . 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 ( )
26432647 . respond_with_no_std ( payment_paths ( ) , payment_hash ( ) , created_at) . unwrap ( )
26442648 . build ( ) . unwrap ( )
26452649 . sign ( recipient_sign) . unwrap ( ) ;
@@ -2676,15 +2680,16 @@ mod tests {
26762680
26772681 let pending_events = Mutex :: new ( VecDeque :: new ( ) ) ;
26782682 let outbound_payments = OutboundPayments :: new ( new_hash_map ( ) ) ;
2683+ let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
2684+ let nonce = Nonce ( [ 0 ; 16 ] ) ;
26792685 let payment_id = PaymentId ( [ 0 ; 32 ] ) ;
26802686 let expiration = StaleExpiration :: AbsoluteTimeout ( Duration :: from_secs ( 100 ) ) ;
26812687
26822688 let invoice = OfferBuilder :: new ( recipient_pubkey ( ) )
26832689 . amount_msats ( 1000 )
26842690 . 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 ( )
26882693 . respond_with_no_std ( payment_paths ( ) , payment_hash ( ) , now ( ) ) . unwrap ( )
26892694 . build ( ) . unwrap ( )
26902695 . sign ( recipient_sign) . unwrap ( ) ;
@@ -2737,15 +2742,16 @@ mod tests {
27372742
27382743 let pending_events = Mutex :: new ( VecDeque :: new ( ) ) ;
27392744 let outbound_payments = OutboundPayments :: new ( new_hash_map ( ) ) ;
2745+ let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
2746+ let nonce = Nonce ( [ 0 ; 16 ] ) ;
27402747 let payment_id = PaymentId ( [ 0 ; 32 ] ) ;
27412748 let expiration = StaleExpiration :: AbsoluteTimeout ( Duration :: from_secs ( 100 ) ) ;
27422749
27432750 let invoice = OfferBuilder :: new ( recipient_pubkey ( ) )
27442751 . amount_msats ( 1000 )
27452752 . 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 ( )
27492755 . respond_with_no_std ( payment_paths ( ) , payment_hash ( ) , now ( ) ) . unwrap ( )
27502756 . build ( ) . unwrap ( )
27512757 . sign ( recipient_sign) . unwrap ( ) ;
0 commit comments