diff --git a/explorer-api/Cargo.toml b/explorer-api/Cargo.toml index 7a44e8cee4..c39b0f9cd3 100644 --- a/explorer-api/Cargo.toml +++ b/explorer-api/Cargo.toml @@ -7,6 +7,7 @@ license.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +anyhow = "1.0.82" chrono = { version = "0.4.31", features = ["serde"] } clap = { workspace = true, features = ["cargo", "derive"] } dotenvy = { workspace = true } diff --git a/explorer-api/src/mix_node/http.rs b/explorer-api/src/mix_node/http.rs index 9c4f002dc5..4f9a3f58b4 100644 --- a/explorer-api/src/mix_node/http.rs +++ b/explorer-api/src/mix_node/http.rs @@ -9,6 +9,7 @@ use crate::mix_node::models::{ EconomicDynamicsStats, NodeDescription, NodeStats, SummedDelegations, }; use crate::state::ExplorerApiStateContext; +use anyhow::{anyhow, Result}; use log::debug; use nym_explorer_api_requests::PrettyDetailedMixNodeBond; use nym_mixnet_contract_common::{Delegation, MixId}; @@ -44,7 +45,7 @@ async fn get_mix_node_description(host: &str, port: u16) -> Result Result { +async fn get_mix_node_stats(host: &str, port: u16) -> Result { // old endpoint for nym-mixnodes let primary_url = format!("http://{host}:{port}/stats"); // new endpoint for nym-nodes @@ -63,7 +64,7 @@ async fn get_mix_node_stats(host: &str, port: u16) -> Result