Skip to content

Commit

Permalink
migrate tests to get_slot_storage_entry (solana-labs#29515)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored and gnapoli23 committed Jan 10, 2023
1 parent 4f9efe6 commit 4fe27fa
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4249,17 +4249,14 @@ impl AccountsDb {

#[cfg(test)]
pub(crate) fn sizes_of_accounts_in_storage_for_tests(&self, slot: Slot) -> Vec<usize> {
self.get_storages_for_slot(slot)
.map(|storages| {
storages
.iter()
.flat_map(|storage| {
storage
.accounts
.account_iter()
.map(|account| account.stored_size)
})
.collect::<Vec<_>>()
self.storage
.get_slot_storage_entry(slot)
.map(|storage| {
storage
.accounts
.account_iter()
.map(|account| account.stored_size)
.collect()
})
.unwrap_or_default()
}
Expand Down

0 comments on commit 4fe27fa

Please sign in to comment.