make AccountSharedData.data private to abstract storage (#16091)

* format

* 2 more tests

* use
This commit is contained in:
Jeff Washington (jwash)
2021-03-25 11:04:20 -05:00
committed by GitHub
parent 43a116a84e
commit 66c42f62d8
5 changed files with 13 additions and 9 deletions

View File

@ -1561,7 +1561,7 @@ mod tests {
}
fn truncate_data(account: &mut AccountSharedData, len: usize) {
let mut data = account.data.to_vec();
let mut data = account.data().to_vec();
data.truncate(len);
account.set_data(data);
}
@ -3290,7 +3290,11 @@ mod tests {
);
assert_eq!(0, buffer_account.borrow().lamports());
assert_eq!(2, recipient_account.borrow().lamports());
assert!(buffer_account.borrow().data.iter().all(|&value| value == 0));
assert!(buffer_account
.borrow()
.data()
.iter()
.all(|&value| value == 0));
// Case: close with wrong authority
buffer_account

View File

@ -448,7 +448,7 @@ mod tests {
assert_eq!(account.lamports, de_keyed_account.lamports().unwrap());
assert_eq!(
&account.data()[..],
&de_keyed_account.try_account_ref().unwrap().data[..]
&de_keyed_account.try_account_ref().unwrap().data()[..]
);
assert_eq!(account.owner, de_keyed_account.owner().unwrap());
assert_eq!(account.executable, de_keyed_account.executable().unwrap());
@ -507,7 +507,7 @@ mod tests {
assert_eq!(account.lamports, de_keyed_account.lamports().unwrap());
assert_eq!(
&account.data()[..],
&de_keyed_account.try_account_ref().unwrap().data[..]
&de_keyed_account.try_account_ref().unwrap().data()[..]
);
assert_eq!(account.owner, de_keyed_account.owner().unwrap());
assert_eq!(account.executable, de_keyed_account.executable().unwrap());