solana_svm_transaction/
message_address_table_lookup.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use solana_sdk::{message::v0, pubkey::Pubkey};

/// A non-owning version of [`v0::MessageAddressTableLookup`].
/// This simply references the data in the original message.
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct SVMMessageAddressTableLookup<'a> {
    /// Address lookup table account key
    pub account_key: &'a Pubkey,
    /// List of indexes used to load writable account addresses
    pub writable_indexes: &'a [u8],
    /// List of indexes used to load readonly account addresses
    pub readonly_indexes: &'a [u8],
}

impl<'a> From<&'a v0::MessageAddressTableLookup> for SVMMessageAddressTableLookup<'a> {
    fn from(lookup: &'a v0::MessageAddressTableLookup) -> Self {
        Self {
            account_key: &lookup.account_key,
            writable_indexes: &lookup.writable_indexes,
            readonly_indexes: &lookup.readonly_indexes,
        }
    }
}