mut data refs as slice (#15782)
This commit is contained in:
committed by
GitHub
parent
56923c91bf
commit
1135ffd595
@@ -5052,7 +5052,7 @@ pub mod tests {
|
||||
use assert_matches::assert_matches;
|
||||
use rand::{thread_rng, Rng};
|
||||
use solana_sdk::{
|
||||
account::{AccountSharedData, ReadableAccount},
|
||||
account::{AccountSharedData, ReadableAccount, WritableAccount},
|
||||
hash::HASH_BYTES,
|
||||
pubkey::PUBKEY_BYTES,
|
||||
};
|
||||
@@ -6784,7 +6784,7 @@ pub mod tests {
|
||||
|
||||
// Account data may not be modified
|
||||
let mut account_modified = account.clone();
|
||||
account_modified.data[0] = 42;
|
||||
account_modified.data_as_mut_slice()[0] = 42;
|
||||
assert_ne!(
|
||||
hash,
|
||||
AccountsDb::hash_frozen_account_data(&account_modified)
|
||||
@@ -6888,7 +6888,7 @@ pub mod tests {
|
||||
let ancestors = vec![(0, 0)].into_iter().collect();
|
||||
db.freeze_accounts(&ancestors, &[frozen_pubkey]);
|
||||
|
||||
account.data[0] = 42;
|
||||
account.data_as_mut_slice()[0] = 42;
|
||||
db.store_uncached(0, &[(&frozen_pubkey, &account)]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user