Skip to content

Commit 3ad0962

Browse files
authored
cli: Fix get-program-accounts encoding (#26)
#### Problem The `getProgramAccounts` call used during `list-all` fails for certain RPCs, giving a 400 bad request. #### Summary of changes Replace the filter with a base58 encoded version. Separately, we'll need to see what's wrong with the bytes version, but this will at least unblock users.
1 parent 78ac42a commit 3ad0962

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clients/cli/src/client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use {
55
client_error::ClientError,
66
rpc_client::RpcClient,
77
rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig},
8-
rpc_filter::{Memcmp, RpcFilterType},
8+
rpc_filter::{Memcmp, MemcmpEncodedBytes, RpcFilterType},
99
},
1010
solana_program::{
1111
borsh1::try_from_slice_unchecked, hash::Hash, instruction::Instruction, message::Message,
@@ -90,9 +90,9 @@ pub(crate) fn get_stake_pools(
9090
&spl_stake_pool::id(),
9191
RpcProgramAccountsConfig {
9292
// 0 is the account type
93-
filters: Some(vec![RpcFilterType::Memcmp(Memcmp::new_raw_bytes(
93+
filters: Some(vec![RpcFilterType::Memcmp(Memcmp::new(
9494
0,
95-
vec![1],
95+
MemcmpEncodedBytes::Base58("2".to_string()),
9696
))]),
9797
account_config: RpcAccountInfoConfig {
9898
encoding: Some(UiAccountEncoding::Base64),

0 commit comments

Comments
 (0)