From ccc0f2d956be86f4c573170952a102b336208238 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 2 Aug 2019 17:15:26 -0700 Subject: [PATCH] show-stake-account now works for reward pool accounts (#5416) automerge --- book/src/jsonrpc-api.md | 2 +- wallet/src/wallet.rs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/book/src/jsonrpc-api.md b/book/src/jsonrpc-api.md index e55228677e..8ce2c96783 100644 --- a/book/src/jsonrpc-api.md +++ b/book/src/jsonrpc-api.md @@ -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 diff --git a/wallet/src/wallet.rs b/wallet/src/wallet.rs index 301fbb811b..2612f2b198 100644 --- a/wallet/src/wallet.rs +++ b/wallet/src/wallet.rs @@ -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 + )))?, } }