From 591126375dc93375e668f151ce9c441fac0412e3 Mon Sep 17 00:00:00 2001 From: Mark Sinclair <14054343+mmsinclair@users.noreply.github.com> Date: Fri, 10 Oct 2025 15:40:18 +0100 Subject: [PATCH] ns-api: add descriptions to dVPN gateway responses (#6102) * ns-api: add descriptions to dVPN gateway responses * clippy * fmt --------- Co-authored-by: Mark Sinclair --- Cargo.lock | 2 +- nym-node-status-api/nym-node-status-api/Cargo.toml | 2 +- nym-node-status-api/nym-node-status-api/src/http/models.rs | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 468e47a6dc..b4a6f17828 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6598,7 +6598,7 @@ dependencies = [ [[package]] name = "nym-node-status-api" -version = "4.0.8" +version = "4.0.9" dependencies = [ "ammonia", "anyhow", diff --git a/nym-node-status-api/nym-node-status-api/Cargo.toml b/nym-node-status-api/nym-node-status-api/Cargo.toml index 8e36110ad1..a54d942237 100644 --- a/nym-node-status-api/nym-node-status-api/Cargo.toml +++ b/nym-node-status-api/nym-node-status-api/Cargo.toml @@ -3,7 +3,7 @@ [package] name = "nym-node-status-api" -version = "4.0.8" +version = "4.0.9" authors.workspace = true repository.workspace = true homepage.workspace = true diff --git a/nym-node-status-api/nym-node-status-api/src/http/models.rs b/nym-node-status-api/nym-node-status-api/src/http/models.rs index f41e3731fe..2721115068 100644 --- a/nym-node-status-api/nym-node-status-api/src/http/models.rs +++ b/nym-node-status-api/nym-node-status-api/src/http/models.rs @@ -99,6 +99,7 @@ pub struct DVpnGatewayPerformance { pub struct DVpnGateway { pub identity_key: String, pub name: String, + pub description: Option, pub ip_packet_router: Option, pub authenticator: Option, pub location: Location, @@ -326,6 +327,7 @@ impl DVpnGateway { Ok(Self { identity_key: gateway.gateway_identity_key, name: gateway.description.moniker, + description: Some(gateway.description.details), ip_packet_router: self_described.ip_packet_router, authenticator: self_described.authenticator, location: Location { @@ -401,9 +403,8 @@ fn calculate_score(gateway: &Gateway, probe_outcome: &LastProbeResult) -> ScoreV / 1000f64; // get the file size downloaded in bytes and convert to MB, or default to 1MB - let file_size_mb = p.downloaded_file_size_bytes_v4.unwrap_or_else(|| 1048576) as f64 - / 1024f64 - / 1024f64; + let file_size_mb = + p.downloaded_file_size_bytes_v4.unwrap_or(1048576) as f64 / 1024f64 / 1024f64; let speed_mbps = file_size_mb / duration_sec; let file_download_score = if speed_mbps > 5.0 {