Return error if stake history deser fails in cli (#6559)
This commit is contained in:
parent
0d1f463f7f
commit
0cfa3d3de7
|
@ -597,7 +597,9 @@ pub fn process_show_stake_history(
|
||||||
use_lamports_unit: bool,
|
use_lamports_unit: bool,
|
||||||
) -> ProcessResult {
|
) -> ProcessResult {
|
||||||
let stake_history_account = rpc_client.get_account(&stake_history::id())?;
|
let stake_history_account = rpc_client.get_account(&stake_history::id())?;
|
||||||
let stake_history = StakeHistory::from_account(&stake_history_account).unwrap();
|
let stake_history = StakeHistory::from_account(&stake_history_account).ok_or_else(|| {
|
||||||
|
CliError::RpcRequestError("Failed to deserialize stake history".to_string())
|
||||||
|
})?;
|
||||||
|
|
||||||
println!();
|
println!();
|
||||||
println!(
|
println!(
|
||||||
|
|
Loading…
Reference in New Issue