Skip to content

Commit

Permalink
implement Default for WatcherConf
Browse files Browse the repository at this point in the history
  • Loading branch information
caglaryucekaya committed Dec 8, 2022
1 parent dec9c70 commit cfbcae3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions mm2src/mm2_main/src/lp_swap/swap_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand All @@ -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),
Expand Down

0 comments on commit cfbcae3

Please sign in to comment.