Feature/chain status api (#5539)

* nym-api endpoint to return latest block information

* attached chain health to health query

* fixed serde casing

* one of the most nastiest work arounds in test code
This commit is contained in:
Jędrzej Stuczyński
2025-03-03 10:47:40 +00:00
committed by GitHub
parent 128f69a5d6
commit 4f7124e661
15 changed files with 517 additions and 21 deletions
+10
View File
@@ -14,6 +14,7 @@ use nym_contracts_common::NaiveFloat;
use nym_mixnet_contract_common::reward_params::Performance;
use nym_mixnet_contract_common::{IdentityKey, NodeId};
use nym_serde_helpers::date::DATE_FORMAT;
use nym_validator_client::nyxd::error::NyxdError;
use reqwest::StatusCode;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
@@ -452,6 +453,15 @@ impl From<RedemptionError> for AxumErrorResponse {
}
}
impl From<NyxdError> for AxumErrorResponse {
fn from(value: NyxdError) -> Self {
Self {
message: RequestError::new(value.to_string()),
status: StatusCode::INTERNAL_SERVER_ERROR,
}
}
}
#[derive(Debug, Error)]
pub enum NymApiStorageError {
#[error("could not find status report associated with mixnode {mix_id}")]