Cli: default to single gossip (#14673) (#14676)

* 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

(cherry picked from commit 4964b0fe61)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
This commit is contained in:
mergify[bot]
2021-01-19 23:58:19 +00:00
committed by GitHub
parent ca262fdeb9
commit fcd8dd75c5
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))?;