Skip to content

Commit

Permalink
fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pgarg66 committed Feb 13, 2023
1 parent ca60eb8 commit f43f41f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions runtime/src/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,21 +578,22 @@ impl Accounts {
hash_queue: &BlockhashQueue,
) -> HashMap<Pubkey, &'a Pubkey> {
let mut result = HashMap::new();
txs.iter().zip(lock_results).for_each(|etx| match etx {
(tx, (Ok(()), nonce)) => {
if let Some(_) = nonce
txs.iter().zip(lock_results).for_each(|etx| {
if let (tx, (Ok(()), nonce)) = etx {
if nonce
.as_ref()
.map(|nonce| nonce.lamports_per_signature())
.unwrap_or_else(|| {
hash_queue.get_lamports_per_signature(tx.message().recent_blockhash())
})
.is_some()
{
tx.message().account_keys().iter().for_each(|key| {
if !result.contains_key(key) {
if let Ok(index) = self.accounts_db.account_matches_owners(
ancestors,
&key,
&program_owners,
key,
program_owners,
) {
program_owners
.get(index)
Expand All @@ -602,7 +603,6 @@ impl Accounts {
});
}
}
_ => {}
});
result
}
Expand Down Expand Up @@ -2008,8 +2008,8 @@ mod tests {
let programs = accounts.filter_program_accounts(
&ancestors,
&[sanitized_tx1, sanitized_tx2],
&vec![(Ok(()), None), (Ok(()), None)],
&vec![&program1_pubkey, &program2_pubkey],
&[(Ok(()), None), (Ok(()), None)],
&[&program1_pubkey, &program2_pubkey],
&hash_queue,
);

Expand Down
4 changes: 2 additions & 2 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ use {
AccountSharedData, InheritableAccountFields, ReadableAccount, WritableAccount,
},
account_utils::StateMut,
bpf_loader, bpf_loader_deprecated,
bpf_loader_upgradeable::{self, UpgradeableLoaderState},
clock::{
BankId, Epoch, Slot, SlotCount, SlotIndex, UnixTimestamp, DEFAULT_HASHES_PER_TICK,
Expand Down Expand Up @@ -154,7 +155,6 @@ use {
transaction_context::{
ExecutionRecord, TransactionAccount, TransactionContext, TransactionReturnData,
},
{bpf_loader, bpf_loader_deprecated},
},
solana_stake_program::stake_state::{
self, InflationPointCalculationEvent, PointValue, StakeState,
Expand Down Expand Up @@ -4421,7 +4421,7 @@ impl Bank {
let program_accounts_map = self.rc.accounts.filter_program_accounts(
&self.ancestors,
sanitized_txs,
&check_results,
check_results,
program_owners,
&self.blockhash_queue.read().unwrap(),
);
Expand Down

0 comments on commit f43f41f

Please sign in to comment.