Snapshot serde test uses calculate_accounts_delta_hash() (#29905)

This commit is contained in:
Brooks 2023-01-25 16:26:15 -05:00 committed by GitHub
parent 704472ae13
commit d76c598691
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 8 deletions

View File

@ -174,18 +174,19 @@ fn test_accounts_serialize_style(serde_style: SerdeStyle) {
AccountShrinkThreshold::default(),
);
let slot = 0;
let mut pubkeys: Vec<Pubkey> = vec![];
create_test_accounts(&accounts, &mut pubkeys, 100, 0);
create_test_accounts(&accounts, &mut pubkeys, 100, slot);
check_accounts(&accounts, &pubkeys, 100);
accounts.add_root(0);
accounts.add_root(slot);
let mut writer = Cursor::new(vec![]);
accountsdb_to_stream(
serde_style,
&mut writer,
&accounts.accounts_db,
0,
&get_storages_to_serialize(&accounts.accounts_db.get_snapshot_storages(..=0, None).0),
slot,
&get_storages_to_serialize(&accounts.accounts_db.get_snapshot_storages(..=slot, None).0),
)
.unwrap();
@ -208,10 +209,9 @@ fn test_accounts_serialize_style(serde_style: SerdeStyle) {
.unwrap(),
);
check_accounts(&daccounts, &pubkeys, 100);
assert_eq!(
accounts.bank_hash_info_at(0).accounts_delta_hash,
daccounts.bank_hash_info_at(0).accounts_delta_hash
);
let accounts_delta_hash = accounts.accounts_db.calculate_accounts_delta_hash(slot);
let daccounts_delta_hash = daccounts.accounts_db.calculate_accounts_delta_hash(slot);
assert_eq!(accounts_delta_hash, daccounts_delta_hash);
}
fn test_bank_serialize_style(