@@ -2306,17 +2306,14 @@ fn do_test_trampoline_unblinded_receive(success: bool) {
23062306
23072307 let chanmon_cfgs = create_chanmon_cfgs ( TOTAL_NODE_COUNT ) ;
23082308 let node_cfgs = create_node_cfgs ( TOTAL_NODE_COUNT , & chanmon_cfgs) ;
2309- let node_chanmgrs =
2310- create_node_chanmgrs ( TOTAL_NODE_COUNT , & node_cfgs, & vec ! [ None ; TOTAL_NODE_COUNT ] ) ;
2309+ let user_cfgs = & vec ! [ None ; TOTAL_NODE_COUNT ] ;
2310+ let node_chanmgrs = create_node_chanmgrs ( TOTAL_NODE_COUNT , & node_cfgs, & user_cfgs ) ;
23112311 let mut nodes = create_network ( TOTAL_NODE_COUNT , & node_cfgs, & node_chanmgrs) ;
23122312
2313- let ( _, _, chan_id_alice_bob, _) =
2314- create_announced_chan_between_nodes_with_value ( & nodes, 0 , 1 , 1_000_000 , 0 ) ;
2315- let ( _, _, chan_id_bob_carol, _) =
2316- create_announced_chan_between_nodes_with_value ( & nodes, 1 , 2 , 1_000_000 , 0 ) ;
2313+ let alice_bob_chan = create_announced_chan_between_nodes_with_value ( & nodes, 0 , 1 , 1_000_000 , 0 ) ;
2314+ let bob_carol_chan = create_announced_chan_between_nodes_with_value ( & nodes, 1 , 2 , 1_000_000 , 0 ) ;
23172315
23182316 for i in 0 ..TOTAL_NODE_COUNT {
2319- // connect all nodes' blocks
23202317 connect_blocks (
23212318 & nodes[ i] ,
23222319 ( TOTAL_NODE_COUNT as u32 ) * CHAN_CONFIRM_DEPTH + 1 - nodes[ i] . best_block_info ( ) . 1 ,
@@ -2326,30 +2323,15 @@ fn do_test_trampoline_unblinded_receive(success: bool) {
23262323 let bob_node_id = nodes[ 1 ] . node ( ) . get_our_node_id ( ) ;
23272324 let carol_node_id = nodes[ 2 ] . node ( ) . get_our_node_id ( ) ;
23282325
2329- let alice_bob_scid = nodes[ 0 ]
2330- . node ( )
2331- . list_channels ( )
2332- . iter ( )
2333- . find ( |c| c. channel_id == chan_id_alice_bob)
2334- . unwrap ( )
2335- . short_channel_id
2336- . unwrap ( ) ;
2337- let bob_carol_scid = nodes[ 1 ]
2338- . node ( )
2339- . list_channels ( )
2340- . iter ( )
2341- . find ( |c| c. channel_id == chan_id_bob_carol)
2342- . unwrap ( )
2343- . short_channel_id
2344- . unwrap ( ) ;
2326+ let alice_bob_scid = get_scid_from_channel_id ( & nodes[ 0 ] , alice_bob_chan. 2 ) ;
2327+ let bob_carol_scid = get_scid_from_channel_id ( & nodes[ 1 ] , bob_carol_chan. 2 ) ;
23452328
23462329 let amt_msat = 1000 ;
23472330 let ( payment_preimage, payment_hash, payment_secret) =
23482331 get_payment_preimage_hash ( & nodes[ 2 ] , Some ( amt_msat) , None ) ;
23492332 let route = Route {
23502333 paths : vec ! [ Path {
23512334 hops: vec![
2352- // Bob
23532335 RouteHop {
23542336 pubkey: bob_node_id,
23552337 node_features: NodeFeatures :: empty( ) ,
@@ -2359,7 +2341,6 @@ fn do_test_trampoline_unblinded_receive(success: bool) {
23592341 cltv_expiry_delta: 48 ,
23602342 maybe_announced_channel: false ,
23612343 } ,
2362- // Carol
23632344 RouteHop {
23642345 pubkey: carol_node_id,
23652346 node_features: NodeFeatures :: empty( ) ,
@@ -2371,15 +2352,12 @@ fn do_test_trampoline_unblinded_receive(success: bool) {
23712352 } ,
23722353 ] ,
23732354 blinded_tail: Some ( BlindedTail {
2374- trampoline_hops: vec![
2375- // Carol
2376- TrampolineHop {
2377- pubkey: carol_node_id,
2378- node_features: Features :: empty( ) ,
2379- fee_msat: amt_msat,
2380- cltv_expiry_delta: 24 ,
2381- } ,
2382- ] ,
2355+ trampoline_hops: vec![ TrampolineHop {
2356+ pubkey: carol_node_id,
2357+ node_features: Features :: empty( ) ,
2358+ fee_msat: amt_msat,
2359+ cltv_expiry_delta: 24 ,
2360+ } ] ,
23832361 // The blinded path data is unused because we replace the onion of the last hop
23842362 hops: vec![ BlindedHop {
23852363 blinded_node_id: PublicKey :: from_slice( & [ 2 ; 33 ] ) . unwrap( ) ,
@@ -2476,8 +2454,7 @@ fn do_test_trampoline_unblinded_receive(success: bool) {
24762454
24772455 let mut events = nodes[ 0 ] . node . get_and_clear_pending_msg_events ( ) ;
24782456 assert_eq ! ( events. len( ) , 1 ) ;
2479- let mut first_message_event =
2480- remove_first_msg_event_to_node ( & nodes[ 1 ] . node . get_our_node_id ( ) , & mut events) ;
2457+ let mut first_message_event = remove_first_msg_event_to_node ( & bob_node_id, & mut events) ;
24812458 let mut update_message = match first_message_event {
24822459 MessageSendEvent :: UpdateHTLCs { ref mut updates, .. } => {
24832460 assert_eq ! ( updates. update_add_htlcs. len( ) , 1 ) ;
0 commit comments