@@ -4450,3 +4450,32 @@ fn remove_pending_outbound_probe_on_buggy_path() {
4450
4450
) ;
4451
4451
assert ! ( nodes[ 0 ] . node. list_recent_payments( ) . is_empty( ) ) ;
4452
4452
}
4453
+
4454
+ #[ test]
4455
+ fn pay_route_without_params ( ) {
4456
+ // Make sure we can use ChannelManager::send_payment_with_route to pay a route where
4457
+ // Route::route_parameters is None.
4458
+ let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
4459
+ let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
4460
+ let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
4461
+ let nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
4462
+ create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
4463
+
4464
+ let amt_msat = 10_000 ;
4465
+ let payment_params = PaymentParameters :: from_node_id ( nodes[ 1 ] . node . get_our_node_id ( ) , TEST_FINAL_CLTV )
4466
+ . with_bolt11_features ( nodes[ 1 ] . node . bolt11_invoice_features ( ) ) . unwrap ( ) ;
4467
+ let ( mut route, payment_hash, payment_preimage, payment_secret) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , payment_params, amt_msat) ;
4468
+ route. route_params . take ( ) ;
4469
+ nodes[ 0 ] . node . send_payment_with_route (
4470
+ route, payment_hash, RecipientOnionFields :: secret_only ( payment_secret) ,
4471
+ PaymentId ( payment_hash. 0 )
4472
+ ) . unwrap ( ) ;
4473
+ check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
4474
+ let mut events = nodes[ 0 ] . node . get_and_clear_pending_msg_events ( ) ;
4475
+ assert_eq ! ( events. len( ) , 1 ) ;
4476
+ let node_1_msgs = remove_first_msg_event_to_node ( & nodes[ 1 ] . node . get_our_node_id ( ) , & mut events) ;
4477
+ pass_along_path ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , amt_msat, payment_hash, Some ( payment_secret) , node_1_msgs, true , None ) ;
4478
+ claim_payment_along_route (
4479
+ ClaimAlongRouteArgs :: new ( & nodes[ 0 ] , & [ & [ & nodes[ 1 ] ] ] , payment_preimage)
4480
+ ) ;
4481
+ }
0 commit comments