From ae53bd9e309b62e6f40f78c4824d5c34691d92ba Mon Sep 17 00:00:00 2001 From: aglkm <39521015+aglkm@users.noreply.github.com> Date: Tue, 7 May 2024 21:57:33 +0300 Subject: [PATCH] update value name --- src/data.rs | 4 ++-- src/main.rs | 2 +- src/requests.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/data.rs b/src/data.rs index ed358d7..da4d1b8 100644 --- a/src/data.rs +++ b/src/data.rs @@ -31,7 +31,7 @@ pub struct Dashboard { // mining pub production_cost: String, pub reward_ratio: String, - pub break_even_cost: String, + pub breakeven_cost: String, // mempool pub txns: String, pub stem: String, @@ -61,7 +61,7 @@ impl Dashboard { difficulty: String::new(), production_cost: String::new(), reward_ratio: String::new(), - break_even_cost: String::new(), + breakeven_cost: String::new(), txns: String::new(), stem: String::new(), } diff --git a/src/main.rs b/src/main.rs index ca71a77..ce0cf74 100644 --- a/src/main.rs +++ b/src/main.rs @@ -344,7 +344,7 @@ fn reward_ratio(dashboard: &State>>) -> String { fn breakeven_cost(dashboard: &State>>) -> String { let data = dashboard.lock().unwrap(); - format!("$ {}", data.break_even_cost) + format!("$ {}", data.breakeven_cost) } diff --git a/src/requests.rs b/src/requests.rs index 483640c..27e677c 100644 --- a/src/requests.rs +++ b/src/requests.rs @@ -232,7 +232,7 @@ pub async fn get_mining_stats(dashboard: Arc>) -> Result<(), Er data.reward_ratio = format!("{:.2}", data.price_usd.parse::().unwrap() / data.production_cost.parse::().unwrap()); - data.break_even_cost = format!("{:.2}", data.price_usd.parse::().unwrap() + data.breakeven_cost = format!("{:.2}", data.price_usd.parse::().unwrap() / (120.0 / 1000.0 * (1.0 / coins_per_hour))); } }