diff --git a/Cargo.lock b/Cargo.lock index ac5a6ea7..b7520144 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7697,7 +7697,7 @@ checksum = "0d0208408ba0c3df17ed26eb06992cb1a1268d41b2c0e12e65203fbe3972cee5" [[package]] name = "subvt-app-service" -version = "0.20.2" +version = "0.20.3" dependencies = [ "actix-http", "actix-rt", @@ -7726,7 +7726,7 @@ dependencies = [ [[package]] name = "subvt-block-processor" -version = "0.20.2" +version = "0.20.3" dependencies = [ "anyhow", "async-lock", @@ -7752,7 +7752,7 @@ dependencies = [ [[package]] name = "subvt-config" -version = "0.20.2" +version = "0.20.3" dependencies = [ "config", "serde", @@ -7760,7 +7760,7 @@ dependencies = [ [[package]] name = "subvt-governance" -version = "0.20.2" +version = "0.20.3" dependencies = [ "anyhow", "lazy_static", @@ -7774,7 +7774,7 @@ dependencies = [ [[package]] name = "subvt-kline-updater" -version = "0.20.2" +version = "0.20.3" dependencies = [ "anyhow", "async-trait", @@ -7797,7 +7797,7 @@ dependencies = [ [[package]] name = "subvt-logging" -version = "0.20.2" +version = "0.20.3" dependencies = [ "env_logger", "log", @@ -7806,7 +7806,7 @@ dependencies = [ [[package]] name = "subvt-metrics" -version = "0.20.2" +version = "0.20.3" dependencies = [ "env_logger", "log", @@ -7820,7 +7820,7 @@ dependencies = [ [[package]] name = "subvt-network-status-server" -version = "0.20.2" +version = "0.20.3" dependencies = [ "anyhow", "async-trait", @@ -7845,7 +7845,7 @@ dependencies = [ [[package]] name = "subvt-network-status-updater" -version = "0.20.2" +version = "0.20.3" dependencies = [ "anyhow", "async-trait", @@ -7867,7 +7867,7 @@ dependencies = [ [[package]] name = "subvt-nft" -version = "0.20.2" +version = "0.20.3" dependencies = [ "anyhow", "lazy_static", @@ -7879,7 +7879,7 @@ dependencies = [ [[package]] name = "subvt-notification-generator" -version = "0.20.2" +version = "0.20.3" dependencies = [ "anyhow", "async-lock", @@ -7906,7 +7906,7 @@ dependencies = [ [[package]] name = "subvt-notification-processor" -version = "0.20.2" +version = "0.20.3" dependencies = [ "a2", "anyhow", @@ -7941,7 +7941,7 @@ dependencies = [ [[package]] name = "subvt-onekv-updater" -version = "0.20.2" +version = "0.20.3" dependencies = [ "anyhow", "async-trait", @@ -7963,7 +7963,7 @@ dependencies = [ [[package]] name = "subvt-persistence" -version = "0.20.2" +version = "0.20.3" dependencies = [ "anyhow", "chrono", @@ -7982,7 +7982,7 @@ dependencies = [ [[package]] name = "subvt-plotter" -version = "0.20.2" +version = "0.20.3" dependencies = [ "anyhow", "chrono", @@ -8005,7 +8005,7 @@ dependencies = [ [[package]] name = "subvt-proc-macro" -version = "0.20.2" +version = "0.20.3" dependencies = [ "proc-macro2", "quote", @@ -8014,7 +8014,7 @@ dependencies = [ [[package]] name = "subvt-referendum-updater" -version = "0.20.2" +version = "0.20.3" dependencies = [ "anyhow", "async-trait", @@ -8038,7 +8038,7 @@ dependencies = [ [[package]] name = "subvt-report-service" -version = "0.20.2" +version = "0.20.3" dependencies = [ "actix-web", "anyhow", @@ -8066,7 +8066,7 @@ dependencies = [ [[package]] name = "subvt-service-common" -version = "0.20.2" +version = "0.20.3" dependencies = [ "actix-web", "anyhow", @@ -8083,7 +8083,7 @@ dependencies = [ [[package]] name = "subvt-substrate-client" -version = "0.20.2" +version = "0.20.3" dependencies = [ "anyhow", "async-lock", @@ -8112,7 +8112,7 @@ dependencies = [ [[package]] name = "subvt-telegram-bot" -version = "0.20.2" +version = "0.20.3" dependencies = [ "anyhow", "async-recursion", @@ -8150,7 +8150,7 @@ dependencies = [ [[package]] name = "subvt-telemetry-processor" -version = "0.20.2" +version = "0.20.3" dependencies = [ "anyhow", "async-lock", @@ -8174,7 +8174,7 @@ dependencies = [ [[package]] name = "subvt-types" -version = "0.20.2" +version = "0.20.3" dependencies = [ "anyhow", "chrono", @@ -8216,7 +8216,7 @@ dependencies = [ [[package]] name = "subvt-utility" -version = "0.20.2" +version = "0.20.3" dependencies = [ "anyhow", "hex", @@ -8226,7 +8226,7 @@ dependencies = [ [[package]] name = "subvt-validator-details-server" -version = "0.20.2" +version = "0.20.3" dependencies = [ "anyhow", "async-trait", @@ -8250,7 +8250,7 @@ dependencies = [ [[package]] name = "subvt-validator-list-server" -version = "0.20.2" +version = "0.20.3" dependencies = [ "anyhow", "async-trait", @@ -8277,7 +8277,7 @@ dependencies = [ [[package]] name = "subvt-validator-list-updater" -version = "0.20.2" +version = "0.20.3" dependencies = [ "anyhow", "async-lock", diff --git a/_docker/compose/.env.sample b/_docker/compose/.env.sample index ce5dfd95..15bb7c2e 100644 --- a/_docker/compose/.env.sample +++ b/_docker/compose/.env.sample @@ -1,4 +1,4 @@ -VERSION=0.20.2 +VERSION=0.20.3 ENV=production LOG_LEVEL=debug diff --git a/subvt-app-service/Cargo.toml b/subvt-app-service/Cargo.toml index 244b63b5..206e38c4 100644 --- a/subvt-app-service/Cargo.toml +++ b/subvt-app-service/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-app-service" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-block-processor/Cargo.toml b/subvt-block-processor/Cargo.toml index ab9880a8..5cca6d72 100644 --- a/subvt-block-processor/Cargo.toml +++ b/subvt-block-processor/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-block-processor" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-config/Cargo.toml b/subvt-config/Cargo.toml index d255c580..a3455902 100644 --- a/subvt-config/Cargo.toml +++ b/subvt-config/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-config" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-governance/Cargo.toml b/subvt-governance/Cargo.toml index 0e2db8a8..9acb79b0 100644 --- a/subvt-governance/Cargo.toml +++ b/subvt-governance/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-governance" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-kline-updater/Cargo.toml b/subvt-kline-updater/Cargo.toml index 28e316fc..5cbd2d8b 100644 --- a/subvt-kline-updater/Cargo.toml +++ b/subvt-kline-updater/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-kline-updater" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-kline-updater/src/lib.rs b/subvt-kline-updater/src/lib.rs index ffd45799..1a000a3a 100644 --- a/subvt-kline-updater/src/lib.rs +++ b/subvt-kline-updater/src/lib.rs @@ -47,7 +47,8 @@ impl Service for KLineUpdater { .unwrap(); let mut day = NaiveDate::from_ymd_opt(now.year(), now.month(), now.day()).unwrap(); loop { - day = day.checked_sub_days(Days::new(1)).unwrap(); + // start from 2 days prior to today + day = day.checked_sub_days(Days::new(2)).unwrap(); let start_of_day = NaiveDateTime::from(day); let year = day.year(); let month = day.month(); diff --git a/subvt-logging/Cargo.toml b/subvt-logging/Cargo.toml index 328a6106..e59f142d 100644 --- a/subvt-logging/Cargo.toml +++ b/subvt-logging/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-logging" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-metrics/Cargo.toml b/subvt-metrics/Cargo.toml index 8cbf0f04..2587d5ee 100644 --- a/subvt-metrics/Cargo.toml +++ b/subvt-metrics/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-metrics" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-network-status-server/Cargo.toml b/subvt-network-status-server/Cargo.toml index 33b66e5b..3c5bc4e3 100644 --- a/subvt-network-status-server/Cargo.toml +++ b/subvt-network-status-server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-network-status-server" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-network-status-updater/Cargo.toml b/subvt-network-status-updater/Cargo.toml index 99c1b7de..1b5d967d 100644 --- a/subvt-network-status-updater/Cargo.toml +++ b/subvt-network-status-updater/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-network-status-updater" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-nft/Cargo.toml b/subvt-nft/Cargo.toml index 5bb06a8d..00bfd98c 100644 --- a/subvt-nft/Cargo.toml +++ b/subvt-nft/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-nft" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-notification-generator/Cargo.toml b/subvt-notification-generator/Cargo.toml index 84abc32a..ef13c2f0 100644 --- a/subvt-notification-generator/Cargo.toml +++ b/subvt-notification-generator/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-notification-generator" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-notification-processor/Cargo.toml b/subvt-notification-processor/Cargo.toml index fec8a572..009b59fe 100644 --- a/subvt-notification-processor/Cargo.toml +++ b/subvt-notification-processor/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-notification-processor" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-onekv-updater/Cargo.toml b/subvt-onekv-updater/Cargo.toml index 33541b78..9c346537 100644 --- a/subvt-onekv-updater/Cargo.toml +++ b/subvt-onekv-updater/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-onekv-updater" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-persistence/Cargo.toml b/subvt-persistence/Cargo.toml index 1440c083..f818ca1a 100644 --- a/subvt-persistence/Cargo.toml +++ b/subvt-persistence/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-persistence" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-plotter/Cargo.toml b/subvt-plotter/Cargo.toml index 76d60692..2463f14c 100644 --- a/subvt-plotter/Cargo.toml +++ b/subvt-plotter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-plotter" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-proc-macro/Cargo.toml b/subvt-proc-macro/Cargo.toml index 3c895b90..f55c58a8 100644 --- a/subvt-proc-macro/Cargo.toml +++ b/subvt-proc-macro/Cargo.toml @@ -3,7 +3,7 @@ proc-macro = true [package] name = "subvt-proc-macro" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-referendum-updater/Cargo.toml b/subvt-referendum-updater/Cargo.toml index 6ec625ff..c6f96207 100644 --- a/subvt-referendum-updater/Cargo.toml +++ b/subvt-referendum-updater/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-referendum-updater" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-report-service/Cargo.toml b/subvt-report-service/Cargo.toml index a573b11f..3bdbc00d 100644 --- a/subvt-report-service/Cargo.toml +++ b/subvt-report-service/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-report-service" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-report-service/src/validator/mod.rs b/subvt-report-service/src/validator/mod.rs index 778de7fe..7ac56b53 100644 --- a/subvt-report-service/src/validator/mod.rs +++ b/subvt-report-service/src/validator/mod.rs @@ -1,6 +1,6 @@ use crate::{ResultResponse, ServiceState, CONFIG}; use actix_web::{get, web, HttpResponse}; -use chrono::{DateTime, Datelike, Months, NaiveDateTime, Utc}; +use chrono::{DateTime, Datelike, Days, Months, NaiveDateTime, Utc}; use serde::Deserialize; use std::str::FromStr; use subvt_substrate_client::SubstrateClient; @@ -337,9 +337,11 @@ pub(crate) async fn validator_monhtly_income_service( .with_day(1) .unwrap(); let start_timestamp = NaiveDateTime::from(start_date).and_utc().timestamp_millis(); - let end_timestamp = NaiveDateTime::from(now.date_naive()) - .and_utc() - .timestamp_millis(); + // start from 2 days prior to today + let end_timestamp = + NaiveDateTime::from(now.checked_sub_days(Days::new(1)).unwrap().date_naive()) + .and_utc() + .timestamp_millis(); let rewards = data .postgres .get_rewards_in_time_range(&account_id, start_timestamp as u64, end_timestamp as u64) diff --git a/subvt-service-common/Cargo.toml b/subvt-service-common/Cargo.toml index d8152e9e..ba1ffa3d 100644 --- a/subvt-service-common/Cargo.toml +++ b/subvt-service-common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-service-common" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-substrate-client/Cargo.toml b/subvt-substrate-client/Cargo.toml index 02d7daa3..9a820f6a 100644 --- a/subvt-substrate-client/Cargo.toml +++ b/subvt-substrate-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-substrate-client" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-telegram-bot/Cargo.toml b/subvt-telegram-bot/Cargo.toml index f9498df6..dc56fa0e 100644 --- a/subvt-telegram-bot/Cargo.toml +++ b/subvt-telegram-bot/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-telegram-bot" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-telemetry-processor/Cargo.toml b/subvt-telemetry-processor/Cargo.toml index f3bfbfdd..179b554a 100644 --- a/subvt-telemetry-processor/Cargo.toml +++ b/subvt-telemetry-processor/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-telemetry-processor" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-types/Cargo.toml b/subvt-types/Cargo.toml index 94241ab8..5b3e29a9 100644 --- a/subvt-types/Cargo.toml +++ b/subvt-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-types" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-utility/Cargo.toml b/subvt-utility/Cargo.toml index 04197eab..c19e1b26 100644 --- a/subvt-utility/Cargo.toml +++ b/subvt-utility/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-utility" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-validator-details-server/Cargo.toml b/subvt-validator-details-server/Cargo.toml index e57216c4..db269715 100644 --- a/subvt-validator-details-server/Cargo.toml +++ b/subvt-validator-details-server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-validator-details-server" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-validator-list-server/Cargo.toml b/subvt-validator-list-server/Cargo.toml index e21acbb4..6cfc840b 100644 --- a/subvt-validator-list-server/Cargo.toml +++ b/subvt-validator-list-server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-validator-list-server" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0" diff --git a/subvt-validator-list-updater/Cargo.toml b/subvt-validator-list-updater/Cargo.toml index ce9b73df..f70e78c5 100644 --- a/subvt-validator-list-updater/Cargo.toml +++ b/subvt-validator-list-updater/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subvt-validator-list-updater" -version = "0.20.2" +version = "0.20.3" edition = "2021" rust-version = "1.67.0"