diff --git a/validator-api/src/node_status_api/routes.rs b/validator-api/src/node_status_api/routes.rs index b4a9530566..df383c8265 100644 --- a/validator-api/src/node_status_api/routes.rs +++ b/validator-api/src/node_status_api/routes.rs @@ -10,6 +10,7 @@ use crate::{Epoch, ValidatorCache}; use rocket::http::Status; use rocket::serde::json::Json; use rocket::State; +use std::convert::TryFrom; use time::OffsetDateTime; use validator_api_requests::models::{ CoreNodeStatusResponse, MixnodeStatusResponse, RewardEstimationResponse, @@ -135,9 +136,9 @@ pub(crate) async fn get_mixnode_reward_estimation( epoch_reward_params.estimate_reward(&bond, uptime.u8(), status.is_active()); Ok(Json(RewardEstimationResponse { - estimated_total_node_reward, - estimated_operator_reward, - estimated_delegators_reward, + estimated_total_node_reward: estimated_total_node_reward as u64, + estimated_operator_reward: estimated_operator_reward as u64, + estimated_delegators_reward: estimated_delegators_reward as u64, current_epoch_start: current_epoch.start_unix_timestamp(), current_epoch_end: current_epoch.end_unix_timestamp(), current_epoch_uptime: uptime.u8(), diff --git a/validator-api/validator-api-requests/src/models.rs b/validator-api/validator-api-requests/src/models.rs index fddd64d788..a7e5640837 100644 --- a/validator-api/validator-api-requests/src/models.rs +++ b/validator-api/validator-api-requests/src/models.rs @@ -35,9 +35,9 @@ pub struct MixnodeStatusResponse { #[derive(Clone, Copy, Debug, Serialize, Deserialize)] #[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))] pub struct RewardEstimationResponse { - pub estimated_total_node_reward: u128, - pub estimated_operator_reward: u128, - pub estimated_delegators_reward: u128, + pub estimated_total_node_reward: u64, + pub estimated_operator_reward: u64, + pub estimated_delegators_reward: u64, pub current_epoch_start: i64, pub current_epoch_end: i64,