Skip to content

Commit

Permalink
Report service substrate client structure change pt1.
Browse files Browse the repository at this point in the history
  • Loading branch information
kukabi committed Dec 5, 2023
1 parent d0ccf2c commit c742645
Show file tree
Hide file tree
Showing 28 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion _docker/compose/.env.sample
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=0.17.10
VERSION=0.17.11
ENV=production
LOG_LEVEL=debug

Expand Down
2 changes: 1 addition & 1 deletion subvt-app-service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-app-service"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-block-processor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-block-processor"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-config"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-governance/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-governance"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-logging/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-logging"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-metrics/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-metrics"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-network-status-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-network-status-server"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-network-status-updater/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-network-status-updater"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-nft/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-nft"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-notification-generator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-notification-generator"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-notification-processor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-notification-processor"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-onekv-updater/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-onekv-updater"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-persistence/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-persistence"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-plotter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-plotter"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-proc-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ proc-macro = true

[package]
name = "subvt-proc-macro"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-referendum-updater/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-referendum-updater"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-report-service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-report-service"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
12 changes: 6 additions & 6 deletions subvt-report-service/src/validator/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use crate::{ResultResponse, ServiceState};
use crate::{ResultResponse, ServiceState, CONFIG};
use actix_web::{get, web, HttpResponse};
use serde::Deserialize;
use std::str::FromStr;
use subvt_substrate_client::SubstrateClient;
use subvt_types::crypto::AccountId;
use subvt_types::err::ServiceError;
use subvt_types::report::{
Expand Down Expand Up @@ -253,11 +254,12 @@ pub(crate) async fn validator_reward_chart_service(
query: web::Query<ValidatorRewardChartQueryParameters>,
data: web::Data<ServiceState>,
) -> ResultResponse {
let substrate_client = SubstrateClient::new(&CONFIG).await?;
let rewards = data
.postgres
.get_validator_total_rewards(query.start_timestamp, query.end_timestamp)
.await?;
let block_hash = data.substrate_client.get_current_block_hash().await?;
let block_hash = substrate_client.get_current_block_hash().await?;
let account_ids: Vec<AccountId> = rewards
.iter()
.map(|reward| reward.validator_account_id)
Expand All @@ -271,8 +273,7 @@ pub(crate) async fn validator_reward_chart_service(
}
}
}
let new_accounts = data
.substrate_client
let new_accounts = substrate_client
.get_accounts(&new_account_ids, false, &block_hash)
.await?;
let parent_account_ids: Vec<AccountId> = new_accounts
Expand All @@ -288,8 +289,7 @@ pub(crate) async fn validator_reward_chart_service(
}
}
}
let new_parent_accounts = data
.substrate_client
let new_parent_accounts = substrate_client
.get_accounts(&new_parent_account_ids, false, &block_hash)
.await?;
// write new accounts to cache
Expand Down
2 changes: 1 addition & 1 deletion subvt-service-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-service-common"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-substrate-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-substrate-client"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-telegram-bot/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-telegram-bot"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-telemetry-processor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-telemetry-processor"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-types"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-utility/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-utility"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-validator-details-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-validator-details-server"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-validator-list-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-validator-list-server"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down
2 changes: 1 addition & 1 deletion subvt-validator-list-updater/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subvt-validator-list-updater"
version = "0.17.10"
version = "0.17.11"
edition = "2021"
rust-version = "1.67.0"

Expand Down

0 comments on commit c742645

Please sign in to comment.