Removes AccountsDb::hash_account_with_rent_epoch() (#29138)
This commit is contained in:
parent
2f4731570a
commit
2d4f17e1c9
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue