From 2e5f5d5b4d5049f7d4415245dd967f3cc1046ce9 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 3 Jul 2024 18:38:30 +0000 Subject: [PATCH] v2.0: Remove deprecated address_lookup_table_account re-export (backport of #1972) (#1990) * Remove deprecated address_lookup_table_account re-export (#1972) * Remove deprecated re-export * Remove deprecated stuff from example_mocks * Remove deprecated programs/alt re-export (cherry picked from commit f681fe87d512f441847b6c1e3f2f78850cbdefcf) # Conflicts: # sdk/program/src/lib.rs * Fix conflict --------- Co-authored-by: Tyera --- programs/address-lookup-table/src/lib.rs | 10 ------ sdk/program/src/example_mocks.rs | 41 +--------------------- sdk/program/src/lib.rs | 8 ----- sdk/program/src/message/compiled_keys.rs | 2 +- sdk/program/src/message/versions/v0/mod.rs | 4 +-- sdk/src/lib.rs | 4 +-- 6 files changed, 6 insertions(+), 63 deletions(-) diff --git a/programs/address-lookup-table/src/lib.rs b/programs/address-lookup-table/src/lib.rs index 737c35e4c4b2f4..e146dd184b5385 100644 --- a/programs/address-lookup-table/src/lib.rs +++ b/programs/address-lookup-table/src/lib.rs @@ -3,13 +3,3 @@ #[cfg(not(target_os = "solana"))] pub mod processor; - -#[deprecated( - since = "1.17.0", - note = "Please use `solana_program::address_lookup_table` instead" -)] -pub use solana_program::address_lookup_table::{ - error, instruction, - program::{check_id, id, ID}, - state, -}; diff --git a/sdk/program/src/example_mocks.rs b/sdk/program/src/example_mocks.rs index ebde291ced11bd..b528812e36f6b3 100644 --- a/sdk/program/src/example_mocks.rs +++ b/sdk/program/src/example_mocks.rs @@ -274,44 +274,5 @@ pub mod solana_sdk { } } - #[deprecated( - since = "1.17.0", - note = "Please use `solana_sdk::address_lookup_table` instead" - )] - pub use crate::address_lookup_table as address_lookup_table_account; -} - -#[deprecated( - since = "1.17.0", - note = "Please use `solana_sdk::address_lookup_table` instead" -)] -pub mod solana_address_lookup_table_program { - pub use crate::address_lookup_table::program::{check_id, id, ID}; - - pub mod state { - use { - crate::{instruction::InstructionError, pubkey::Pubkey}, - std::borrow::Cow, - }; - - pub struct AddressLookupTable<'a> { - pub addresses: Cow<'a, [Pubkey]>, - } - - impl<'a> AddressLookupTable<'a> { - pub fn serialize_for_tests(self) -> Result, InstructionError> { - let mut data = vec![]; - self.addresses.iter().for_each(|address| { - data.extend_from_slice(address.as_ref()); - }); - Ok(data) - } - - pub fn deserialize(data: &'a [u8]) -> Result, InstructionError> { - Ok(Self { - addresses: Cow::Borrowed(bytemuck::try_cast_slice(data).unwrap()), - }) - } - } - } + pub use crate::address_lookup_table; } diff --git a/sdk/program/src/lib.rs b/sdk/program/src/lib.rs index 1a136da467d887..fc6a89976b37df 100644 --- a/sdk/program/src/lib.rs +++ b/sdk/program/src/lib.rs @@ -537,14 +537,6 @@ pub mod sysvar; pub mod vote; pub mod wasm; -#[deprecated( - since = "1.17.0", - note = "Please use `solana_sdk::address_lookup_table::AddressLookupTableAccount` instead" -)] -pub mod address_lookup_table_account { - pub use crate::address_lookup_table::AddressLookupTableAccount; -} - #[cfg(target_arch = "wasm32")] pub use wasm_bindgen::prelude::wasm_bindgen; diff --git a/sdk/program/src/message/compiled_keys.rs b/sdk/program/src/message/compiled_keys.rs index 7e9b19a10591e1..a9964c33448be2 100644 --- a/sdk/program/src/message/compiled_keys.rs +++ b/sdk/program/src/message/compiled_keys.rs @@ -1,6 +1,6 @@ #[cfg(not(target_os = "solana"))] use crate::{ - address_lookup_table_account::AddressLookupTableAccount, + address_lookup_table::AddressLookupTableAccount, message::v0::{LoadedAddresses, MessageAddressTableLookup}, }; use { diff --git a/sdk/program/src/message/versions/v0/mod.rs b/sdk/program/src/message/versions/v0/mod.rs index 41e8ec34494c71..a7cb6ce41d3a33 100644 --- a/sdk/program/src/message/versions/v0/mod.rs +++ b/sdk/program/src/message/versions/v0/mod.rs @@ -12,7 +12,7 @@ pub use loaded::*; use { crate::{ - address_lookup_table_account::AddressLookupTableAccount, + address_lookup_table::AddressLookupTableAccount, bpf_loader_upgradeable, hash::Hash, instruction::{CompiledInstruction, Instruction}, @@ -200,7 +200,7 @@ impl Message { /// use solana_rpc_client::rpc_client::RpcClient; /// use solana_program::address_lookup_table::{self, state::{AddressLookupTable, LookupTableMeta}}; /// use solana_sdk::{ - /// address_lookup_table_account::AddressLookupTableAccount, + /// address_lookup_table::AddressLookupTableAccount, /// instruction::{AccountMeta, Instruction}, /// message::{VersionedMessage, v0}, /// pubkey::Pubkey, diff --git a/sdk/src/lib.rs b/sdk/src/lib.rs index fa3eb64ef92289..f7f37afde8ff42 100644 --- a/sdk/src/lib.rs +++ b/sdk/src/lib.rs @@ -41,6 +41,8 @@ pub use signer::signers; pub use solana_program::program_stubs; // These solana_program imports could be *-imported, but that causes a bunch of // confusing duplication in the docs due to a rustdoc bug. #26211 +#[allow(deprecated)] +pub use solana_program::sdk_ids; #[cfg(target_arch = "wasm32")] pub use solana_program::wasm_bindgen; pub use solana_program::{ @@ -55,8 +57,6 @@ pub use solana_program::{ stable_layout, stake, stake_history, syscalls, system_instruction, system_program, sysvar, unchecked_div_by_const, vote, }; -#[allow(deprecated)] -pub use solana_program::{address_lookup_table_account, sdk_ids}; #[cfg(feature = "borsh")] pub use solana_program::{borsh, borsh0_10, borsh1};