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"
|
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.29"
|
version = "0.3.30"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
@ -81,7 +81,7 @@ impl CurrentValidatorDetails {
|
|||||||
self.is_nomination_disabled = is_disabled;
|
self.is_nomination_disabled = is_disabled;
|
||||||
match maybe_commission {
|
match maybe_commission {
|
||||||
Some(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;
|
self.is_active_validator = true;
|
||||||
},
|
},
|
||||||
None => {
|
None => {
|
||||||
|
@ -46,7 +46,7 @@ impl RewardDetails {
|
|||||||
match self.commission {
|
match self.commission {
|
||||||
Some(commission) => {
|
Some(commission) => {
|
||||||
if self.nominators_blocked { "blocked".to_string() }
|
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(),
|
None => DotSpinner::default().to_string(),
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ impl ValidatePopup {
|
|||||||
if let Some(network_tx) = &self.network_tx {
|
if let Some(network_tx) = &self.network_tx {
|
||||||
match self.amount.value().parse::<f64>() {
|
match self.amount.value().parse::<f64>() {
|
||||||
Ok(value) => {
|
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));
|
let _ = network_tx.send(Action::ValidateFrom(self.secret_seed, amount));
|
||||||
if let Some(action_tx) = &self.action_tx {
|
if let Some(action_tx) = &self.action_tx {
|
||||||
let _ = action_tx.send(Action::ClosePopup);
|
let _ = action_tx.send(Action::ClosePopup);
|
||||||
|
@ -503,11 +503,11 @@ pub async fn get_validator_prefs(
|
|||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
let maybe_validator_prefs = super::raw_calls::staking::validators(api, None, account_id)
|
let maybe_validator_prefs = super::raw_calls::staking::validators(api, None, account_id)
|
||||||
.await?;
|
.await?;
|
||||||
let (comission, blocked) = match maybe_validator_prefs {
|
let (commission, blocked) = match maybe_validator_prefs {
|
||||||
Some(prefs) => (Some(prefs.commission.0), prefs.blocked),
|
Some(prefs) => (Some(prefs.commission.0), prefs.blocked),
|
||||||
None => (None, false),
|
None => (None, false),
|
||||||
};
|
};
|
||||||
action_tx.send(Action::SetValidatorPrefs(comission, blocked, *account_id))?;
|
action_tx.send(Action::SetValidatorPrefs(commission, blocked, *account_id))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user