Skip to content

Commit

Permalink
program sdk: move AddressLookupTableAccount to message::v0
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalojoec committed Mar 8, 2024
1 parent e027a8b commit 511fe42
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 26 deletions.
9 changes: 0 additions & 9 deletions sdk/program/src/address_lookup_table/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,3 @@ pub mod state;
pub mod program {
crate::declare_id!("AddressLookupTab1e1111111111111111111111111");
}

/// The definition of address lookup table accounts.
///
/// As used by the `crate::message::v0` message format.
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct AddressLookupTableAccount {
pub key: crate::pubkey::Pubkey,
pub addresses: Vec<crate::pubkey::Pubkey>,
}
8 changes: 0 additions & 8 deletions sdk/program/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,14 +535,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_os = "solana")]
pub use solana_sdk_macro::wasm_bindgen_stub as wasm_bindgen;
/// Re-export of [wasm-bindgen].
Expand Down
5 changes: 1 addition & 4 deletions sdk/program/src/message/compiled_keys.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#[cfg(not(target_os = "solana"))]
use crate::{
address_lookup_table_account::AddressLookupTableAccount,
message::v0::{LoadedAddresses, MessageAddressTableLookup},
};
use crate::message::v0::{AddressLookupTableAccount, LoadedAddresses, MessageAddressTableLookup};
use {
crate::{instruction::Instruction, message::MessageHeader, pubkey::Pubkey},
std::collections::BTreeMap,
Expand Down
11 changes: 8 additions & 3 deletions sdk/program/src/message/versions/v0/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
//! [future message format]: https://docs.solanalabs.com/proposals/versioned-transactions
use crate::{
address_lookup_table_account::AddressLookupTableAccount,
bpf_loader_upgradeable,
hash::Hash,
instruction::{CompiledInstruction, Instruction},
Expand All @@ -27,6 +26,13 @@ pub use loaded::*;

mod loaded;

/// The definition of address lookup table accounts.
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct AddressLookupTableAccount {
pub key: crate::pubkey::Pubkey,
pub addresses: Vec<crate::pubkey::Pubkey>,
}

/// Address table lookups describe an on-chain address lookup table to use
/// for loading more readonly and writable accounts in a single tx.
#[derive(Serialize, Deserialize, Default, Debug, PartialEq, Eq, Clone, AbiExample)]
Expand Down Expand Up @@ -196,9 +202,8 @@ 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,
/// instruction::{AccountMeta, Instruction},
/// message::{VersionedMessage, v0},
/// message::{VersionedMessage, v0::{self, AddressLookupTableAccount}},
/// pubkey::Pubkey,
/// signature::{Keypair, Signer},
/// transaction::VersionedTransaction,
Expand Down
2 changes: 0 additions & 2 deletions sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ extern crate self as solana_sdk;
pub use signer::signers;
// 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::address_lookup_table_account;
#[cfg(not(target_os = "solana"))]
pub use solana_program::program_stubs;
pub use solana_program::{
Expand Down

0 comments on commit 511fe42

Please sign in to comment.