Skip to content

Commit

Permalink
comments and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
shahar4 committed Jul 9, 2024
1 parent 5fa5294 commit a996202
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions core/lib/config/src/configs/external_price_api_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub struct ExternalPriceApiClientConfig {
pub api_key: Option<String>,
#[serde(default = "ExternalPriceApiClientConfig::default_timeout")]
pub client_timeout_ms: u64,
/// Forced conversion ratio. Only used with the ForcedPriceClient.
pub forced_numerator: Option<u64>,
pub forced_denominator: Option<u64>,
}
Expand Down
8 changes: 4 additions & 4 deletions core/lib/protobuf_config/src/external_price_api_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ impl ProtoRepr for proto::ExternalPriceApiClient {
client_timeout_ms: self.client_timeout_ms.expect("client_timeout_ms"),
base_url: self.base_url.clone(),
api_key: self.api_key.clone(),
forced_numerator: self.forced_numerator.clone(),
forced_denominator: self.forced_denominator.clone(),
forced_numerator: self.forced_numerator,
forced_denominator: self.forced_denominator,
},
)
}
Expand All @@ -25,8 +25,8 @@ impl ProtoRepr for proto::ExternalPriceApiClient {
base_url: this.base_url.clone(),
api_key: this.api_key.clone(),
client_timeout_ms: Some(this.client_timeout_ms),
forced_numerator: this.forced_numerator.clone(),
forced_denominator: this.forced_denominator.clone(),
forced_numerator: this.forced_numerator,
forced_denominator: this.forced_denominator,
}
}
}
3 changes: 1 addition & 2 deletions etc/env/base/external_price_api.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
[external_price_api_client]

# What source to use for the external price API. Currently only options are "forced", "no-op", and "coingecko".
#source = "no-op"
client_timeout_ms = 10000

source = "forced"
forced_numerator = 40000
forced_denominator = 1
forced_denominator = 1
4 changes: 3 additions & 1 deletion etc/env/file_based/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,10 @@ base_token_adjuster:
price_polling_interval_ms: 30000
price_cache_update_interval_ms: 2000
external_price_api_client:
source: "no-op"
source: "forced"
client_timeout_ms: 10000
forced_numerator: 40000
forced_denominator: 1

house_keeper:
l1_batch_metrics_reporting_interval_ms: 10000
Expand Down

0 comments on commit a996202

Please sign in to comment.