@@ -26,13 +26,13 @@ use lightning_invoice::{Bolt11InvoiceDescription, Description};
2626use common:: {
2727 expect_channel_ready_event, expect_event, generate_blocks_and_wait, open_channel,
2828 open_channel_no_electrum_wait, premine_and_distribute_funds, random_config,
29- setup_bitcoind_and_electrsd, setup_node, TestChainSource , TestProbingConfig ,
29+ setup_bitcoind_and_electrsd, setup_node, TestChainSource , TestNode , TestProbingConfig ,
3030 TestProbingStrategy ,
3131} ;
3232
3333use ldk_node:: bitcoin:: secp256k1:: PublicKey ;
3434use ldk_node:: bitcoin:: Amount ;
35- use ldk_node:: { Event , Node , Probe , ProbingStrategy } ;
35+ use ldk_node:: { Event , Probe , ProbingStrategy } ;
3636
3737use rand:: rngs:: StdRng ;
3838use rand:: { Rng , SeedableRng } ;
@@ -100,21 +100,21 @@ fn probing_config(
100100
101101fn build_node_fixed_dest_probing (
102102 chain_source : & TestChainSource < ' _ > , destination_node_id : PublicKey ,
103- ) -> Node {
103+ ) -> TestNode {
104104 let mut config = random_config ( false ) ;
105105 let strategy = FixedDestStrategy :: new ( destination_node_id, PROBE_AMOUNT_MSAT ) ;
106106 config. probing = probing_config ( TestProbingStrategy :: Custom ( strategy) , PROBE_AMOUNT_MSAT , None ) ;
107107 setup_node ( chain_source, config)
108108}
109109
110- fn build_node_random_probing ( chain_source : & TestChainSource < ' _ > , max_hops : usize ) -> Node {
110+ fn build_node_random_probing ( chain_source : & TestChainSource < ' _ > , max_hops : usize ) -> TestNode {
111111 let mut config = config_with_label ( "Random" ) ;
112112 config. probing =
113113 probing_config ( TestProbingStrategy :: Random { max_hops } , MAX_LOCKED_MSAT , None ) ;
114114 setup_node ( chain_source, config)
115115}
116116
117- fn build_node_highdegree_probing ( chain_source : & TestChainSource < ' _ > , top_n : usize ) -> Node {
117+ fn build_node_highdegree_probing ( chain_source : & TestChainSource < ' _ > , top_n : usize ) -> TestNode {
118118 let mut config = config_with_label ( "HiDeg" ) ;
119119 config. probing =
120120 probing_config ( TestProbingStrategy :: HighDegree { top_n } , MAX_LOCKED_MSAT , None ) ;
@@ -123,7 +123,7 @@ fn build_node_highdegree_probing(chain_source: &TestChainSource<'_>, top_n: usiz
123123
124124fn build_node_z_highdegree_probing (
125125 chain_source : & TestChainSource < ' _ > , top_n : usize , diversity_penalty_msat : u64 ,
126- ) -> Node {
126+ ) -> TestNode {
127127 let mut config = config_with_label ( "HiDeg+P" ) ;
128128 config. probing = probing_config (
129129 TestProbingStrategy :: HighDegree { top_n } ,
@@ -134,7 +134,7 @@ fn build_node_z_highdegree_probing(
134134}
135135
136136// helpers, formatting
137- fn node_label ( node : & Node ) -> String {
137+ fn node_label ( node : & TestNode ) -> String {
138138 node. node_alias ( )
139139 . map ( |alias| {
140140 let end = alias. 0 . iter ( ) . position ( |& b| b == 0 ) . unwrap_or ( 32 ) ;
@@ -143,7 +143,7 @@ fn node_label(node: &Node) -> String {
143143 . unwrap_or_else ( || format ! ( "{:.8}" , node. node_id( ) ) )
144144}
145145
146- fn print_topology ( all_nodes : & [ & Node ] ) {
146+ fn print_topology ( all_nodes : & [ & TestNode ] ) {
147147 let labels: HashMap < PublicKey , String > =
148148 all_nodes. iter ( ) . map ( |n| ( n. node_id ( ) , node_label ( n) ) ) . collect ( ) ;
149149 let label_of = |pk : PublicKey | labels. get ( & pk) . cloned ( ) . unwrap_or_else ( || format ! ( "{:.8}" , pk) ) ;
@@ -195,7 +195,7 @@ fn fmt_est(est: Option<(u64, u64)>) -> String {
195195 }
196196}
197197
198- fn print_probing_perfomance ( observers : & [ & Node ] , all_nodes : & [ & Node ] ) {
198+ fn print_probing_perfomance ( observers : & [ & TestNode ] , all_nodes : & [ & TestNode ] ) {
199199 let labels: HashMap < PublicKey , String > =
200200 all_nodes. iter ( ) . chain ( observers. iter ( ) ) . map ( |n| ( n. node_id ( ) , node_label ( n) ) ) . collect ( ) ;
201201 let label_of = |pk : PublicKey | {
@@ -443,7 +443,7 @@ async fn probing_strategies_perfomance() {
443443 let utxos_per_node = num_nodes;
444444 let utxo_per_channel = Amount :: from_sat ( channel_capacity_sat + 50_000 ) ;
445445
446- let mut nodes: Vec < Node > = Vec :: new ( ) ;
446+ let mut nodes: Vec < TestNode > = Vec :: new ( ) ;
447447 for i in 0 ..num_nodes {
448448 let label = char:: from ( b'B' + i as u8 ) . to_string ( ) ;
449449 let mut config = random_config ( false ) ;
@@ -467,7 +467,7 @@ async fn probing_strategies_perfomance() {
467467 let channels_per_nodes: Vec < usize > =
468468 ( 0 ..num_nodes) . map ( |_| rng. random_range ( 1 ..=channels_per_node) ) . collect ( ) ;
469469
470- let observer_nodes: [ & Node ; 4 ] = [ & node_a, & node_y, & node_z, & node_x] ;
470+ let observer_nodes: [ & TestNode ; 4 ] = [ & node_a, & node_y, & node_z, & node_x] ;
471471
472472 let mut addresses = Vec :: new ( ) ;
473473 for node in observer_nodes {
@@ -489,7 +489,7 @@ async fn probing_strategies_perfomance() {
489489 node. sync_wallets ( ) . unwrap ( ) ;
490490 }
491491
492- fn drain_events ( node : & Node ) {
492+ fn drain_events ( node : & TestNode ) {
493493 while let Some ( _) = node. next_event ( ) {
494494 node. event_handled ( ) . unwrap ( ) ;
495495 }
@@ -523,7 +523,7 @@ async fn probing_strategies_perfomance() {
523523 node_map. insert ( node. node_id ( ) , i) ;
524524 }
525525
526- let all_nodes: Vec < & Node > = nodes. iter ( ) . chain ( observer_nodes) . collect ( ) ;
526+ let all_nodes: Vec < & TestNode > = nodes. iter ( ) . chain ( observer_nodes) . collect ( ) ;
527527
528528 print_topology ( & all_nodes) ;
529529
0 commit comments