From fb29b6fde301add97b2803887b98295dc45337b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Tue, 28 Oct 2025 10:26:12 +0000 Subject: [PATCH] bugfix: default bandwidth response for authenticator --- common/authenticator-requests/src/traits.rs | 10 ++++++++++ nym-authenticator-client/src/lib.rs | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/common/authenticator-requests/src/traits.rs b/common/authenticator-requests/src/traits.rs index 3f90495e4d..6326a841c7 100644 --- a/common/authenticator-requests/src/traits.rs +++ b/common/authenticator-requests/src/traits.rs @@ -32,6 +32,16 @@ impl From for CurrentUpgradeModeStatus { } } +impl From for Option { + fn from(value: CurrentUpgradeModeStatus) -> Self { + match value { + CurrentUpgradeModeStatus::Enabled => Some(true), + CurrentUpgradeModeStatus::Disabled => Some(false), + CurrentUpgradeModeStatus::Unknown => None, + } + } +} + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] pub struct BandwidthClaim { pub credential: BandwidthCredential, diff --git a/nym-authenticator-client/src/lib.rs b/nym-authenticator-client/src/lib.rs index 734526a6ea..11297d2b0f 100644 --- a/nym-authenticator-client/src/lib.rs +++ b/nym-authenticator-client/src/lib.rs @@ -353,7 +353,7 @@ impl AuthenticatorClient { ); } Ok(AvailableBandwidthClientResponse { - available_bandwidth_bytes: None, + available_bandwidth_bytes: Some(available_bandwidth), current_upgrade_mode_status, }) }