diff --git a/Cargo.lock b/Cargo.lock
index 4dc9fe77..a1d9b5f6 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6961,7 +6961,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
[[package]]
name = "subvt-app-service"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"actix-http",
"actix-rt",
@@ -6989,7 +6989,7 @@ dependencies = [
[[package]]
name = "subvt-block-processor"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"async-lock",
@@ -7011,7 +7011,7 @@ dependencies = [
[[package]]
name = "subvt-config"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"config",
"serde",
@@ -7019,7 +7019,7 @@ dependencies = [
[[package]]
name = "subvt-governance"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"lazy_static",
@@ -7031,7 +7031,7 @@ dependencies = [
[[package]]
name = "subvt-kline-updater"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"async-trait",
@@ -7050,7 +7050,7 @@ dependencies = [
[[package]]
name = "subvt-logging"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"env_logger",
"log",
@@ -7059,7 +7059,7 @@ dependencies = [
[[package]]
name = "subvt-metrics"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"log",
"once_cell",
@@ -7071,7 +7071,7 @@ dependencies = [
[[package]]
name = "subvt-network-status-server"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"async-trait",
@@ -7093,7 +7093,7 @@ dependencies = [
[[package]]
name = "subvt-network-status-updater"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"async-trait",
@@ -7114,7 +7114,7 @@ dependencies = [
[[package]]
name = "subvt-nft"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"lazy_static",
@@ -7125,7 +7125,7 @@ dependencies = [
[[package]]
name = "subvt-notification-generator"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"async-lock",
@@ -7151,7 +7151,7 @@ dependencies = [
[[package]]
name = "subvt-notification-processor"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"a2",
"anyhow",
@@ -7184,7 +7184,7 @@ dependencies = [
[[package]]
name = "subvt-onekv-updater"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"async-trait",
@@ -7203,7 +7203,7 @@ dependencies = [
[[package]]
name = "subvt-persistence"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"chrono",
@@ -7220,7 +7220,7 @@ dependencies = [
[[package]]
name = "subvt-plotter"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"chrono",
@@ -7241,7 +7241,7 @@ dependencies = [
[[package]]
name = "subvt-proc-macro"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"proc-macro2",
"quote",
@@ -7250,7 +7250,7 @@ dependencies = [
[[package]]
name = "subvt-referendum-updater"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"async-trait",
@@ -7270,7 +7270,7 @@ dependencies = [
[[package]]
name = "subvt-report-service"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"actix-web",
"anyhow",
@@ -7295,7 +7295,7 @@ dependencies = [
[[package]]
name = "subvt-service-common"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"actix-web",
"anyhow",
@@ -7311,7 +7311,7 @@ dependencies = [
[[package]]
name = "subvt-session-validator-performance-updater"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"async-trait",
@@ -7328,7 +7328,7 @@ dependencies = [
[[package]]
name = "subvt-substrate-client"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"async-recursion",
@@ -7349,7 +7349,7 @@ dependencies = [
[[package]]
name = "subvt-telegram-bot"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"async-recursion",
@@ -7384,7 +7384,7 @@ dependencies = [
[[package]]
name = "subvt-telemetry-processor"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"async-lock",
@@ -7405,7 +7405,7 @@ dependencies = [
[[package]]
name = "subvt-types"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"chrono",
@@ -7445,7 +7445,7 @@ dependencies = [
[[package]]
name = "subvt-utility"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"hex",
@@ -7455,7 +7455,7 @@ dependencies = [
[[package]]
name = "subvt-validator-details-server"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"async-trait",
@@ -7478,7 +7478,7 @@ dependencies = [
[[package]]
name = "subvt-validator-list-server"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"async-trait",
@@ -7502,7 +7502,7 @@ dependencies = [
[[package]]
name = "subvt-validator-list-updater"
-version = "0.22.4"
+version = "0.22.5"
dependencies = [
"anyhow",
"async-lock",
diff --git a/_docker/compose/.env.sample b/_docker/compose/.env.sample
index ba4ed382..7f1172fa 100644
--- a/_docker/compose/.env.sample
+++ b/_docker/compose/.env.sample
@@ -1,4 +1,4 @@
-VERSION=0.22.4
+VERSION=0.22.5
ENV=production
LOG_LEVEL=debug
diff --git a/_migrations/network/migrations/20240506051612_extrinsic_payout_stakers_page_index.up.sql b/_migrations/network/migrations/20240506051612_extrinsic_payout_stakers_page_index.up.sql
index bf00bda3..6d0fea70 100644
--- a/_migrations/network/migrations/20240506051612_extrinsic_payout_stakers_page_index.up.sql
+++ b/_migrations/network/migrations/20240506051612_extrinsic_payout_stakers_page_index.up.sql
@@ -1 +1 @@
-ALTER TABLE sub_extrinsic_payout_stakers ADD COLUMN IF NOT EXISTS page_index INTEGER;
\ No newline at end of file
+ ALTER TABLE sub_extrinsic_payout_stakers ADD COLUMN IF NOT EXISTS page_index INTEGER;
\ No newline at end of file
diff --git a/_template/push_notification/chain_validator_lost_nomination.txt b/_template/push_notification/chain_validator_lost_nomination.txt
index e7752a7a..bbf64880 100644
--- a/_template/push_notification/chain_validator_lost_nomination.txt
+++ b/_template/push_notification/chain_validator_lost_nomination.txt
@@ -1,4 +1,4 @@
{{ validator_display }}
⬇️ lost a nomination{% if notification_period_type %} in the last {% if notification_period > 1 %}{{ notification_period }} {% endif %}{{ notification_period_type }}{% if notification_period > 1 %}s{% endif %}{% endif %}.
-Nominator: {{ nominator_display }}{% if is_onekv %} (1KV){% endif %}
+Nominator: {{ nominator_display }}{% if is_onekv %} (DN){% endif %}
Amount: {{ nomination_amount }} {{ token_ticker }}
\ No newline at end of file
diff --git a/_template/push_notification/chain_validator_new_nomination.txt b/_template/push_notification/chain_validator_new_nomination.txt
index c83f7711..1ecc1b5d 100644
--- a/_template/push_notification/chain_validator_new_nomination.txt
+++ b/_template/push_notification/chain_validator_new_nomination.txt
@@ -1,5 +1,5 @@
{{ validator_display }}
⭐️ received a new nomination{% if notification_period_type %} in the last {% if notification_period > 1 %}{{ notification_period }} {% endif %}{{ notification_period_type }}{% if notification_period > 1 %}s{% endif %}{% endif %}!
-Nominator: {{ nominator_display }}{% if is_onekv %} (1KV){% endif %}
+Nominator: {{ nominator_display }}{% if is_onekv %} (DN){% endif %}
Amount: {{ nomination_amount }} {{ token_ticker }}
Nominee Count: {{ nominee_count }}
\ No newline at end of file
diff --git a/_template/telegram/chain_validator_lost_nomination.html b/_template/telegram/chain_validator_lost_nomination.html
index 8b8fedb4..782f5481 100644
--- a/_template/telegram/chain_validator_lost_nomination.html
+++ b/_template/telegram/chain_validator_lost_nomination.html
@@ -1,4 +1,4 @@
{{ validator_display }}
⬇️ lost a nomination{% if notification_period_type %} in the last {% if notification_period > 1 %}{{ notification_period }} {% endif %}{{ notification_period_type }}{% if notification_period > 1 %}s{% endif %}{% endif %}.
-Nominator: {{ nominator_display }}{% if is_onekv %} (1KV){% endif %}
+Nominator: {{ nominator_display }}{% if is_onekv %} (DN){% endif %}
Amount: {{ nomination_amount }} {{ token_ticker }}
\ No newline at end of file
diff --git a/_template/telegram/chain_validator_new_nomination.html b/_template/telegram/chain_validator_new_nomination.html
index 340b9cd5..e77714d0 100644
--- a/_template/telegram/chain_validator_new_nomination.html
+++ b/_template/telegram/chain_validator_new_nomination.html
@@ -1,5 +1,5 @@
{{ validator_display }}
⭐️ received a new nomination{% if notification_period_type %} in the last {% if notification_period > 1 %}{{ notification_period }} {% endif %}{{ notification_period_type }}{% if notification_period > 1 %}s{% endif %}{% endif %}!
-Nominator: {{ nominator_display }}{% if is_onekv %} (1KV){% endif %}
+Nominator: {{ nominator_display }}{% if is_onekv %} (DN){% endif %}
Amount: {{ nomination_amount }} {{ token_ticker }}
Nominee Count: {{ nominee_count }}
\ No newline at end of file
diff --git a/subvt-app-service/Cargo.toml b/subvt-app-service/Cargo.toml
index 72eec22f..1d64219f 100644
--- a/subvt-app-service/Cargo.toml
+++ b/subvt-app-service/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-app-service"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-block-processor/Cargo.toml b/subvt-block-processor/Cargo.toml
index 8598f8f2..cbf45179 100644
--- a/subvt-block-processor/Cargo.toml
+++ b/subvt-block-processor/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-block-processor"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-config/Cargo.toml b/subvt-config/Cargo.toml
index 77dc14dc..99af4eba 100644
--- a/subvt-config/Cargo.toml
+++ b/subvt-config/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-config"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-governance/Cargo.toml b/subvt-governance/Cargo.toml
index 833cc3b5..c488f5a9 100644
--- a/subvt-governance/Cargo.toml
+++ b/subvt-governance/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-governance"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-kline-updater/Cargo.toml b/subvt-kline-updater/Cargo.toml
index 51732db3..9b9a98fe 100644
--- a/subvt-kline-updater/Cargo.toml
+++ b/subvt-kline-updater/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-kline-updater"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-logging/Cargo.toml b/subvt-logging/Cargo.toml
index aa13613e..b8829a97 100644
--- a/subvt-logging/Cargo.toml
+++ b/subvt-logging/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-logging"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-metrics/Cargo.toml b/subvt-metrics/Cargo.toml
index 279bad25..7afc526e 100644
--- a/subvt-metrics/Cargo.toml
+++ b/subvt-metrics/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-metrics"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-network-status-server/Cargo.toml b/subvt-network-status-server/Cargo.toml
index fbd9504d..5516099b 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.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-network-status-updater/Cargo.toml b/subvt-network-status-updater/Cargo.toml
index 3bbfd3bf..d2a6d56b 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.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-nft/Cargo.toml b/subvt-nft/Cargo.toml
index faf2f82d..17400342 100644
--- a/subvt-nft/Cargo.toml
+++ b/subvt-nft/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-nft"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-notification-generator/Cargo.toml b/subvt-notification-generator/Cargo.toml
index b46a02f2..176c1831 100644
--- a/subvt-notification-generator/Cargo.toml
+++ b/subvt-notification-generator/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-notification-generator"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-notification-generator/src/lib.rs b/subvt-notification-generator/src/lib.rs
index 24b129e5..e92f9ae8 100644
--- a/subvt-notification-generator/src/lib.rs
+++ b/subvt-notification-generator/src/lib.rs
@@ -96,11 +96,7 @@ impl NotificationGenerator {
sent_at: None,
delivered_at: None,
read_at: None,
- data_json: if let Ok(data_json) = serde_json::to_string(¬ification_data) {
- Some(data_json)
- } else {
- None
- },
+ data_json: serde_json::to_string(¬ification_data).ok(),
};
let _ = app_postgres.save_notification(¬ification).await?;
metrics::notification_counter(
diff --git a/subvt-notification-processor/Cargo.toml b/subvt-notification-processor/Cargo.toml
index d9f15431..863290a4 100644
--- a/subvt-notification-processor/Cargo.toml
+++ b/subvt-notification-processor/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-notification-processor"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-onekv-updater/Cargo.toml b/subvt-onekv-updater/Cargo.toml
index f725241a..7cb35b87 100644
--- a/subvt-onekv-updater/Cargo.toml
+++ b/subvt-onekv-updater/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-onekv-updater"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-persistence/Cargo.toml b/subvt-persistence/Cargo.toml
index e91124a9..f9067356 100644
--- a/subvt-persistence/Cargo.toml
+++ b/subvt-persistence/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-persistence"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-persistence/src/postgres/network/staking.rs b/subvt-persistence/src/postgres/network/staking.rs
index 46eebb78..3ba5059c 100644
--- a/subvt-persistence/src/postgres/network/staking.rs
+++ b/subvt-persistence/src/postgres/network/staking.rs
@@ -366,6 +366,28 @@ impl PostgreSQLNetworkStorage {
}
}
+ pub async fn get_validator_info(
+ &self,
+ block_hash: &str,
+ validator_account_id: &AccountId,
+ is_active_batch: bool,
+ era_index: u32,
+ ) -> anyhow::Result {
+ let validator_info: PostgresValidatorInfo = sqlx::query_as(
+ r#"
+ SELECT *
+ FROM sub_get_validator_info($1, $2, $3, $4)
+ "#,
+ )
+ .bind(block_hash)
+ .bind(validator_account_id.to_string())
+ .bind(is_active_batch)
+ .bind(era_index as i64)
+ .fetch_one(&self.connection_pool)
+ .await?;
+ Ok(Self::db_record_into_validator_info(&validator_info))
+ }
+
pub async fn get_validator_info_batch(
&self,
block_hash: &str,
diff --git a/subvt-plotter/Cargo.toml b/subvt-plotter/Cargo.toml
index 681da46f..eae40e46 100644
--- a/subvt-plotter/Cargo.toml
+++ b/subvt-plotter/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-plotter"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-proc-macro/Cargo.toml b/subvt-proc-macro/Cargo.toml
index d5f629f8..6ed85d47 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.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-referendum-updater/Cargo.toml b/subvt-referendum-updater/Cargo.toml
index 5939ab86..67090123 100644
--- a/subvt-referendum-updater/Cargo.toml
+++ b/subvt-referendum-updater/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-referendum-updater"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-report-service/Cargo.toml b/subvt-report-service/Cargo.toml
index c76a1b16..960bb140 100644
--- a/subvt-report-service/Cargo.toml
+++ b/subvt-report-service/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-report-service"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-service-common/Cargo.toml b/subvt-service-common/Cargo.toml
index 24b49cd5..ab553a35 100644
--- a/subvt-service-common/Cargo.toml
+++ b/subvt-service-common/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-service-common"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-session-validator-performance-updater/Cargo.toml b/subvt-session-validator-performance-updater/Cargo.toml
index 2f3085ce..c96c98d2 100644
--- a/subvt-session-validator-performance-updater/Cargo.toml
+++ b/subvt-session-validator-performance-updater/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-session-validator-performance-updater"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-substrate-client/Cargo.toml b/subvt-substrate-client/Cargo.toml
index 8aec2f13..d86fd71f 100644
--- a/subvt-substrate-client/Cargo.toml
+++ b/subvt-substrate-client/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-substrate-client"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-telegram-bot/Cargo.toml b/subvt-telegram-bot/Cargo.toml
index 7b792ac1..9aaec16b 100644
--- a/subvt-telegram-bot/Cargo.toml
+++ b/subvt-telegram-bot/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-telegram-bot"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-telemetry-processor/Cargo.toml b/subvt-telemetry-processor/Cargo.toml
index 66543006..ab7e58cb 100644
--- a/subvt-telemetry-processor/Cargo.toml
+++ b/subvt-telemetry-processor/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-telemetry-processor"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-types/Cargo.toml b/subvt-types/Cargo.toml
index e61d02dd..cf2fef83 100644
--- a/subvt-types/Cargo.toml
+++ b/subvt-types/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-types"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-types/src/substrate/mod.rs b/subvt-types/src/substrate/mod.rs
index 577b7809..395c8b60 100644
--- a/subvt-types/src/substrate/mod.rs
+++ b/subvt-types/src/substrate/mod.rs
@@ -616,11 +616,7 @@ pub fn data_to_string(data: Data) -> Option {
match data {
Data::Raw(raw) => {
let maybe_string = String::from_utf8(raw.into_inner());
- if let Ok(string) = maybe_string {
- Some(string)
- } else {
- None
- }
+ maybe_string.ok()
}
_ => None,
}
diff --git a/subvt-utility/Cargo.toml b/subvt-utility/Cargo.toml
index 847f0413..375faec5 100644
--- a/subvt-utility/Cargo.toml
+++ b/subvt-utility/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subvt-utility"
-version = "0.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-validator-details-server/Cargo.toml b/subvt-validator-details-server/Cargo.toml
index 97b5fc19..ed0b1381 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.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-validator-list-server/Cargo.toml b/subvt-validator-list-server/Cargo.toml
index 6a837b21..0ec9d121 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.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-validator-list-updater/Cargo.toml b/subvt-validator-list-updater/Cargo.toml
index 3a3c6f7c..7ed4218a 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.22.4"
+version = "0.22.5"
edition = "2021"
rust-version = "1.67.0"
diff --git a/subvt-validator-list-updater/src/lib.rs b/subvt-validator-list-updater/src/lib.rs
index fe34d81d..6bd02c24 100644
--- a/subvt-validator-list-updater/src/lib.rs
+++ b/subvt-validator-list-updater/src/lib.rs
@@ -17,7 +17,6 @@ use subvt_config::Config;
use subvt_persistence::postgres::network::PostgreSQLNetworkStorage;
use subvt_service_common::Service;
use subvt_substrate_client::SubstrateClient;
-use subvt_types::crypto::AccountId;
use subvt_types::rdb::ValidatorInfo;
use subvt_types::substrate::{BlockHeader, Era};
use subvt_types::subvt::{ValidatorDetails, ValidatorSummary};
@@ -226,6 +225,19 @@ impl ValidatorListUpdater {
// enrich data with data from the relational database
log::info!("Get RDB content for {} validators.", validators.len());
let mut db_validator_infos: Vec = Vec::new();
+ for (i, validator) in validators.iter().enumerate() {
+ log::info!("Validator {} of {}.", i + 1, db_validator_infos.len());
+ let db_validator = postgres
+ .get_validator_info(
+ &finalized_block_hash,
+ &validator.account.id,
+ validator.is_active,
+ active_era.index,
+ )
+ .await?;
+ db_validator_infos.push(db_validator);
+ }
+ /*
let batches = validators.chunks(CONFIG.validator_list_updater.db_fetch_batch_size);
let batch_count = batches.len();
for (i, validator_batch) in batches.enumerate() {
@@ -243,6 +255,7 @@ impl ValidatorListUpdater {
.await?;
db_validator_infos.append(&mut db_validator_info_batch);
}
+ */
for (i, validator) in validators.iter_mut().enumerate() {
if let Some(db_validator_info) = db_validator_infos.get(i) {
validator.account.discovered_at = db_validator_info.discovered_at;