show-stake-account now works for reward pool accounts (#5416)

automerge
This commit is contained in:
Michael Vines 2019-08-02 17:15:26 -07:00 committed by Grimes
parent 80bb0158b7
commit ccc0f2d956
2 changed files with 6 additions and 4 deletions

View File

@ -227,7 +227,7 @@ Returns all accounts owned by the provided program Pubkey
##### Results:
The result field will be an array of arrays. Each sub array will contain:
* `string` - a the account Pubkey as base-58 encoded string
* `string` - the account Pubkey as base-58 encoded string
and a JSON object, with the following sub fields:
* `lamports`, number of lamports assigned to this account, as a signed 64-bit integer

View File

@ -725,10 +725,12 @@ fn process_show_stake_account(
}
Ok("".to_string())
}
Ok(StakeState::RewardsPool) => Ok("Stake account is a rewards pool".to_string()),
Ok(StakeState::Uninitialized) => Ok("Stake account is uninitialized".to_string()),
_ => Err(WalletError::RpcRequestError(
"Account data could not be deserialized to stake state".to_string(),
))?,
Err(err) => Err(WalletError::RpcRequestError(format!(
"Account data could not be deserialized to stake state: {:?}",
err
)))?,
}
}