@@ -6,8 +6,9 @@ use serde::{Deserialize, Serialize};
66use simln_lib:: clock:: SimulationClock ;
77use simln_lib:: sim_node:: {
88 ln_node_from_graph, populate_network_graph, ChannelPolicy , CustomRecords , Interceptor ,
9- SimGraph , SimNode , SimulatedChannel ,
9+ PathFinder , SimGraph , SimulatedChannel ,
1010} ;
11+
1112use simln_lib:: {
1213 cln, cln:: ClnNode , eclair, eclair:: EclairNode , lnd, lnd:: LndNode , serializers,
1314 ActivityDefinition , Amount , Interval , LightningError , LightningNode , NodeId , NodeInfo ,
@@ -258,6 +259,7 @@ pub async fn create_simulation_with_network(
258259 tasks : TaskTracker ,
259260 interceptors : Vec < Arc < dyn Interceptor > > ,
260261 custom_records : CustomRecords ,
262+ pathfinder : P ,
261263) -> Result <
262264 (
263265 Simulation < SimulationClock > ,
@@ -308,20 +310,18 @@ pub async fn create_simulation_with_network(
308310 populate_network_graph ( channels, clock. clone ( ) )
309311 . map_err ( |e| SimulationError :: SimulatedNetworkError ( format ! ( "{:?}" , e) ) ) ?,
310312 ) ;
311-
312313 // We want the full set of nodes in our graph to return to the caller so that they can take
313314 // custom actions on the simulated network. For the nodes we'll pass our simulation, cast them
314315 // to a dyn trait and exclude any nodes that shouldn't be included in random activity
315316 // generation.
316- let nodes = ln_node_from_graph ( simulation_graph. clone ( ) , routing_graph, clock. clone ( ) ) . await ?;
317+ let nodes = ln_node_from_graph ( simulation_graph. clone ( ) , routing_graph, clock. clone ( ) , pathfinder ) . await ?;
317318 let mut nodes_dyn: HashMap < _ , Arc < Mutex < dyn LightningNode > > > = nodes
318319 . iter ( )
319320 . map ( |( pk, node) | ( * pk, Arc :: clone ( node) as Arc < Mutex < dyn LightningNode > > ) )
320321 . collect ( ) ;
321322 for pk in exclude {
322323 nodes_dyn. remove ( pk) ;
323324 }
324-
325325 let validated_activities =
326326 get_validated_activities ( & nodes_dyn, nodes_info, sim_params. activity . clone ( ) ) . await ?;
327327
@@ -339,6 +339,7 @@ pub async fn create_simulation_with_network(
339339 ) )
340340}
341341
342+
342343/// Parses the cli options provided and creates a simulation to be run, connecting to lightning nodes and validating
343344/// any activity described in the simulation file.
344345pub async fn create_simulation (
0 commit comments