get_program_accounts_with_config() now correctly defaults to RpcClient's commitment level (backport #17312) (#17315)
* get_program_accounts_with_config() now correctly defaults to RpcClient's commitment level
(cherry picked from commit 63b97729e6
)
# Conflicts:
# client/src/rpc_client.rs
* Update rpc_client.rs
Co-authored-by: Michael Vines <mvines@gmail.com>
This commit is contained in:
@ -1016,8 +1016,7 @@ impl RpcClient {
|
||||
RpcProgramAccountsConfig {
|
||||
filters: None,
|
||||
account_config: RpcAccountInfoConfig {
|
||||
encoding: Some(UiAccountEncoding::Base64),
|
||||
commitment: Some(self.commitment_config),
|
||||
encoding: Some(UiAccountEncoding::Base64Zstd),
|
||||
..RpcAccountInfoConfig::default()
|
||||
},
|
||||
},
|
||||
@ -1029,7 +1028,10 @@ impl RpcClient {
|
||||
pubkey: &Pubkey,
|
||||
config: RpcProgramAccountsConfig,
|
||||
) -> ClientResult<Vec<(Pubkey, Account)>> {
|
||||
let commitment = config.account_config.commitment.unwrap_or_default();
|
||||
let commitment = config
|
||||
.account_config
|
||||
.commitment
|
||||
.unwrap_or_else(|| self.commitment());
|
||||
let commitment = self.maybe_map_commitment(commitment)?;
|
||||
let account_config = RpcAccountInfoConfig {
|
||||
commitment: Some(commitment),
|
||||
|
Reference in New Issue
Block a user