#[derive(Debug, Clone)]
pub struct DarkNodeParams {
pub silencing_threshold: f64,
pub silencing_delay_secs: f64,
pub recovery_threshold: f64,
pub gc_eligible_after_secs: f64,
}
impl Default for DarkNodeParams {
fn default() -> Self {
Self {
silencing_threshold: -2.0,
silencing_delay_secs: 604_800.0, recovery_threshold: 1.5,
gc_eligible_after_secs: 7_776_000.0, }
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_default_params() {
let p = DarkNodeParams::default();
assert!((p.silencing_threshold - (-2.0)).abs() < f64::EPSILON);
assert!((p.silencing_delay_secs - 604_800.0).abs() < f64::EPSILON);
assert!((p.recovery_threshold - 1.5).abs() < f64::EPSILON);
assert!((p.gc_eligible_after_secs - 7_776_000.0).abs() < f64::EPSILON);
}
}