Rpc: optionally filter getLargestAccounts by circulating/nonCirculating (#10007)

* Add circ/non-circ filter to getLargestAccounts

* Plumb largest accounts into client and cli

* Bump timeout toward CI flakiness

* Update docs
This commit is contained in:
Tyera Eulberg
2020-05-12 21:05:05 -06:00
committed by GitHub
parent a9b82cf95b
commit ee7f15eff1
10 changed files with 206 additions and 31 deletions

View File

@@ -3,6 +3,7 @@ use crate::{
generic_rpc_client_request::GenericRpcClientRequest,
mock_rpc_client_request::{MockRpcClientRequest, Mocks},
rpc_client_request::RpcClientRequest,
rpc_config::RpcLargestAccountsConfig,
rpc_request::{RpcError, RpcRequest},
rpc_response::*,
};
@@ -197,6 +198,13 @@ impl RpcClient {
self.send(RpcRequest::GetTotalSupply, json!([commitment_config]), 0)
}
pub fn get_largest_accounts_with_config(
&self,
config: RpcLargestAccountsConfig,
) -> RpcResult<Vec<RpcAccountBalance>> {
self.send(RpcRequest::GetLargestAccounts, json!([config]), 0)
}
pub fn get_vote_accounts(&self) -> ClientResult<RpcVoteAccountStatus> {
self.get_vote_accounts_with_commitment(CommitmentConfig::default())
}