Skip to content

Commit

Permalink
add slot to assert message (solana-labs#34225)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored Nov 28, 2023
1 parent 40f5870 commit 32c7acb
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions accounts-db/src/account_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ impl AccountStorage {
/// return the append vec for 'slot' if it exists
/// This is only ever called when shrink is not possibly running and there is a max of 1 append vec per slot.
pub fn get_slot_storage_entry(&self, slot: Slot) -> Option<Arc<AccountStorageEntry>> {
assert!(self.no_shrink_in_progress());
assert!(
self.no_shrink_in_progress(),
"self.no_shrink_in_progress(): {slot}"
);
self.get_slot_storage_entry_shrinking_in_progress_ok(slot)
}

Expand All @@ -95,7 +98,10 @@ impl AccountStorage {
/// returns true if there is no entry for 'slot'
#[cfg(test)]
pub(crate) fn is_empty_entry(&self, slot: Slot) -> bool {
assert!(self.no_shrink_in_progress());
assert!(
self.no_shrink_in_progress(),
"self.no_shrink_in_progress(): {slot}"
);
self.map.get(&slot).is_none()
}

Expand Down Expand Up @@ -124,7 +130,10 @@ impl AccountStorage {
}

pub(crate) fn insert(&self, slot: Slot, store: Arc<AccountStorageEntry>) {
assert!(self.no_shrink_in_progress());
assert!(
self.no_shrink_in_progress(),
"self.no_shrink_in_progress(): {slot}"
);
assert!(self
.map
.insert(
Expand Down

0 comments on commit 32c7acb

Please sign in to comment.