@@ -123,15 +123,7 @@ fn test_async_commitment_signature_for_commitment_signed() {
123123 let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
124124 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
125125 let nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
126- create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
127-
128- let chan_id = {
129- let per_peer_state = nodes[ 0 ] . node . per_peer_state . read ( ) . unwrap ( ) ;
130- let chan_lock = per_peer_state. get ( & nodes[ 1 ] . node . get_our_node_id ( ) ) . unwrap ( ) . lock ( ) . unwrap ( ) ;
131- let chan_ids = chan_lock. channel_by_id . keys ( ) . collect :: < Vec < _ > > ( ) ;
132- assert_eq ! ( chan_ids. len( ) , 1 , "expected one channel, not {}" , chan_ids. len( ) ) ;
133- * chan_ids[ 0 ]
134- } ;
126+ let ( _, _, chan_id, _) = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
135127
136128 // Send a payment.
137129 let src = & nodes[ 0 ] ;
@@ -278,15 +270,7 @@ fn test_async_commitment_signature_for_peer_disconnect() {
278270 let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
279271 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
280272 let nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
281- create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
282-
283- let chan_id = {
284- let per_peer_state = nodes[ 0 ] . node . per_peer_state . read ( ) . unwrap ( ) ;
285- let chan_lock = per_peer_state. get ( & nodes[ 1 ] . node . get_our_node_id ( ) ) . unwrap ( ) . lock ( ) . unwrap ( ) ;
286- let chan_ids = chan_lock. channel_by_id . keys ( ) . collect :: < Vec < _ > > ( ) ;
287- assert_eq ! ( chan_ids. len( ) , 1 , "expected one channel, not {}" , chan_ids. len( ) ) ;
288- * chan_ids[ 0 ]
289- } ;
273+ let ( _, _, chan_id, _) = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
290274
291275 // Send a payment.
292276 let src = & nodes[ 0 ] ;
0 commit comments