Don't abort for missing epoch rewards; intead display warn (#13457)

This commit is contained in:
Ryo Onodera
2020-11-07 18:32:29 +09:00
committed by GitHub
parent abc27d2900
commit c5b9831bfb
2 changed files with 14 additions and 10 deletions

View File

@@ -1714,11 +1714,12 @@ pub fn process_show_stake_account(
if state.stake_type == CliStakeType::Stake {
if let Some(activation_epoch) = state.activation_epoch {
state.epoch_rewards = Some(fetch_epoch_rewards(
rpc_client,
stake_account_address,
activation_epoch,
)?);
let rewards =
fetch_epoch_rewards(rpc_client, stake_account_address, activation_epoch);
match rewards {
Ok(rewards) => state.epoch_rewards = Some(rewards),
Err(error) => eprintln!("Failed to fetch epoch rewards: {:?}", error),
};
}
}
Ok(config.output_format.formatted_string(&state))