@@ -1952,14 +1952,17 @@ mod tests {
1952
1952
use crate :: ln:: types:: PaymentHash ;
1953
1953
use crate :: ln:: channelmanager:: { PaymentId , RecipientOnionFields } ;
1954
1954
use crate :: ln:: features:: { ChannelFeatures , NodeFeatures } ;
1955
+ use crate :: ln:: inbound_payment:: ExpandedKey ;
1955
1956
use crate :: ln:: msgs:: { ErrorAction , LightningError } ;
1956
1957
use crate :: ln:: outbound_payment:: { Bolt12PaymentError , OutboundPayments , Retry , RetryableSendFailure , StaleExpiration } ;
1957
1958
#[ cfg( feature = "std" ) ]
1958
1959
use crate :: offers:: invoice:: DEFAULT_RELATIVE_EXPIRY ;
1960
+ use crate :: offers:: nonce:: Nonce ;
1959
1961
use crate :: offers:: offer:: OfferBuilder ;
1960
1962
use crate :: offers:: test_utils:: * ;
1961
1963
use crate :: routing:: gossip:: NetworkGraph ;
1962
1964
use crate :: routing:: router:: { InFlightHtlcs , Path , PaymentParameters , Route , RouteHop , RouteParameters } ;
1965
+ use crate :: sign:: KeyMaterial ;
1963
1966
use crate :: sync:: { Arc , Mutex , RwLock } ;
1964
1967
use crate :: util:: errors:: APIError ;
1965
1968
use crate :: util:: test_utils;
@@ -2293,6 +2296,8 @@ mod tests {
2293
2296
let router = test_utils:: TestRouter :: new ( network_graph, & logger, & scorer) ;
2294
2297
let secp_ctx = Secp256k1 :: new ( ) ;
2295
2298
let keys_manager = test_utils:: TestKeysInterface :: new ( & [ 0 ; 32 ] , Network :: Testnet ) ;
2299
+ let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
2300
+ let nonce = Nonce ( [ 0 ; 16 ] ) ;
2296
2301
2297
2302
let pending_events = Mutex :: new ( VecDeque :: new ( ) ) ;
2298
2303
let outbound_payments = OutboundPayments :: new ( ) ;
@@ -2310,9 +2315,8 @@ mod tests {
2310
2315
let invoice = OfferBuilder :: new ( recipient_pubkey ( ) )
2311
2316
. amount_msats ( 1000 )
2312
2317
. build ( ) . unwrap ( )
2313
- . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
2314
- . build ( ) . unwrap ( )
2315
- . sign ( payer_sign) . unwrap ( )
2318
+ . request_invoice ( & expanded_key, nonce, & secp_ctx, payment_id) . unwrap ( )
2319
+ . build_and_sign ( ) . unwrap ( )
2316
2320
. respond_with_no_std ( payment_paths ( ) , payment_hash ( ) , created_at) . unwrap ( )
2317
2321
. build ( ) . unwrap ( )
2318
2322
. sign ( recipient_sign) . unwrap ( ) ;
@@ -2349,15 +2353,16 @@ mod tests {
2349
2353
2350
2354
let pending_events = Mutex :: new ( VecDeque :: new ( ) ) ;
2351
2355
let outbound_payments = OutboundPayments :: new ( ) ;
2356
+ let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
2357
+ let nonce = Nonce ( [ 0 ; 16 ] ) ;
2352
2358
let payment_id = PaymentId ( [ 0 ; 32 ] ) ;
2353
2359
let expiration = StaleExpiration :: AbsoluteTimeout ( Duration :: from_secs ( 100 ) ) ;
2354
2360
2355
2361
let invoice = OfferBuilder :: new ( recipient_pubkey ( ) )
2356
2362
. amount_msats ( 1000 )
2357
2363
. build ( ) . unwrap ( )
2358
- . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
2359
- . build ( ) . unwrap ( )
2360
- . sign ( payer_sign) . unwrap ( )
2364
+ . request_invoice ( & expanded_key, nonce, & secp_ctx, payment_id) . unwrap ( )
2365
+ . build_and_sign ( ) . unwrap ( )
2361
2366
. respond_with_no_std ( payment_paths ( ) , payment_hash ( ) , now ( ) ) . unwrap ( )
2362
2367
. build ( ) . unwrap ( )
2363
2368
. sign ( recipient_sign) . unwrap ( ) ;
@@ -2410,15 +2415,16 @@ mod tests {
2410
2415
2411
2416
let pending_events = Mutex :: new ( VecDeque :: new ( ) ) ;
2412
2417
let outbound_payments = OutboundPayments :: new ( ) ;
2418
+ let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
2419
+ let nonce = Nonce ( [ 0 ; 16 ] ) ;
2413
2420
let payment_id = PaymentId ( [ 0 ; 32 ] ) ;
2414
2421
let expiration = StaleExpiration :: AbsoluteTimeout ( Duration :: from_secs ( 100 ) ) ;
2415
2422
2416
2423
let invoice = OfferBuilder :: new ( recipient_pubkey ( ) )
2417
2424
. amount_msats ( 1000 )
2418
2425
. build ( ) . unwrap ( )
2419
- . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
2420
- . build ( ) . unwrap ( )
2421
- . sign ( payer_sign) . unwrap ( )
2426
+ . request_invoice ( & expanded_key, nonce, & secp_ctx, payment_id) . unwrap ( )
2427
+ . build_and_sign ( ) . unwrap ( )
2422
2428
. respond_with_no_std ( payment_paths ( ) , payment_hash ( ) , now ( ) ) . unwrap ( )
2423
2429
. build ( ) . unwrap ( )
2424
2430
. sign ( recipient_sign) . unwrap ( ) ;
0 commit comments