@@ -1949,14 +1949,17 @@ mod tests {
1949
1949
use crate :: ln:: types:: PaymentHash ;
1950
1950
use crate :: ln:: channelmanager:: { PaymentId , RecipientOnionFields } ;
1951
1951
use crate :: ln:: features:: { Bolt12InvoiceFeatures , ChannelFeatures , NodeFeatures } ;
1952
+ use crate :: ln:: inbound_payment:: ExpandedKey ;
1952
1953
use crate :: ln:: msgs:: { ErrorAction , LightningError } ;
1953
1954
use crate :: ln:: outbound_payment:: { Bolt12PaymentError , OutboundPayments , Retry , RetryableSendFailure , StaleExpiration } ;
1954
1955
#[ cfg( feature = "std" ) ]
1955
1956
use crate :: offers:: invoice:: DEFAULT_RELATIVE_EXPIRY ;
1957
+ use crate :: offers:: nonce:: Nonce ;
1956
1958
use crate :: offers:: offer:: OfferBuilder ;
1957
1959
use crate :: offers:: test_utils:: * ;
1958
1960
use crate :: routing:: gossip:: NetworkGraph ;
1959
1961
use crate :: routing:: router:: { InFlightHtlcs , Path , PaymentParameters , Route , RouteHop , RouteParameters } ;
1962
+ use crate :: sign:: KeyMaterial ;
1960
1963
use crate :: sync:: { Arc , Mutex , RwLock } ;
1961
1964
use crate :: util:: errors:: APIError ;
1962
1965
use crate :: util:: test_utils;
@@ -2300,6 +2303,8 @@ mod tests {
2300
2303
let router = test_utils:: TestRouter :: new ( network_graph, & logger, & scorer) ;
2301
2304
let secp_ctx = Secp256k1 :: new ( ) ;
2302
2305
let keys_manager = test_utils:: TestKeysInterface :: new ( & [ 0 ; 32 ] , Network :: Testnet ) ;
2306
+ let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
2307
+ let nonce = Nonce ( [ 0 ; 16 ] ) ;
2303
2308
2304
2309
let pending_events = Mutex :: new ( VecDeque :: new ( ) ) ;
2305
2310
let outbound_payments = OutboundPayments :: new ( ) ;
@@ -2317,9 +2322,8 @@ mod tests {
2317
2322
let invoice = OfferBuilder :: new ( recipient_pubkey ( ) )
2318
2323
. amount_msats ( 1000 )
2319
2324
. build ( ) . unwrap ( )
2320
- . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
2321
- . build ( ) . unwrap ( )
2322
- . sign ( payer_sign) . unwrap ( )
2325
+ . request_invoice ( & expanded_key, nonce, & secp_ctx, payment_id) . unwrap ( )
2326
+ . build_and_sign ( ) . unwrap ( )
2323
2327
. respond_with_no_std ( payment_paths ( ) , payment_hash ( ) , created_at) . unwrap ( )
2324
2328
. build ( ) . unwrap ( )
2325
2329
. sign ( recipient_sign) . unwrap ( ) ;
@@ -2356,15 +2360,16 @@ mod tests {
2356
2360
2357
2361
let pending_events = Mutex :: new ( VecDeque :: new ( ) ) ;
2358
2362
let outbound_payments = OutboundPayments :: new ( ) ;
2363
+ let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
2364
+ let nonce = Nonce ( [ 0 ; 16 ] ) ;
2359
2365
let payment_id = PaymentId ( [ 0 ; 32 ] ) ;
2360
2366
let expiration = StaleExpiration :: AbsoluteTimeout ( Duration :: from_secs ( 100 ) ) ;
2361
2367
2362
2368
let invoice = OfferBuilder :: new ( recipient_pubkey ( ) )
2363
2369
. amount_msats ( 1000 )
2364
2370
. build ( ) . unwrap ( )
2365
- . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
2366
- . build ( ) . unwrap ( )
2367
- . sign ( payer_sign) . unwrap ( )
2371
+ . request_invoice ( & expanded_key, nonce, & secp_ctx, payment_id) . unwrap ( )
2372
+ . build_and_sign ( ) . unwrap ( )
2368
2373
. respond_with_no_std ( payment_paths ( ) , payment_hash ( ) , now ( ) ) . unwrap ( )
2369
2374
. build ( ) . unwrap ( )
2370
2375
. sign ( recipient_sign) . unwrap ( ) ;
@@ -2417,15 +2422,16 @@ mod tests {
2417
2422
2418
2423
let pending_events = Mutex :: new ( VecDeque :: new ( ) ) ;
2419
2424
let outbound_payments = OutboundPayments :: new ( ) ;
2425
+ let expanded_key = ExpandedKey :: new ( & KeyMaterial ( [ 42 ; 32 ] ) ) ;
2426
+ let nonce = Nonce ( [ 0 ; 16 ] ) ;
2420
2427
let payment_id = PaymentId ( [ 0 ; 32 ] ) ;
2421
2428
let expiration = StaleExpiration :: AbsoluteTimeout ( Duration :: from_secs ( 100 ) ) ;
2422
2429
2423
2430
let invoice = OfferBuilder :: new ( recipient_pubkey ( ) )
2424
2431
. amount_msats ( 1000 )
2425
2432
. build ( ) . unwrap ( )
2426
- . request_invoice ( vec ! [ 1 ; 32 ] , payer_pubkey ( ) ) . unwrap ( )
2427
- . build ( ) . unwrap ( )
2428
- . sign ( payer_sign) . unwrap ( )
2433
+ . request_invoice ( & expanded_key, nonce, & secp_ctx, payment_id) . unwrap ( )
2434
+ . build_and_sign ( ) . unwrap ( )
2429
2435
. respond_with_no_std ( payment_paths ( ) , payment_hash ( ) , now ( ) ) . unwrap ( )
2430
2436
. build ( ) . unwrap ( )
2431
2437
. sign ( recipient_sign) . unwrap ( ) ;
0 commit comments