Uses set_accounts_{delta,}_hash_for_tests() in serde tests (#30390)
This commit is contained in:
parent
ee1717b24b
commit
ad6a3abd8b
|
@ -9501,6 +9501,15 @@ pub mod tests {
|
|||
pub fn set_accounts_hash_for_tests(&self, slot: Slot, accounts_hash: AccountsHash) {
|
||||
self.set_accounts_hash(slot, accounts_hash);
|
||||
}
|
||||
|
||||
// used by serde_snapshot tests
|
||||
pub fn set_accounts_delta_hash_for_tests(
|
||||
&self,
|
||||
slot: Slot,
|
||||
accounts_delta_hash: AccountsDeltaHash,
|
||||
) {
|
||||
self.set_accounts_delta_hash(slot, accounts_delta_hash);
|
||||
}
|
||||
}
|
||||
|
||||
/// This impl exists until this feature is activated:
|
||||
|
|
|
@ -188,7 +188,7 @@ fn test_accounts_serialize_style(serde_style: SerdeStyle) {
|
|||
let accounts_hash = AccountsHash(Hash::new_unique());
|
||||
accounts
|
||||
.accounts_db
|
||||
.set_accounts_hash_from_snapshot(slot, accounts_hash);
|
||||
.set_accounts_hash_for_tests(slot, accounts_hash);
|
||||
|
||||
let mut writer = Cursor::new(vec![]);
|
||||
accountsdb_to_stream(
|
||||
|
@ -521,11 +521,11 @@ fn test_extra_fields_eof() {
|
|||
bank.rc
|
||||
.accounts
|
||||
.accounts_db
|
||||
.set_accounts_delta_hash_from_snapshot(bank.slot(), AccountsDeltaHash(Hash::new_unique()));
|
||||
.set_accounts_delta_hash_for_tests(bank.slot(), AccountsDeltaHash(Hash::new_unique()));
|
||||
bank.rc
|
||||
.accounts
|
||||
.accounts_db
|
||||
.set_accounts_hash_from_snapshot(bank.slot(), AccountsHash(Hash::new_unique()));
|
||||
.set_accounts_hash_for_tests(bank.slot(), AccountsHash(Hash::new_unique()));
|
||||
|
||||
// Set extra fields
|
||||
bank.fee_rate_governor.lamports_per_signature = 7000;
|
||||
|
@ -657,11 +657,11 @@ fn test_blank_extra_fields() {
|
|||
bank.rc
|
||||
.accounts
|
||||
.accounts_db
|
||||
.set_accounts_delta_hash_from_snapshot(bank.slot(), AccountsDeltaHash(Hash::new_unique()));
|
||||
.set_accounts_delta_hash_for_tests(bank.slot(), AccountsDeltaHash(Hash::new_unique()));
|
||||
bank.rc
|
||||
.accounts
|
||||
.accounts_db
|
||||
.set_accounts_hash_from_snapshot(bank.slot(), AccountsHash(Hash::new_unique()));
|
||||
.set_accounts_hash_for_tests(bank.slot(), AccountsHash(Hash::new_unique()));
|
||||
|
||||
// Set extra fields
|
||||
bank.fee_rate_governor.lamports_per_signature = 7000;
|
||||
|
@ -733,14 +733,11 @@ mod test_bank_serialize {
|
|||
bank.rc
|
||||
.accounts
|
||||
.accounts_db
|
||||
.set_accounts_delta_hash_from_snapshot(
|
||||
bank.slot(),
|
||||
AccountsDeltaHash(Hash::new_unique()),
|
||||
);
|
||||
.set_accounts_delta_hash_for_tests(bank.slot(), AccountsDeltaHash(Hash::new_unique()));
|
||||
bank.rc
|
||||
.accounts
|
||||
.accounts_db
|
||||
.set_accounts_hash_from_snapshot(bank.slot(), AccountsHash(Hash::new_unique()));
|
||||
.set_accounts_hash_for_tests(bank.slot(), AccountsHash(Hash::new_unique()));
|
||||
let snapshot_storages = bank
|
||||
.rc
|
||||
.accounts
|
||||
|
|
Loading…
Reference in New Issue