Skip to content

Commit 2beccfa

Browse files
committed
simln-lib/refactor: fully deterministic produce events
simln-lib/refactor: fully deterministic produce events
1 parent 27fd6e3 commit 2beccfa

File tree

4 files changed

+202
-126
lines changed

4 files changed

+202
-126
lines changed

sim-cli/src/parsing.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use simln_lib::{
1414
Simulation, SimulationCfg, WriteResults,
1515
};
1616
use simln_lib::{ShortChannelID, SimulationError};
17-
use std::collections::HashMap;
17+
use std::collections::{BTreeMap, HashMap};
1818
use std::fs;
1919
use std::path::PathBuf;
2020
use std::sync::Arc;
@@ -357,12 +357,12 @@ async fn get_clients(
357357
nodes: Vec<NodeConnection>,
358358
) -> Result<
359359
(
360-
HashMap<PublicKey, Arc<Mutex<dyn LightningNode>>>,
360+
BTreeMap<PublicKey, Arc<Mutex<dyn LightningNode>>>,
361361
HashMap<PublicKey, NodeInfo>,
362362
),
363363
LightningError,
364364
> {
365-
let mut clients: HashMap<PublicKey, Arc<Mutex<dyn LightningNode>>> = HashMap::new();
365+
let mut clients: BTreeMap<PublicKey, Arc<Mutex<dyn LightningNode>>> = BTreeMap::new();
366366
let mut clients_info: HashMap<PublicKey, NodeInfo> = HashMap::new();
367367

368368
for connection in nodes {
@@ -574,7 +574,7 @@ pub async fn parse_sim_params(cli: &Cli) -> anyhow::Result<SimParams> {
574574
}
575575

576576
pub async fn get_validated_activities(
577-
clients: &HashMap<PublicKey, Arc<Mutex<dyn LightningNode>>>,
577+
clients: &BTreeMap<PublicKey, Arc<Mutex<dyn LightningNode>>>,
578578
nodes_info: HashMap<PublicKey, NodeInfo>,
579579
activity: Vec<ActivityParser>,
580580
) -> Result<Vec<ActivityDefinition>, LightningError> {

0 commit comments

Comments
 (0)