Nitty code simplification (#26038)
This commit is contained in:
parent
dd0852bc49
commit
deccc880d3
|
@ -1797,21 +1797,14 @@ pub fn process_show_stakes(
|
||||||
|
|
||||||
if let Some(withdraw_authority_pubkey) = withdraw_authority_pubkey {
|
if let Some(withdraw_authority_pubkey) = withdraw_authority_pubkey {
|
||||||
// withdrawer filter
|
// withdrawer filter
|
||||||
let withdrawer_filter = vec![rpc_filter::RpcFilterType::Memcmp(rpc_filter::Memcmp {
|
let withdrawer_filter = rpc_filter::RpcFilterType::Memcmp(rpc_filter::Memcmp {
|
||||||
offset: 44,
|
offset: 44,
|
||||||
bytes: rpc_filter::MemcmpEncodedBytes::Base58(withdraw_authority_pubkey.to_string()),
|
bytes: rpc_filter::MemcmpEncodedBytes::Base58(withdraw_authority_pubkey.to_string()),
|
||||||
encoding: Some(rpc_filter::MemcmpEncoding::Binary),
|
encoding: Some(rpc_filter::MemcmpEncoding::Binary),
|
||||||
})];
|
});
|
||||||
|
|
||||||
match program_accounts_config.filters {
|
let filters = program_accounts_config.filters.get_or_insert(vec![]);
|
||||||
Some(filters) => {
|
filters.push(withdrawer_filter);
|
||||||
// filter by withdrawer
|
|
||||||
program_accounts_config.filters = Some([filters, withdrawer_filter].concat())
|
|
||||||
}
|
|
||||||
None => {
|
|
||||||
program_accounts_config.filters = Some(withdrawer_filter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let all_stake_accounts = rpc_client
|
let all_stake_accounts = rpc_client
|
||||||
|
|
Loading…
Reference in New Issue