commission as percent (#7239)

* commission_as_percent

* fixup
This commit is contained in:
Rob Walker
2019-12-03 20:55:04 -08:00
committed by GitHub
parent 369f37a0a4
commit ae93d574c2
8 changed files with 21 additions and 25 deletions

View File

@ -616,7 +616,7 @@ pub fn process_show_validators(rpc_client: &RpcClient, use_lamports_unit: bool)
}
}
println!(
"{} {:<44} {:<44} {:>3} ({:>4.1}%) {:>10} {:>11} {:>11}",
"{} {:<44} {:<44} {:>3}% {:>10} {:>11} {:>11}",
if delinquent {
WARNING.to_string()
} else {
@ -625,7 +625,6 @@ pub fn process_show_validators(rpc_client: &RpcClient, use_lamports_unit: bool)
vote_account.node_pubkey,
vote_account.vote_pubkey,
vote_account.commission,
f64::from(vote_account.commission) * 100.0 / f64::from(std::u8::MAX),
non_zero_or_dash(vote_account.last_vote),
non_zero_or_dash(vote_account.root_slot),
if vote_account.activated_stake > 0 {

View File

@ -47,7 +47,7 @@ impl VoteSubCommands for App<'_, '_> {
.long("commission")
.value_name("NUM")
.takes_value(true)
.help("The commission taken on reward redemption (0-255), default: 0"),
.help("The commission taken on reward redemption (0-100), default: 0"),
)
.arg(
Arg::with_name("authorized_voter")
@ -345,10 +345,7 @@ pub fn process_show_vote_account(
vote_state.authorized_withdrawer
);
println!("credits: {}", vote_state.credits());
println!(
"commission: {}%",
f64::from(vote_state.commission) / f64::from(std::u32::MAX)
);
println!("commission: {}%", vote_state.commission);
println!(
"root slot: {}",
match vote_state.root_slot {