fix navigation on the validator tab; fix the staking status
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
parent
3870446a5b
commit
1d7a4cea68
@ -2,7 +2,7 @@
|
||||
name = "ghost-eye"
|
||||
authors = ["str3tch <stretch@ghostchain.io>"]
|
||||
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"
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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}");
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user