Skip to content

Commit 8f4cae4

Browse files
committed
Remove to_account_shared_data from ReadableAccount
1 parent 7220327 commit 8f4cae4

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

account/src/lib.rs

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ pub trait ReadableAccount: Sized {
226226
fn owner(&self) -> &Pubkey;
227227
fn executable(&self) -> bool;
228228
fn rent_epoch(&self) -> Epoch;
229+
<<<<<<< HEAD
229230
#[deprecated(since = "3.2.0")]
230231
fn to_account_shared_data(&self) -> AccountSharedData {
231232
AccountSharedData::create(
@@ -236,6 +237,8 @@ pub trait ReadableAccount: Sized {
236237
self.rent_epoch(),
237238
)
238239
}
240+
=======
241+
>>>>>>> 8546c642 (Remove to_account_shared_data from ReadableAccount)
239242
}
240243

241244
impl ReadableAccount for Account {
@@ -344,10 +347,6 @@ impl ReadableAccount for AccountSharedData {
344347
fn rent_epoch(&self) -> Epoch {
345348
self.rent_epoch
346349
}
347-
fn to_account_shared_data(&self) -> AccountSharedData {
348-
// avoid data copy here
349-
self.clone()
350-
}
351350
}
352351

353352
impl ReadableAccount for Ref<'_, AccountSharedData> {
@@ -366,16 +365,6 @@ impl ReadableAccount for Ref<'_, AccountSharedData> {
366365
fn rent_epoch(&self) -> Epoch {
367366
self.rent_epoch
368367
}
369-
fn to_account_shared_data(&self) -> AccountSharedData {
370-
AccountSharedData {
371-
lamports: self.lamports(),
372-
// avoid data copy here
373-
data: Arc::clone(&self.data),
374-
owner: *self.owner(),
375-
executable: self.executable(),
376-
rent_epoch: self.rent_epoch(),
377-
}
378-
}
379368
}
380369

381370
impl ReadableAccount for Ref<'_, Account> {
@@ -918,18 +907,6 @@ pub mod tests {
918907
account2.serialize_data(&"hello world").unwrap();
919908
}
920909

921-
#[test]
922-
#[allow(deprecated)]
923-
fn test_to_account_shared_data() {
924-
let key = Pubkey::new_unique();
925-
let (account1, account2) = make_two_accounts(&key);
926-
assert!(accounts_equal(&account1, &account2));
927-
let account3 = account1.to_account_shared_data();
928-
let account4 = account2.to_account_shared_data();
929-
assert!(accounts_equal(&account1, &account3));
930-
assert!(accounts_equal(&account1, &account4));
931-
}
932-
933910
#[test]
934911
fn test_account_shared_data() {
935912
let key = Pubkey::new_unique();

0 commit comments

Comments
 (0)