diff --git a/crates/octez/src/async/node_config.rs b/crates/octez/src/async/node_config.rs index 0e749651a..8bb5232dd 100644 --- a/crates/octez/src/async/node_config.rs +++ b/crates/octez/src/async/node_config.rs @@ -30,7 +30,7 @@ impl Display for OctezNodeHistoryMode { } } -#[derive(Default, Clone, PartialEq, Debug)] +#[derive(Clone, PartialEq, Debug)] pub struct OctezNodeRunOptions { synchonisation_threshold: u8, network: String, @@ -53,6 +53,16 @@ impl Display for OctezNodeRunOptions { } } +impl Default for OctezNodeRunOptions { + fn default() -> Self { + Self { + network: DEFAULT_NETWORK.to_owned(), + synchonisation_threshold: 0, + history_mode: None, + } + } +} + #[derive(Default)] pub struct OctezNodeRunOptionsBuilder { synchonisation_threshold: Option, @@ -254,6 +264,14 @@ mod tests { assert_eq!(run_options.synchonisation_threshold, 0); } + #[test] + fn run_option_default() { + let run_options = OctezNodeRunOptions::default(); + assert!(run_options.history_mode.is_none()); + assert_eq!(run_options.network, "sandbox"); + assert_eq!(run_options.synchonisation_threshold, 0); + } + #[test] fn run_option_to_string() { let mut run_options_builder = OctezNodeRunOptionsBuilder::new();