Removes AccountsDb::hash_account_with_rent_epoch() (#29138)

This commit is contained in:
Brooks Prumo 2022-12-08 13:08:36 -05:00 committed by GitHub
parent 2f4731570a
commit 2d4f17e1c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 40 deletions

View File

@ -6085,25 +6085,6 @@ impl AccountsDb {
}
}
pub fn hash_account_with_rent_epoch<T: ReadableAccount>(
slot: Slot,
account: &T,
pubkey: &Pubkey,
rent_epoch: Epoch,
include_slot: IncludeSlotInHash,
) -> Hash {
Self::hash_account_data(
slot,
account.lamports(),
account.owner(),
account.executable(),
rent_epoch,
account.data(),
pubkey,
include_slot,
)
}
pub fn hash_account<T: ReadableAccount>(
slot: Slot,
account: &T,
@ -16675,27 +16656,6 @@ pub mod tests {
}
}
#[test]
fn test_hash_account_with_rent_epoch() {
let owner = solana_sdk::pubkey::new_rand();
let pubkey = solana_sdk::pubkey::new_rand();
let slot = 9;
let mut account = AccountSharedData::new(2, 1, &owner);
for rent in 0..3 {
account.set_rent_epoch(rent);
assert_eq!(
AccountsDb::hash_account(slot, &account, &pubkey, INCLUDE_SLOT_IN_HASH_TESTS),
AccountsDb::hash_account_with_rent_epoch(
slot,
&account,
&pubkey,
rent,
INCLUDE_SLOT_IN_HASH_TESTS
)
);
}
}
#[test]
fn test_extend_hashes_with_skipped_rewrites() {
let db = AccountsDb::new_single_for_tests();