@@ -123,15 +123,7 @@ fn test_async_commitment_signature_for_commitment_signed() {
123
123
let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
124
124
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
125
125
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 ) ;
135
127
136
128
// Send a payment.
137
129
let src = & nodes[ 0 ] ;
@@ -278,15 +270,7 @@ fn test_async_commitment_signature_for_peer_disconnect() {
278
270
let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
279
271
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
280
272
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 ) ;
290
274
291
275
// Send a payment.
292
276
let src = & nodes[ 0 ] ;
0 commit comments