parent
3757754c89
commit
2ac50177a6
|
@ -1303,6 +1303,7 @@ impl AccountsDB {
|
||||||
Self::hash_account_data(
|
Self::hash_account_data(
|
||||||
slot,
|
slot,
|
||||||
account.account_meta.lamports,
|
account.account_meta.lamports,
|
||||||
|
&account.account_meta.owner,
|
||||||
account.account_meta.executable,
|
account.account_meta.executable,
|
||||||
account.account_meta.rent_epoch,
|
account.account_meta.rent_epoch,
|
||||||
account.data,
|
account.data,
|
||||||
|
@ -1314,6 +1315,7 @@ impl AccountsDB {
|
||||||
Self::hash_account_data(
|
Self::hash_account_data(
|
||||||
slot,
|
slot,
|
||||||
account.lamports,
|
account.lamports,
|
||||||
|
&account.owner,
|
||||||
account.executable,
|
account.executable,
|
||||||
account.rent_epoch,
|
account.rent_epoch,
|
||||||
&account.data,
|
&account.data,
|
||||||
|
@ -1339,6 +1341,7 @@ impl AccountsDB {
|
||||||
pub fn hash_account_data(
|
pub fn hash_account_data(
|
||||||
slot: Slot,
|
slot: Slot,
|
||||||
lamports: u64,
|
lamports: u64,
|
||||||
|
owner: &Pubkey,
|
||||||
executable: bool,
|
executable: bool,
|
||||||
rent_epoch: Epoch,
|
rent_epoch: Epoch,
|
||||||
data: &[u8],
|
data: &[u8],
|
||||||
|
@ -1368,6 +1371,7 @@ impl AccountsDB {
|
||||||
hasher.hash(&[0u8; 1]);
|
hasher.hash(&[0u8; 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hasher.hash(&owner.as_ref());
|
||||||
hasher.hash(&pubkey.as_ref());
|
hasher.hash(&pubkey.as_ref());
|
||||||
|
|
||||||
hasher.result()
|
hasher.result()
|
||||||
|
@ -3469,7 +3473,7 @@ pub mod tests {
|
||||||
};
|
};
|
||||||
let account = stored_account.clone_account();
|
let account = stored_account.clone_account();
|
||||||
let expected_account_hash =
|
let expected_account_hash =
|
||||||
Hash::from_str("GGTsxvxwnMsNfN6yYbBVQaRgvbVLfxeWnGXNyB8iXDyE").unwrap();
|
Hash::from_str("5iRNZVcAnq9JLYjSF2ibFhGEeq48r9Eq9HXxwm3BxywN").unwrap();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
AccountsDB::hash_stored_account(slot, &stored_account),
|
AccountsDB::hash_stored_account(slot, &stored_account),
|
||||||
|
|
Loading…
Reference in New Issue