Cli: use get_inflation_rewards and limit epochs queried (#16408) (#16444)

* Fix block-with-limit when not finalized blocks found

* Enable confirmed commitment in getInflationReward

* Use get_inflation_rewards in cli

* Line up rewards output

* Add range validator

* Change cli epoch arg -> num epochs

* Add solana inflation rewards subcommand

* Consolidate epoch rewards meta

(cherry picked from commit bb9d2fd07a)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
This commit is contained in:
mergify[bot]
2021-04-08 18:16:04 +00:00
committed by GitHub
parent 6234090361
commit f7211d3c07
8 changed files with 353 additions and 126 deletions

View File

@@ -271,6 +271,7 @@ pub enum CliCommand {
ShowStakeAccount {
pubkey: Pubkey,
use_lamports_unit: bool,
with_rewards: Option<usize>,
},
StakeAuthorize {
stake_account_pubkey: Pubkey,
@@ -330,6 +331,7 @@ pub enum CliCommand {
ShowVoteAccount {
pubkey: Pubkey,
use_lamports_unit: bool,
with_rewards: Option<usize>,
},
WithdrawFromVoteAccount {
vote_account_pubkey: Pubkey,
@@ -1674,11 +1676,13 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
CliCommand::ShowStakeAccount {
pubkey: stake_account_pubkey,
use_lamports_unit,
with_rewards,
} => process_show_stake_account(
&rpc_client,
config,
&stake_account_pubkey,
*use_lamports_unit,
*with_rewards,
),
CliCommand::ShowStakeHistory { use_lamports_unit } => {
process_show_stake_history(&rpc_client, config, *use_lamports_unit)
@@ -1807,11 +1811,13 @@ pub fn process_command(config: &CliConfig) -> ProcessResult {
CliCommand::ShowVoteAccount {
pubkey: vote_account_pubkey,
use_lamports_unit,
with_rewards,
} => process_show_vote_account(
&rpc_client,
config,
&vote_account_pubkey,
*use_lamports_unit,
*with_rewards,
),
CliCommand::WithdrawFromVoteAccount {
vote_account_pubkey,