Skip to content

Commit

Permalink
Minor logging and scope changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cndolo committed Jan 18, 2024
1 parent b5fe23c commit 6509403
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion network-parser/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ where
D: Deserializer<'de>,
{
let str_sequence = String::deserialize(deserializer)?;
println!("str_sequence {}", str_sequence);
if str_sequence.is_empty() {
Ok(None)
} else {
Expand Down
8 changes: 4 additions & 4 deletions simulator/src/core_types/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ impl Graph {
}
}

/// Discard the given node from the graph
pub(crate) fn remove_node(&mut self, node: &ID) {
/// Discard the given node and its edges from the graph
pub fn remove_node(&mut self, node: &ID) {
self.nodes.retain(|n| *n.id != *node);
for n in self.get_node_ids() {
self.remove_edge(node, &n);
for n in self.get_outedges(node) {
self.remove_edge(node, &n.destination);
}
}

Expand Down
6 changes: 3 additions & 3 deletions simulator/src/stats/adversaries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ use crate::{
};

#[cfg(not(test))]
use log::{error, info, warn};
use log::{info, warn};
use rayon::prelude::*;
use std::{
collections::HashMap,
sync::{Arc, Mutex},
};
#[cfg(test)]
use std::{println as info, println as warn, println as error};
use std::{println as info, println as warn};

impl Simulation {
pub(crate) fn eval_adversaries(&mut self, run_all: bool) {
Expand All @@ -25,7 +25,7 @@ impl Simulation {
vec![1, 2, 3, 4, 5, 10, 12, 15, 20]
};
if !number_of_adversaries.is_empty() && self.adversary_selection.is_empty() {
error!("Aborting adversary evaluation as no strategy was passed.");
warn!("Aborting adversary evaluation as no strategy was passed.");
return;
}
let selected_adversaries =
Expand Down

0 comments on commit 6509403

Please sign in to comment.