Skip to content

Commit

Permalink
add debugging to test (solana-labs#19563)
Browse files Browse the repository at this point in the history
* add debugging to test

* update cargo
  • Loading branch information
jeffwashington authored and dankelleher committed Nov 24, 2021
1 parent 60903ef commit 4faf4c9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12181,10 +12181,8 @@ pub mod tests {
assert!(db.storage.get_slot_storage_entries(*slot).is_none());
assert!(db.accounts_cache.slot_cache(*slot).is_none());
let account_in_slot = slot_to_pubkey_map[slot];
assert!(db
.accounts_index
.get_account_read_entry(&account_in_slot)
.is_none());
let item = db.accounts_index.get_account_read_entry(&account_in_slot);
assert!(item.is_none(), "item: {:?}", item);
}

// Wait for flush to finish before starting next trial
Expand Down
6 changes: 6 additions & 0 deletions runtime/src/accounts_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ pub struct ReadAccountMapEntry<T: IsCached> {
slot_list_guard: RwLockReadGuard<'this, SlotList<T>>,
}

impl<T: IsCached> Debug for ReadAccountMapEntry<T> {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "{:?}", self.borrow_owned_entry())
}
}

impl<T: IsCached> ReadAccountMapEntry<T> {
pub fn from_account_map_entry(account_map_entry: AccountMapEntry<T>) -> Self {
ReadAccountMapEntryBuilder {
Expand Down

0 comments on commit 4faf4c9

Please sign in to comment.