@@ -721,7 +721,7 @@ fn test_upfront_shutdown_script() {
721
721
722
722
// We test that in case of peer committing upfront to a script, if it changes at closing, we refuse to sign
723
723
let chan = create_announced_chan_between_nodes_with_value ( & nodes, 0 , 2 , 1000000 , 1000000 ) ;
724
- nodes[ 0 ] . node . close_channel ( & ChannelId :: v1_from_funding_outpoint ( OutPoint { txid : chan. 3 . txid ( ) , index : 0 } ) , & nodes[ 2 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
724
+ nodes[ 0 ] . node . close_channel ( & chan. 2 , & nodes[ 2 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
725
725
let node_0_orig_shutdown = get_event_msg ! ( nodes[ 0 ] , MessageSendEvent :: SendShutdown , nodes[ 2 ] . node. get_our_node_id( ) ) ;
726
726
let mut node_0_shutdown = node_0_orig_shutdown. clone ( ) ;
727
727
node_0_shutdown. scriptpubkey = Builder :: new ( ) . push_opcode ( opcodes:: all:: OP_RETURN ) . into_script ( ) . to_p2sh ( ) ;
@@ -736,7 +736,7 @@ fn test_upfront_shutdown_script() {
736
736
737
737
// We test that in case of peer committing upfront to a script, if it doesn't change at closing, we sign
738
738
let chan = create_announced_chan_between_nodes_with_value ( & nodes, 0 , 2 , 1000000 , 1000000 ) ;
739
- nodes[ 0 ] . node . close_channel ( & ChannelId :: v1_from_funding_outpoint ( OutPoint { txid : chan. 3 . txid ( ) , index : 0 } ) , & nodes[ 2 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
739
+ nodes[ 0 ] . node . close_channel ( & chan. 2 , & nodes[ 2 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
740
740
let node_0_shutdown = get_event_msg ! ( nodes[ 0 ] , MessageSendEvent :: SendShutdown , nodes[ 2 ] . node. get_our_node_id( ) ) ;
741
741
// We test that in case of peer committing upfront to a script, if it oesn't change at closing, we sign
742
742
nodes[ 2 ] . node . handle_shutdown ( & nodes[ 0 ] . node . get_our_node_id ( ) , & node_0_shutdown) ;
@@ -750,7 +750,7 @@ fn test_upfront_shutdown_script() {
750
750
// We test that if case of peer non-signaling we don't enforce committed script at channel opening
751
751
* nodes[ 0 ] . override_init_features . borrow_mut ( ) = Some ( nodes[ 0 ] . node . init_features ( ) . clear_upfront_shutdown_script ( ) ) ;
752
752
let chan = create_announced_chan_between_nodes_with_value ( & nodes, 0 , 1 , 1000000 , 1000000 ) ;
753
- nodes[ 0 ] . node . close_channel ( & ChannelId :: v1_from_funding_outpoint ( OutPoint { txid : chan. 3 . txid ( ) , index : 0 } ) , & nodes[ 1 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
753
+ nodes[ 0 ] . node . close_channel ( & chan. 2 , & nodes[ 1 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
754
754
let node_1_shutdown = get_event_msg ! ( nodes[ 0 ] , MessageSendEvent :: SendShutdown , nodes[ 1 ] . node. get_our_node_id( ) ) ;
755
755
nodes[ 1 ] . node . handle_shutdown ( & nodes[ 0 ] . node . get_our_node_id ( ) , & node_1_shutdown) ;
756
756
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
@@ -765,7 +765,7 @@ fn test_upfront_shutdown_script() {
765
765
// channel smoothly, opt-out is from channel initiator here
766
766
* nodes[ 0 ] . override_init_features . borrow_mut ( ) = None ;
767
767
let chan = create_announced_chan_between_nodes_with_value ( & nodes, 1 , 0 , 1000000 , 1000000 ) ;
768
- nodes[ 1 ] . node . close_channel ( & ChannelId :: v1_from_funding_outpoint ( OutPoint { txid : chan. 3 . txid ( ) , index : 0 } ) , & nodes[ 0 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
768
+ nodes[ 1 ] . node . close_channel ( & chan. 2 , & nodes[ 0 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
769
769
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
770
770
let node_0_shutdown = get_event_msg ! ( nodes[ 1 ] , MessageSendEvent :: SendShutdown , nodes[ 0 ] . node. get_our_node_id( ) ) ;
771
771
nodes[ 0 ] . node . handle_shutdown ( & nodes[ 1 ] . node . get_our_node_id ( ) , & node_0_shutdown) ;
@@ -779,7 +779,7 @@ fn test_upfront_shutdown_script() {
779
779
//// We test that if user opt-out, we provide a zero-length script at channel opening and we are able to close
780
780
//// channel smoothly
781
781
let chan = create_announced_chan_between_nodes_with_value ( & nodes, 0 , 1 , 1000000 , 1000000 ) ;
782
- nodes[ 1 ] . node . close_channel ( & ChannelId :: v1_from_funding_outpoint ( OutPoint { txid : chan. 3 . txid ( ) , index : 0 } ) , & nodes[ 0 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
782
+ nodes[ 1 ] . node . close_channel ( & chan. 2 , & nodes[ 0 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
783
783
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
784
784
let node_0_shutdown = get_event_msg ! ( nodes[ 1 ] , MessageSendEvent :: SendShutdown , nodes[ 0 ] . node. get_our_node_id( ) ) ;
785
785
nodes[ 0 ] . node . handle_shutdown ( & nodes[ 1 ] . node . get_our_node_id ( ) , & node_0_shutdown) ;
@@ -894,7 +894,7 @@ fn test_segwit_v0_shutdown_script() {
894
894
let nodes = create_network ( 3 , & node_cfgs, & node_chanmgrs) ;
895
895
896
896
let chan = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
897
- nodes[ 1 ] . node . close_channel ( & ChannelId :: v1_from_funding_outpoint ( OutPoint { txid : chan. 3 . txid ( ) , index : 0 } ) , & nodes[ 0 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
897
+ nodes[ 1 ] . node . close_channel ( & chan. 2 , & nodes[ 0 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
898
898
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
899
899
900
900
// Use a segwit v0 script supported even without option_shutdown_anysegwit
@@ -929,7 +929,7 @@ fn test_anysegwit_shutdown_script() {
929
929
let nodes = create_network ( 3 , & node_cfgs, & node_chanmgrs) ;
930
930
931
931
let chan = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
932
- nodes[ 1 ] . node . close_channel ( & ChannelId :: v1_from_funding_outpoint ( OutPoint { txid : chan. 3 . txid ( ) , index : 0 } ) , & nodes[ 0 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
932
+ nodes[ 1 ] . node . close_channel ( & chan. 2 , & nodes[ 0 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
933
933
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
934
934
935
935
// Use a non-v0 segwit script supported by option_shutdown_anysegwit
@@ -975,14 +975,14 @@ fn test_unsupported_anysegwit_shutdown_script() {
975
975
. expect ( OnGetShutdownScriptpubkey { returns : supported_shutdown_script } ) ;
976
976
977
977
let chan = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
978
- match nodes[ 1 ] . node . close_channel ( & ChannelId :: v1_from_funding_outpoint ( OutPoint { txid : chan. 3 . txid ( ) , index : 0 } ) , & nodes[ 0 ] . node . get_our_node_id ( ) ) {
978
+ match nodes[ 1 ] . node . close_channel ( & chan. 2 , & nodes[ 0 ] . node . get_our_node_id ( ) ) {
979
979
Err ( APIError :: IncompatibleShutdownScript { script } ) => {
980
980
assert_eq ! ( script. into_inner( ) , unsupported_shutdown_script. clone( ) . into_inner( ) ) ;
981
981
} ,
982
982
Err ( e) => panic ! ( "Unexpected error: {:?}" , e) ,
983
983
Ok ( _) => panic ! ( "Expected error" ) ,
984
984
}
985
- nodes[ 1 ] . node . close_channel ( & ChannelId :: v1_from_funding_outpoint ( OutPoint { txid : chan. 3 . txid ( ) , index : 0 } ) , & nodes[ 0 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
985
+ nodes[ 1 ] . node . close_channel ( & chan. 2 , & nodes[ 0 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
986
986
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
987
987
988
988
// Use a non-v0 segwit script unsupported without option_shutdown_anysegwit
@@ -1007,7 +1007,7 @@ fn test_invalid_shutdown_script() {
1007
1007
let nodes = create_network ( 3 , & node_cfgs, & node_chanmgrs) ;
1008
1008
1009
1009
let chan = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
1010
- nodes[ 1 ] . node . close_channel ( & ChannelId :: v1_from_funding_outpoint ( OutPoint { txid : chan. 3 . txid ( ) , index : 0 } ) , & nodes[ 0 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
1010
+ nodes[ 1 ] . node . close_channel ( & chan. 2 , & nodes[ 0 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
1011
1011
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
1012
1012
1013
1013
// Use a segwit v0 script with an unsupported witness program
@@ -1041,7 +1041,7 @@ fn test_user_shutdown_script() {
1041
1041
let shutdown_script = ShutdownScript :: try_from ( script. clone ( ) ) . unwrap ( ) ;
1042
1042
1043
1043
let chan = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
1044
- nodes[ 1 ] . node . close_channel_with_feerate_and_script ( & ChannelId :: v1_from_funding_outpoint ( OutPoint { txid : chan. 3 . txid ( ) , index : 0 } ) , & nodes[ 0 ] . node . get_our_node_id ( ) , None , Some ( shutdown_script) ) . unwrap ( ) ;
1044
+ nodes[ 1 ] . node . close_channel_with_feerate_and_script ( & chan. 2 , & nodes[ 0 ] . node . get_our_node_id ( ) , None , Some ( shutdown_script) ) . unwrap ( ) ;
1045
1045
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
1046
1046
1047
1047
let mut node_0_shutdown = get_event_msg ! ( nodes[ 1 ] , MessageSendEvent :: SendShutdown , nodes[ 0 ] . node. get_our_node_id( ) ) ;
@@ -1068,7 +1068,7 @@ fn test_already_set_user_shutdown_script() {
1068
1068
let shutdown_script = ShutdownScript :: try_from ( script) . unwrap ( ) ;
1069
1069
1070
1070
let chan = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
1071
- let result = nodes[ 1 ] . node . close_channel_with_feerate_and_script ( & ChannelId :: v1_from_funding_outpoint ( OutPoint { txid : chan. 3 . txid ( ) , index : 0 } ) , & nodes[ 0 ] . node . get_our_node_id ( ) , None , Some ( shutdown_script) ) ;
1071
+ let result = nodes[ 1 ] . node . close_channel_with_feerate_and_script ( & chan. 2 , & nodes[ 0 ] . node . get_our_node_id ( ) , None , Some ( shutdown_script) ) ;
1072
1072
1073
1073
assert_eq ! ( result, Err ( APIError :: APIMisuseError { err: "Cannot override shutdown script for a channel with one already set" . to_string( ) } ) ) ;
1074
1074
}
@@ -1200,7 +1200,7 @@ fn do_simple_legacy_shutdown_test(high_initiator_fee: bool) {
1200
1200
* feerate_lock *= 10 ;
1201
1201
}
1202
1202
1203
- nodes[ 0 ] . node . close_channel ( & ChannelId :: v1_from_funding_outpoint ( OutPoint { txid : chan. 3 . txid ( ) , index : 0 } ) , & nodes[ 1 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
1203
+ nodes[ 0 ] . node . close_channel ( & chan. 2 , & nodes[ 1 ] . node . get_our_node_id ( ) ) . unwrap ( ) ;
1204
1204
let node_0_shutdown = get_event_msg ! ( nodes[ 0 ] , MessageSendEvent :: SendShutdown , nodes[ 1 ] . node. get_our_node_id( ) ) ;
1205
1205
nodes[ 1 ] . node . handle_shutdown ( & nodes[ 0 ] . node . get_our_node_id ( ) , & node_0_shutdown) ;
1206
1206
let node_1_shutdown = get_event_msg ! ( nodes[ 1 ] , MessageSendEvent :: SendShutdown , nodes[ 0 ] . node. get_our_node_id( ) ) ;
0 commit comments