From cfbcae378a71606f12a9dab77839f6ecfa0b4c6a Mon Sep 17 00:00:00 2001 From: Caglar Kaya Date: Thu, 8 Dec 2022 14:00:55 +0300 Subject: [PATCH] implement Default for WatcherConf --- mm2src/mm2_main/src/lp_swap/swap_watcher.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/mm2src/mm2_main/src/lp_swap/swap_watcher.rs b/mm2src/mm2_main/src/lp_swap/swap_watcher.rs index d701f94f11..07fe6fb3d9 100644 --- a/mm2src/mm2_main/src/lp_swap/swap_watcher.rs +++ b/mm2src/mm2_main/src/lp_swap/swap_watcher.rs @@ -48,8 +48,8 @@ impl WatcherContext { } } -#[derive(Serialize, Deserialize, Default)] -struct WatcherConf { +#[derive(Serialize, Deserialize, Debug)] +pub struct WatcherConf { #[serde(default = "common::sixty_f64")] wait_taker_payment: f64, #[serde(default = "common::one_f64")] @@ -60,6 +60,17 @@ struct WatcherConf { search_interval: f64, } +impl Default for WatcherConf { + fn default() -> Self { + WatcherConf { + wait_taker_payment: common::sixty_f64(), + wait_maker_payment_spend_factor: common::one_f64(), + refund_start_factor: common::one_and_half_f64(), + search_interval: common::three_hundred_f64(), + } + } +} + #[derive(Clone, Debug, Deserialize, Serialize)] pub enum SwapWatcherMsg { TakerSwapWatcherMsg(TakerSwapWatcherData),