fix Perbill representation for validator's commission
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
parent
309c97d60e
commit
d53e0242fb
@ -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.3.29"
|
||||
version = "0.3.30"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
@ -81,7 +81,7 @@ impl CurrentValidatorDetails {
|
||||
self.is_nomination_disabled = is_disabled;
|
||||
match maybe_commission {
|
||||
Some(commission) => {
|
||||
self.commission = commission as f64 / 1_000_000_000.0;
|
||||
self.commission = commission as f64 / 10_000_000.0;
|
||||
self.is_active_validator = true;
|
||||
},
|
||||
None => {
|
||||
|
@ -46,7 +46,7 @@ impl RewardDetails {
|
||||
match self.commission {
|
||||
Some(commission) => {
|
||||
if self.nominators_blocked { "blocked".to_string() }
|
||||
else { format!("{:.2}%", commission as f64 / 1_000_000_000.0) }
|
||||
else { format!("{:.2}%", commission as f64 / 10_000_000.0) }
|
||||
},
|
||||
None => DotSpinner::default().to_string(),
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ impl ValidatePopup {
|
||||
if let Some(network_tx) = &self.network_tx {
|
||||
match self.amount.value().parse::<f64>() {
|
||||
Ok(value) => {
|
||||
let amount = (value * 1_000_000_000.0).round() as u32;
|
||||
let amount = (value * 10_000_000.0).round() as u32;
|
||||
let _ = network_tx.send(Action::ValidateFrom(self.secret_seed, amount));
|
||||
if let Some(action_tx) = &self.action_tx {
|
||||
let _ = action_tx.send(Action::ClosePopup);
|
||||
|
@ -503,11 +503,11 @@ pub async fn get_validator_prefs(
|
||||
) -> Result<()> {
|
||||
let maybe_validator_prefs = super::raw_calls::staking::validators(api, None, account_id)
|
||||
.await?;
|
||||
let (comission, blocked) = match maybe_validator_prefs {
|
||||
let (commission, blocked) = match maybe_validator_prefs {
|
||||
Some(prefs) => (Some(prefs.commission.0), prefs.blocked),
|
||||
None => (None, false),
|
||||
};
|
||||
action_tx.send(Action::SetValidatorPrefs(comission, blocked, *account_id))?;
|
||||
action_tx.send(Action::SetValidatorPrefs(commission, blocked, *account_id))?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user