From 1d7a4cea685dc943537a6597dbf785ac2679d9de Mon Sep 17 00:00:00 2001 From: Uncle Stretch Date: Tue, 17 Nov 2026 13:50:47 +0300 Subject: [PATCH] fix navigation on the validator tab; fix the staking status Signed-off-by: Uncle Stretch --- Cargo.toml | 2 +- src/components/validator/mod.rs | 2 +- src/components/validator/reward_details.rs | 20 +++++++------------- update.sh | 2 +- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d9f0879..96a47e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "ghost-eye" authors = ["str3tch "] description = "Application for interacting with Casper/Ghost nodes that are exposing RPC only to the localhost" -version = "0.4.3" +version = "0.4.4" edition = "2021" homepage = "https://git.ghostchain.io/ghostchain" repository = "https://git.ghostchain.io/ghostchain/ghost-eye" diff --git a/src/components/validator/mod.rs b/src/components/validator/mod.rs index 977281a..4cb4a20 100644 --- a/src/components/validator/mod.rs +++ b/src/components/validator/mod.rs @@ -247,7 +247,7 @@ impl Component for Validator { match action { Action::SetActiveScreen(Mode::Validator) => { self.is_active = true; - self.previous_tab = CurrentTab::History; + self.current_tab = CurrentTab::NominatorsByValidator; } Action::PayoutValidatorPopup(_) => { self.previous_tab = self.current_tab; diff --git a/src/components/validator/reward_details.rs b/src/components/validator/reward_details.rs index 2fcdc49..c629009 100644 --- a/src/components/validator/reward_details.rs +++ b/src/components/validator/reward_details.rs @@ -17,7 +17,6 @@ pub struct RewardDetails { treasury_apy: String, inflation: String, stash: [u8; 32], - in_staking_validators: bool, in_queued_keys: bool, in_next_keys: bool, is_disabled: bool, @@ -38,7 +37,6 @@ impl RewardDetails { treasury_apy: String::from("0.0%"), inflation: String::from("0.0%"), stash: [0u8; 32], - in_staking_validators: false, in_queued_keys: false, in_next_keys: false, is_disabled: false, @@ -109,17 +107,13 @@ impl Component for RewardDetails { let [_, _, place] = super::validator_balance_layout(area); let (border_style, border_type) = self.palette.create_border_style(false); - let status = if self.is_disabled { - "Disabled" - } else { - let is_fully_in_session = self.in_queued_keys && self.in_next_keys; - match (self.in_staking_validators, is_fully_in_session) { - (true, true) => "Active", - (true, false) => "Rotating", - (false, true) if self.in_rewards => "Stopping", - (false, true) if !self.in_rewards => "Chill", - _ => "Nothing", - } + let keys_both = self.in_queued_keys && self.in_next_keys; + let status = match (self.is_disabled, self.in_rewards, keys_both) { + (true, _, _) => "Disabled", + (false, true, true) => "Active", + (false, true, false) => "Rotating", + (false, false, true) => "Chilling", + (false, false, false) => "Nothing", }; let staking_status = format!("Staking status: {status}"); diff --git a/update.sh b/update.sh index 95dcbe7..5fb044b 100755 --- a/update.sh +++ b/update.sh @@ -14,7 +14,7 @@ REQUIRED_VERSION="1.91.0" CURRENT_VERSION=$(cargo --version | awk '{print $2}') HIGHEST=$(printf '%s\n%s' "$CURRENT_VERSION" "$REQUIRED_VERSION" | sort -rV | head -n1) -if [ "$HIGHEST" == "$REQUIRED_VERSION" ]; then +if [[ "$HIGHEST" == "$REQUIRED_VERSION" ]]; then echo "[!] Need to update rustc compiler because of the vergen-gix dependency" echo "[!] For more info: https://github.com/rustyhorde/vergen#msrv" rustup update