Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Nitty code simplification (#26038)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyera Eulberg authored Jun 17, 2022
1 parent dd0852b commit deccc88
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions cli/src/cluster_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1797,21 +1797,14 @@ pub fn process_show_stakes(

if let Some(withdraw_authority_pubkey) = withdraw_authority_pubkey {
// 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,
bytes: rpc_filter::MemcmpEncodedBytes::Base58(withdraw_authority_pubkey.to_string()),
encoding: Some(rpc_filter::MemcmpEncoding::Binary),
})];
});

match program_accounts_config.filters {
Some(filters) => {
// filter by withdrawer
program_accounts_config.filters = Some([filters, withdrawer_filter].concat())
}
None => {
program_accounts_config.filters = Some(withdrawer_filter);
}
}
let filters = program_accounts_config.filters.get_or_insert(vec![]);
filters.push(withdrawer_filter);
}

let all_stake_accounts = rpc_client
Expand Down

0 comments on commit deccc88

Please sign in to comment.