@@ -46,7 +46,7 @@ use core::time::Duration;
46
46
use crate :: blinded_path:: { BlindedPath , IntroductionNode } ;
47
47
use crate :: blinded_path:: payment:: { Bolt12OfferContext , Bolt12RefundContext , PaymentContext } ;
48
48
use crate :: events:: { Event , MessageSendEventsProvider , PaymentPurpose } ;
49
- use crate :: ln:: channelmanager:: { PaymentId , RecentPaymentDetails , Retry , self } ;
49
+ use crate :: ln:: channelmanager:: { MAX_SHORT_LIVED_RELATIVE_EXPIRY , PaymentId , RecentPaymentDetails , Retry , self } ;
50
50
use crate :: ln:: functional_test_utils:: * ;
51
51
use crate :: ln:: msgs:: { ChannelMessageHandler , Init , NodeAnnouncement , OnionMessage , OnionMessageHandler , RoutingMessageHandler , SocketAddress , UnsignedGossipMessage , UnsignedNodeAnnouncement } ;
52
52
use crate :: offers:: invoice:: Bolt12Invoice ;
@@ -366,7 +366,7 @@ fn creates_short_lived_offer() {
366
366
let alice_id = alice. node . get_our_node_id ( ) ;
367
367
let bob = & nodes[ 1 ] ;
368
368
369
- let absolute_expiry = alice. node . duration_since_epoch ( ) + Duration :: from_secs ( 60 * 60 * 24 ) ;
369
+ let absolute_expiry = alice. node . duration_since_epoch ( ) + MAX_SHORT_LIVED_RELATIVE_EXPIRY ;
370
370
let offer = alice. node
371
371
. create_offer_builder ( Some ( absolute_expiry) ) . unwrap ( )
372
372
. build ( ) . unwrap ( ) ;
@@ -392,9 +392,11 @@ fn creates_long_lived_offer() {
392
392
let alice = & nodes[ 0 ] ;
393
393
let alice_id = alice. node . get_our_node_id ( ) ;
394
394
395
- let absolute_expiry = alice. node . duration_since_epoch ( ) + Duration :: from_secs ( 60 * 60 * 25 ) ;
395
+ let absolute_expiry = alice. node . duration_since_epoch ( ) + MAX_SHORT_LIVED_RELATIVE_EXPIRY
396
+ + Duration :: from_secs ( 1 ) ;
396
397
let offer = alice. node
397
- . create_offer_builder ( Some ( absolute_expiry) ) . unwrap ( )
398
+ . create_offer_builder ( Some ( absolute_expiry) )
399
+ . unwrap ( )
398
400
. build ( ) . unwrap ( ) ;
399
401
assert_eq ! ( offer. absolute_expiry( ) , Some ( absolute_expiry) ) ;
400
402
assert ! ( !offer. paths( ) . is_empty( ) ) ;
@@ -426,7 +428,7 @@ fn creates_short_lived_refund() {
426
428
let bob = & nodes[ 1 ] ;
427
429
let bob_id = bob. node . get_our_node_id ( ) ;
428
430
429
- let absolute_expiry = bob. node . duration_since_epoch ( ) + Duration :: from_secs ( 60 * 60 * 24 ) ;
431
+ let absolute_expiry = bob. node . duration_since_epoch ( ) + MAX_SHORT_LIVED_RELATIVE_EXPIRY ;
430
432
let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
431
433
let refund = bob. node
432
434
. create_refund_builder ( 10_000_000 , absolute_expiry, payment_id, Retry :: Attempts ( 0 ) , None )
@@ -454,7 +456,8 @@ fn creates_long_lived_refund() {
454
456
let bob = & nodes[ 1 ] ;
455
457
let bob_id = bob. node . get_our_node_id ( ) ;
456
458
457
- let absolute_expiry = bob. node . duration_since_epoch ( ) + Duration :: from_secs ( 60 * 60 * 25 ) ;
459
+ let absolute_expiry = bob. node . duration_since_epoch ( ) + MAX_SHORT_LIVED_RELATIVE_EXPIRY
460
+ + Duration :: from_secs ( 1 ) ;
458
461
let payment_id = PaymentId ( [ 1 ; 32 ] ) ;
459
462
let refund = bob. node
460
463
. create_refund_builder ( 10_000_000 , absolute_expiry, payment_id, Retry :: Attempts ( 0 ) , None )
0 commit comments