Add commitment flag to vote-account and validators commands (#8597)

This commit is contained in:
Michael Vines
2020-03-03 17:53:30 -07:00
committed by GitHub
parent d9b0490f72
commit abf33b3b3b
6 changed files with 104 additions and 58 deletions

View File

@ -165,9 +165,16 @@ impl RpcClient {
}
pub fn get_vote_accounts(&self) -> io::Result<RpcVoteAccountStatus> {
self.get_vote_accounts_with_commitment(CommitmentConfig::default())
}
pub fn get_vote_accounts_with_commitment(
&self,
commitment_config: CommitmentConfig,
) -> io::Result<RpcVoteAccountStatus> {
let response = self
.client
.send(&RpcRequest::GetVoteAccounts, Value::Null, 0)
.send(&RpcRequest::GetVoteAccounts, json!([commitment_config]), 0)
.map_err(|err| {
io::Error::new(
io::ErrorKind::Other,