Skip to content

Commit

Permalink
Remove deprecated address_lookup_table_account re-export (#1972)
Browse files Browse the repository at this point in the history
* Remove deprecated re-export

* Remove deprecated stuff from example_mocks

* Remove deprecated programs/alt re-export

(cherry picked from commit f681fe8)

# Conflicts:
#	sdk/program/src/lib.rs
  • Loading branch information
CriesofCarrots authored and mergify[bot] committed Jul 3, 2024
1 parent 8ac1a45 commit 929d900
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 55 deletions.
10 changes: 0 additions & 10 deletions programs/address-lookup-table/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
41 changes: 1 addition & 40 deletions sdk/program/src/example_mocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Vec<u8>, 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<AddressLookupTable<'a>, InstructionError> {
Ok(Self {
addresses: Cow::Borrowed(bytemuck::try_cast_slice(data).unwrap()),
})
}
}
}
pub use crate::address_lookup_table;
}
5 changes: 5 additions & 0 deletions sdk/program/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ pub mod sysvar;
pub mod vote;
pub mod wasm;

<<<<<<< HEAD
#[deprecated(
since = "1.17.0",
note = "Please use `solana_sdk::address_lookup_table::AddressLookupTableAccount` instead"
Expand All @@ -545,6 +546,10 @@ pub mod address_lookup_table_account {
pub use crate::address_lookup_table::AddressLookupTableAccount;
}

=======
#[deprecated(since = "2.1.0", note = "Use `solana-sanitize` crate instead")]
pub use solana_sanitize as sanitize;
>>>>>>> f681fe87d5 (Remove deprecated address_lookup_table_account re-export (#1972))
#[cfg(target_arch = "wasm32")]
pub use wasm_bindgen::prelude::wasm_bindgen;

Expand Down
2 changes: 1 addition & 1 deletion sdk/program/src/message/compiled_keys.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions sdk/program/src/message/versions/v0/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand All @@ -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};

Expand Down

0 comments on commit 929d900

Please sign in to comment.