2025-09-04 16:32:34 +08:00
|
|
|
use solana_sdk::{message::AddressLookupTableAccount, pubkey::Pubkey};
|
2025-06-17 23:32:20 +08:00
|
|
|
|
|
|
|
|
use crate::common::address_lookup_cache::get_address_lookup_table_account;
|
|
|
|
|
|
2025-09-09 00:50:24 +08:00
|
|
|
/// Get address lookup table account list
|
|
|
|
|
/// If lookup_table_key is provided, get the corresponding account, otherwise return empty list
|
2025-06-17 23:32:20 +08:00
|
|
|
pub async fn get_address_lookup_table_accounts(
|
|
|
|
|
lookup_table_key: Option<Pubkey>,
|
|
|
|
|
) -> Vec<AddressLookupTableAccount> {
|
2025-09-07 18:07:45 +08:00
|
|
|
match lookup_table_key {
|
|
|
|
|
Some(key) => {
|
|
|
|
|
let account = get_address_lookup_table_account(&key).await;
|
|
|
|
|
vec![account]
|
|
|
|
|
}
|
|
|
|
|
None => Vec::new(),
|
2025-06-17 23:32:20 +08:00
|
|
|
}
|
2025-09-04 16:32:34 +08:00
|
|
|
}
|