correct representation of points_ratio
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
parent
5e90456fdf
commit
22db763d31
@ -2,7 +2,7 @@
|
|||||||
name = "ghost-eye"
|
name = "ghost-eye"
|
||||||
authors = ["str3tch <stretch@ghostchain.io>"]
|
authors = ["str3tch <stretch@ghostchain.io>"]
|
||||||
description = "Application for interacting with Casper/Ghost nodes that are exposing RPC only to the localhost"
|
description = "Application for interacting with Casper/Ghost nodes that are exposing RPC only to the localhost"
|
||||||
version = "0.3.34"
|
version = "0.3.35"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -95,7 +95,7 @@ impl CurrentValidatorDetails {
|
|||||||
self.choosen = account_id;
|
self.choosen = account_id;
|
||||||
self.points_ratio = match total {
|
self.points_ratio = match total {
|
||||||
0 => 0.0,
|
0 => 0.0,
|
||||||
_ => individual as f64 / total as f64,
|
_ => (individual as f64 / total as f64) * 100.0,
|
||||||
};
|
};
|
||||||
if let Some(network_tx) = &self.network_tx {
|
if let Some(network_tx) = &self.network_tx {
|
||||||
let _ = network_tx.send(Action::GetErasStakersOverview(account_id, false));
|
let _ = network_tx.send(Action::GetErasStakersOverview(account_id, false));
|
||||||
|
@ -34,7 +34,6 @@ pub struct CurrentValidators {
|
|||||||
table_state: TableState,
|
table_state: TableState,
|
||||||
individual: Vec<EraRewardPoints>,
|
individual: Vec<EraRewardPoints>,
|
||||||
known_validators: std::collections::HashMap<[u8; 32], String>,
|
known_validators: std::collections::HashMap<[u8; 32], String>,
|
||||||
active_validators: std::collections::HashSet<String>,
|
|
||||||
total_points: u32,
|
total_points: u32,
|
||||||
era_index: u32,
|
era_index: u32,
|
||||||
my_stash_id: Option<[u8; 32]>,
|
my_stash_id: Option<[u8; 32]>,
|
||||||
@ -58,7 +57,6 @@ impl CurrentValidators {
|
|||||||
table_state: TableState::new(),
|
table_state: TableState::new(),
|
||||||
individual: Default::default(),
|
individual: Default::default(),
|
||||||
known_validators: Default::default(),
|
known_validators: Default::default(),
|
||||||
active_validators: Default::default(),
|
|
||||||
total_points: 0,
|
total_points: 0,
|
||||||
era_index: 0,
|
era_index: 0,
|
||||||
my_stash_id: None,
|
my_stash_id: None,
|
||||||
@ -267,7 +265,6 @@ impl Component for CurrentValidators {
|
|||||||
if info.disabled {
|
if info.disabled {
|
||||||
address_text = address_text.add_modifier(Modifier::CROSSED_OUT);
|
address_text = address_text.add_modifier(Modifier::CROSSED_OUT);
|
||||||
points_text = points_text.add_modifier(Modifier::CROSSED_OUT);
|
points_text = points_text.add_modifier(Modifier::CROSSED_OUT);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut current_validator_is_my_stash = false;
|
let mut current_validator_is_my_stash = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user