From 4515f6bc22adcbd4adccfa3958027226cd1dc424 Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 17 Oct 2025 15:26:00 -0300 Subject: [PATCH] Remove to_account_shared_data from ReadableAccount --- account/src/lib.rs | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/account/src/lib.rs b/account/src/lib.rs index 279f07793..82dfa28f5 100644 --- a/account/src/lib.rs +++ b/account/src/lib.rs @@ -226,16 +226,6 @@ pub trait ReadableAccount: Sized { fn owner(&self) -> &Pubkey; fn executable(&self) -> bool; fn rent_epoch(&self) -> Epoch; - #[deprecated(since = "3.2.0")] - fn to_account_shared_data(&self) -> AccountSharedData { - AccountSharedData::create( - self.lamports(), - self.data().to_vec(), - *self.owner(), - self.executable(), - self.rent_epoch(), - ) - } } impl ReadableAccount for Account { @@ -344,10 +334,6 @@ impl ReadableAccount for AccountSharedData { fn rent_epoch(&self) -> Epoch { self.rent_epoch } - fn to_account_shared_data(&self) -> AccountSharedData { - // avoid data copy here - self.clone() - } } impl ReadableAccount for Ref<'_, AccountSharedData> { @@ -366,16 +352,6 @@ impl ReadableAccount for Ref<'_, AccountSharedData> { fn rent_epoch(&self) -> Epoch { self.rent_epoch } - fn to_account_shared_data(&self) -> AccountSharedData { - AccountSharedData { - lamports: self.lamports(), - // avoid data copy here - data: Arc::clone(&self.data), - owner: *self.owner(), - executable: self.executable(), - rent_epoch: self.rent_epoch(), - } - } } impl ReadableAccount for Ref<'_, Account> { @@ -918,18 +894,6 @@ pub mod tests { account2.serialize_data(&"hello world").unwrap(); } - #[test] - #[allow(deprecated)] - fn test_to_account_shared_data() { - let key = Pubkey::new_unique(); - let (account1, account2) = make_two_accounts(&key); - assert!(accounts_equal(&account1, &account2)); - let account3 = account1.to_account_shared_data(); - let account4 = account2.to_account_shared_data(); - assert!(accounts_equal(&account1, &account3)); - assert!(accounts_equal(&account1, &account4)); - } - #[test] fn test_account_shared_data() { let key = Pubkey::new_unique();