Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Commit

Permalink
fix some things
Browse files Browse the repository at this point in the history
  • Loading branch information
azurwastaken committed Jun 20, 2024
1 parent fc7d5f1 commit ccaab57
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions crates/client/eth-client/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,38 +117,28 @@ impl PragmaOracle {
}
}

#[derive(Default, Debug, Serialize, Deserialize, Clone, Copy)]
#[derive(Default, Debug, Serialize, Deserialize, Clone)]
pub enum AggregationMethod {
#[serde(rename = "median")]
#[default]
Median,
#[serde(rename = "mean")]
Mean,
#[serde(rename = "twap")]
#[default]
Twap,
}

// impl fmt::Display for AggregationMethod {
// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
// match self {
// AggregationMethod::Median => write!(f, "median"),
// AggregationMethod::Mean => write!(f, "mean"),
// AggregationMethod::Twap => write!(f, "twap"),
// }
// }
// }

// Supported Aggregation Intervals
#[derive(Default, Debug, Serialize, Deserialize, Clone, Copy)]
#[derive(Default, Debug, Serialize, Deserialize, Clone)]
pub enum Interval {
#[serde(rename = "1min")]
#[default]
OneMinute,
#[serde(rename = "15min")]
FifteenMinutes,
#[serde(rename = "1h")]
OneHour,
#[serde(rename = "2h")]
#[default]
TwoHours,
}

Expand Down Expand Up @@ -180,7 +170,7 @@ impl Default for PragmaOracle {
fn default() -> Self {
Self {
api_url: default_api_url(),
api_key: String::from(""),
api_key: String::default(),
aggregation_method: AggregationMethod::Median,
interval: Interval::OneMinute,
bounds: (0, u128::MAX),
Expand Down

0 comments on commit ccaab57

Please sign in to comment.