pass expected capitalization to hash calculation to improve assert msg (#15191)

* cleanup if

* pass expected capitalization to hash calculation to improve assert message

* fix bank function

* one more level

* calculate_accounts_hash_helper

* add slot to error message

* success
This commit is contained in:
Jeff Washington (jwash)
2021-02-10 14:38:00 -06:00
committed by GitHub
parent c1e93b3ef9
commit e59a24d9f9
4 changed files with 26 additions and 18 deletions

View File

@@ -121,13 +121,14 @@ impl SnapshotRequestHandler {
flush_accounts_cache_time.stop();
let mut hash_time = Measure::start("hash_time");
let mut hash_for_testing = None;
const USE_INDEX: bool = true;
snapshot_root_bank
.update_accounts_hash_with_index_option(!USE_INDEX, test_hash_calculation);
if test_hash_calculation {
hash_for_testing = Some(snapshot_root_bank.get_accounts_hash());
}
.update_accounts_hash_with_index_option(USE_INDEX, test_hash_calculation);
let hash_for_testing = if test_hash_calculation {
Some(snapshot_root_bank.get_accounts_hash())
} else {
None
};
hash_time.stop();
let mut clean_time = Measure::start("clean_time");