@@ -19,7 +19,7 @@ use ln::functional_test_utils::*;
1919fn test_simple_monitor_permanent_update_fail ( ) {
2020 // Test that we handle a simple permanent monitor update failure
2121 let mut nodes = create_network ( 2 , & [ None , None ] ) ;
22- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
22+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
2323
2424 let route = nodes[ 0 ] . router . get_route ( & nodes[ 1 ] . node . get_our_node_id ( ) , None , & Vec :: new ( ) , 1000000 , TEST_FINAL_CLTV ) . unwrap ( ) ;
2525 let ( _, payment_hash_1) = get_payment_preimage_hash ! ( nodes[ 0 ] ) ;
@@ -49,7 +49,7 @@ fn do_test_simple_monitor_temporary_update_fail(disconnect: bool) {
4949 // Test that we can recover from a simple temporary monitor update failure optionally with
5050 // a disconnect in between
5151 let mut nodes = create_network ( 2 , & [ None , None ] ) ;
52- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
52+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
5353
5454 let route = nodes[ 0 ] . router . get_route ( & nodes[ 1 ] . node . get_our_node_id ( ) , None , & Vec :: new ( ) , 1000000 , TEST_FINAL_CLTV ) . unwrap ( ) ;
5555 let ( payment_preimage_1, payment_hash_1) = get_payment_preimage_hash ! ( nodes[ 0 ] ) ;
@@ -148,7 +148,7 @@ fn do_test_monitor_temporary_update_fail(disconnect_count: usize) {
148148 // through, swapping message ordering based on disconnect_count & 8 and optionally
149149 // disconnect/reconnecting based on disconnect_count.
150150 let mut nodes = create_network ( 2 , & [ None , None ] ) ;
151- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
151+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
152152
153153 let ( payment_preimage_1, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 1000000 ) ;
154154
@@ -474,7 +474,7 @@ fn test_monitor_temporary_update_fail_c() {
474474fn test_monitor_update_fail_cs ( ) {
475475 // Tests handling of a monitor update failure when processing an incoming commitment_signed
476476 let mut nodes = create_network ( 2 , & [ None , None ] ) ;
477- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
477+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
478478
479479 let route = nodes[ 0 ] . router . get_route ( & nodes[ 1 ] . node . get_our_node_id ( ) , None , & Vec :: new ( ) , 1000000 , TEST_FINAL_CLTV ) . unwrap ( ) ;
480480 let ( payment_preimage, our_payment_hash) = get_payment_preimage_hash ! ( nodes[ 0 ] ) ;
@@ -553,7 +553,7 @@ fn test_monitor_update_fail_no_rebroadcast() {
553553 // test_restore_channel_monitor() is required. Backported from
554554 // chanmon_fail_consistency fuzz tests.
555555 let mut nodes = create_network ( 2 , & [ None , None ] ) ;
556- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
556+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
557557
558558 let route = nodes[ 0 ] . router . get_route ( & nodes[ 1 ] . node . get_our_node_id ( ) , None , & Vec :: new ( ) , 1000000 , TEST_FINAL_CLTV ) . unwrap ( ) ;
559559 let ( payment_preimage_1, our_payment_hash) = get_payment_preimage_hash ! ( nodes[ 0 ] ) ;
@@ -595,7 +595,7 @@ fn test_monitor_update_raa_while_paused() {
595595 // Tests handling of an RAA while monitor updating has already been marked failed.
596596 // Backported from chanmon_fail_consistency fuzz tests as this used to be broken.
597597 let mut nodes = create_network ( 2 , & [ None , None ] ) ;
598- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
598+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
599599
600600 send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 5000000 , 5_000_000 ) ;
601601
@@ -662,8 +662,8 @@ fn test_monitor_update_raa_while_paused() {
662662fn do_test_monitor_update_fail_raa ( test_ignore_second_cs : bool ) {
663663 // Tests handling of a monitor update failure when processing an incoming RAA
664664 let mut nodes = create_network ( 3 , & [ None , None , None ] ) ;
665- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
666- let chan_2 = create_announced_chan_between_nodes ( & nodes, 1 , 2 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
665+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
666+ let chan_2 = create_announced_chan_between_nodes ( & nodes, 1 , 2 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
667667
668668 // Rebalance a bit so that we can send backwards from 2 to 1.
669669 send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] , & nodes[ 2 ] ] , 5000000 , 5_000_000 ) ;
@@ -915,8 +915,8 @@ fn test_monitor_update_fail_reestablish() {
915915 // channel_reestablish generating a monitor update (which comes from freeing holding cell
916916 // HTLCs).
917917 let mut nodes = create_network ( 3 , & [ None , None , None ] ) ;
918- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
919- create_announced_chan_between_nodes ( & nodes, 1 , 2 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
918+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
919+ create_announced_chan_between_nodes ( & nodes, 1 , 2 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
920920
921921 let ( our_payment_preimage, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] , & nodes[ 2 ] ] , 1000000 ) ;
922922
@@ -993,7 +993,7 @@ fn raa_no_response_awaiting_raa_state() {
993993 // in question (assuming it intends to respond with a CS after monitor updating is restored).
994994 // Backported from chanmon_fail_consistency fuzz tests as this used to be broken.
995995 let mut nodes = create_network ( 2 , & [ None , None ] ) ;
996- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
996+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
997997
998998 let route = nodes[ 0 ] . router . get_route ( & nodes[ 1 ] . node . get_our_node_id ( ) , None , & Vec :: new ( ) , 1000000 , TEST_FINAL_CLTV ) . unwrap ( ) ;
999999 let ( payment_preimage_1, payment_hash_1) = get_payment_preimage_hash ! ( nodes[ 0 ] ) ;
@@ -1106,7 +1106,7 @@ fn claim_while_disconnected_monitor_update_fail() {
11061106 // code introduced a regression in this test (specifically, this caught a removal of the
11071107 // channel_reestablish handling ensuring the order was sensical given the messages used).
11081108 let mut nodes = create_network ( 2 , & [ None , None ] ) ;
1109- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
1109+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
11101110
11111111 // Forward a payment for B to claim
11121112 let ( payment_preimage_1, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 1000000 ) ;
@@ -1221,7 +1221,7 @@ fn monitor_failed_no_reestablish_response() {
12211221 // Backported from chanmon_fail_consistency fuzz tests as it caught a long-standing
12221222 // debug_assert!() failure in channel_reestablish handling.
12231223 let mut nodes = create_network ( 2 , & [ None , None ] ) ;
1224- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
1224+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
12251225
12261226 // Route the payment and deliver the initial commitment_signed (with a monitor update failure
12271227 // on receipt).
@@ -1287,7 +1287,7 @@ fn first_message_on_recv_ordering() {
12871287 // payment applied).
12881288 // Backported from chanmon_fail_consistency fuzz tests as it caught a bug here.
12891289 let mut nodes = create_network ( 2 , & [ None , None ] ) ;
1290- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
1290+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
12911291
12921292 // Route the first payment outbound, holding the last RAA for B until we are set up so that we
12931293 // can deliver it and fail the monitor update.
@@ -1372,8 +1372,8 @@ fn test_monitor_update_fail_claim() {
13721372 // payment from B to A fail due to the paused channel. Finally, we restore the channel monitor
13731373 // updating and claim the payment on B.
13741374 let mut nodes = create_network ( 3 , & [ None , None , None ] ) ;
1375- let chan_1 = create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
1376- create_announced_chan_between_nodes ( & nodes, 1 , 2 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
1375+ let chan_1 = create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
1376+ create_announced_chan_between_nodes ( & nodes, 1 , 2 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
13771377
13781378 // Rebalance a bit so that we can send backwards from 3 to 2.
13791379 send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] , & nodes[ 2 ] ] , 5000000 , 5_000_000 ) ;
@@ -1445,8 +1445,8 @@ fn test_monitor_update_on_pending_forwards() {
14451445 // The payment from A to C will be failed by C and pending a back-fail to A, while the payment
14461446 // from C to A will be pending a forward to A.
14471447 let mut nodes = create_network ( 3 , & [ None , None , None ] ) ;
1448- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
1449- create_announced_chan_between_nodes ( & nodes, 1 , 2 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
1448+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
1449+ create_announced_chan_between_nodes ( & nodes, 1 , 2 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
14501450
14511451 // Rebalance a bit so that we can send backwards from 3 to 1.
14521452 send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] , & nodes[ 2 ] ] , 5000000 , 5_000_000 ) ;
@@ -1510,7 +1510,7 @@ fn monitor_update_claim_fail_no_response() {
15101510 // Backported from chanmon_fail_consistency fuzz tests as an unmerged version of the handling
15111511 // code was broken.
15121512 let mut nodes = create_network ( 2 , & [ None , None ] ) ;
1513- create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: new ( ) , Features :: < FeatureContextInit > :: new ( ) ) ;
1513+ create_announced_chan_between_nodes ( & nodes, 0 , 1 , Features :: < FeatureContextInit > :: supported ( ) , Features :: < FeatureContextInit > :: supported ( ) ) ;
15141514
15151515 // Forward a payment for B to claim
15161516 let ( payment_preimage_1, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 1000000 ) ;
@@ -1571,8 +1571,8 @@ fn do_during_funding_monitor_fail(fail_on_generate: bool, restore_between_fails:
15711571 let mut nodes = create_network ( 2 , & [ None , None ] ) ;
15721572
15731573 nodes[ 0 ] . node . create_channel ( nodes[ 1 ] . node . get_our_node_id ( ) , 100000 , 10001 , 43 ) . unwrap ( ) ;
1574- nodes[ 1 ] . node . handle_open_channel ( & nodes[ 0 ] . node . get_our_node_id ( ) , Features :: < FeatureContextInit > :: new ( ) , & get_event_msg ! ( nodes[ 0 ] , MessageSendEvent :: SendOpenChannel , nodes[ 1 ] . node. get_our_node_id( ) ) ) ;
1575- nodes[ 0 ] . node . handle_accept_channel ( & nodes[ 1 ] . node . get_our_node_id ( ) , Features :: < FeatureContextInit > :: new ( ) , & get_event_msg ! ( nodes[ 1 ] , MessageSendEvent :: SendAcceptChannel , nodes[ 0 ] . node. get_our_node_id( ) ) ) ;
1574+ nodes[ 1 ] . node . handle_open_channel ( & nodes[ 0 ] . node . get_our_node_id ( ) , Features :: < FeatureContextInit > :: supported ( ) , & get_event_msg ! ( nodes[ 0 ] , MessageSendEvent :: SendOpenChannel , nodes[ 1 ] . node. get_our_node_id( ) ) ) ;
1575+ nodes[ 0 ] . node . handle_accept_channel ( & nodes[ 1 ] . node . get_our_node_id ( ) , Features :: < FeatureContextInit > :: supported ( ) , & get_event_msg ! ( nodes[ 1 ] , MessageSendEvent :: SendAcceptChannel , nodes[ 0 ] . node. get_our_node_id( ) ) ) ;
15761576
15771577 let ( temporary_channel_id, funding_tx, funding_output) = create_funding_transaction ( & nodes[ 0 ] , 100000 , 43 ) ;
15781578
0 commit comments