Skip to content

Commit

Permalink
migrate tests to get_slot_storage_entry
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington committed Jan 4, 2023
1 parent 093b1a5 commit 9523b31
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 9523b31

Please sign in to comment.