fix Rust u128 -> TS BiInt issue
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user