-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify Bank::clean_accounts()
by removing params
#27254
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1626,6 +1626,7 @@ mod tests { | |
.unwrap(); | ||
|
||
// super fun time; callback chooses to .clean_accounts(None) or not | ||
let bank = Arc::new(Bank::new_from_parent(&bank, &collector, bank.slot() + 1)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test below, So, Down in the test you'll see that the numbers are bumped by one; this is due to the extra bank I've added here. |
||
callback(&*bank); | ||
|
||
// create a normal account at the same pubkey as the zero-lamports account | ||
|
@@ -1651,9 +1652,9 @@ mod tests { | |
bank.squash(); | ||
bank.force_flush_accounts_cache(); | ||
// do clean and assert that it actually did its job | ||
assert_eq!(4, bank.get_snapshot_storages(None).len()); | ||
bank.clean_accounts(None); | ||
assert_eq!(3, bank.get_snapshot_storages(None).len()); | ||
bank.clean_accounts(false, false, None); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this looks like the only one ever calling this with the 0th param = false. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. I already changed all the other tests in I didn't know about this test in system_instruction_processor until today. I commented on it above: #27254 (comment) |
||
assert_eq!(2, bank.get_snapshot_storages(None).len()); | ||
}); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since
verify_snapshot_bank()
happens at startup, I wanted to preserve callingAccountsDb::clean_accounts()
withis_startup = true
.This call will change in the next PR too.