From e0581b192295bc172bcd45c8c0c42f5777ef54b3 Mon Sep 17 00:00:00 2001 From: Kirill Ivanov Date: Tue, 17 Dec 2024 22:37:22 +0900 Subject: [PATCH] consistency is the key --- stats/stats/src/charts/counters/total_operational_txns.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/stats/stats/src/charts/counters/total_operational_txns.rs b/stats/stats/src/charts/counters/total_operational_txns.rs index 266edcbf2..22321aab1 100644 --- a/stats/stats/src/charts/counters/total_operational_txns.rs +++ b/stats/stats/src/charts/counters/total_operational_txns.rs @@ -7,7 +7,7 @@ use crate::{ DataSource, }, types::TimespanValue, - ChartProperties, MissingDatePolicy, Named, UpdateError, + ChartProperties, MissingDatePolicy, Named, }; use chrono::NaiveDate; @@ -54,11 +54,7 @@ impl MapFunction for Calculate { let date = total_blocks_data.timespan; let value = total_txns_data .value - .checked_sub(total_blocks_data.value) - .ok_or(UpdateError::Internal(format!( - "overflow calculating {}", - Properties::name() - )))?; + .saturating_sub(total_blocks_data.value); Ok(TimespanValue { timespan: date, value: value.to_string(),