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 f287fd4 commit faf0cb8
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 faf0cb8

Please sign in to comment.