Cli: default to single gossip (#14673)

* Init cli RpcClient with chosen commitment; default to single_gossip

* Fill in missing client methods

* Cli tests: make RpcClient commitment specific

* Simply rpc_client calls, using configured commitment

* Check validator vote account with single-gossip commitment
This commit is contained in:
Tyera Eulberg
2021-01-19 15:33:03 -07:00
committed by GitHub
parent fba4e51171
commit 4964b0fe61
16 changed files with 179 additions and 384 deletions

View File

@ -323,7 +323,7 @@ fn check_vote_account(
authorized_voter_pubkeys: &[Pubkey],
) -> Result<(), String> {
let vote_account = rpc_client
.get_account_with_commitment(vote_account_address, CommitmentConfig::root())
.get_account_with_commitment(vote_account_address, CommitmentConfig::single_gossip())
.map_err(|err| format!("failed to fetch vote account: {}", err.to_string()))?
.value
.ok_or_else(|| format!("vote account does not exist: {}", vote_account_address))?;
@ -336,7 +336,7 @@ fn check_vote_account(
}
let identity_account = rpc_client
.get_account_with_commitment(identity_pubkey, CommitmentConfig::root())
.get_account_with_commitment(identity_pubkey, CommitmentConfig::single_gossip())
.map_err(|err| format!("failed to fetch identity account: {}", err.to_string()))?
.value
.ok_or_else(|| format!("identity account does not exist: {}", identity_pubkey))?;