From c63906892bffb3341ec954c45a81805ff7ec1ead Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 20 Dec 2024 11:17:18 +0000 Subject: [PATCH] Default values fix --- crates/driver/src/infra/config/file/mod.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/driver/src/infra/config/file/mod.rs b/crates/driver/src/infra/config/file/mod.rs index edbded9a1e..b51356131c 100644 --- a/crates/driver/src/infra/config/file/mod.rs +++ b/crates/driver/src/infra/config/file/mod.rs @@ -674,7 +674,7 @@ fn default_max_order_age() -> Option { } #[serde_as] -#[derive(Debug, Default, Deserialize)] +#[derive(Debug, Deserialize)] #[serde(rename_all = "kebab-case", deny_unknown_fields)] pub struct BadTokenDetectionConfig { /// How long should the token quality computed by the simulation @@ -695,6 +695,12 @@ pub struct BadTokenDetectionConfig { pub metrics_bad_token_required_measurements: u32, } +impl Default for BadTokenDetectionConfig { + fn default() -> Self { + serde_json::from_str("{}").expect("BadTokenDetectionConfig uses default values") + } +} + fn default_simulation_bad_token_max_age() -> Duration { Duration::from_secs(600) }