solana_svm_transaction/svm_message/
sanitized_transaction.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
use {
    crate::{
        instruction::SVMInstruction, message_address_table_lookup::SVMMessageAddressTableLookup,
        svm_message::SVMMessage,
    },
    solana_sdk::{
        hash::Hash, message::AccountKeys, pubkey::Pubkey, transaction::SanitizedTransaction,
    },
};

impl SVMMessage for SanitizedTransaction {
    fn num_total_signatures(&self) -> u64 {
        SVMMessage::num_total_signatures(SanitizedTransaction::message(self))
    }

    fn num_write_locks(&self) -> u64 {
        SVMMessage::num_write_locks(SanitizedTransaction::message(self))
    }

    fn recent_blockhash(&self) -> &Hash {
        SVMMessage::recent_blockhash(SanitizedTransaction::message(self))
    }

    fn num_instructions(&self) -> usize {
        SVMMessage::num_instructions(SanitizedTransaction::message(self))
    }

    fn instructions_iter(&self) -> impl Iterator<Item = SVMInstruction> {
        SVMMessage::instructions_iter(SanitizedTransaction::message(self))
    }

    fn program_instructions_iter(&self) -> impl Iterator<Item = (&Pubkey, SVMInstruction)> {
        SVMMessage::program_instructions_iter(SanitizedTransaction::message(self))
    }

    fn account_keys(&self) -> AccountKeys {
        SVMMessage::account_keys(SanitizedTransaction::message(self))
    }

    fn fee_payer(&self) -> &Pubkey {
        SVMMessage::fee_payer(SanitizedTransaction::message(self))
    }

    fn is_writable(&self, index: usize) -> bool {
        SVMMessage::is_writable(SanitizedTransaction::message(self), index)
    }

    fn is_signer(&self, index: usize) -> bool {
        SVMMessage::is_signer(SanitizedTransaction::message(self), index)
    }

    fn is_invoked(&self, key_index: usize) -> bool {
        SVMMessage::is_invoked(SanitizedTransaction::message(self), key_index)
    }

    fn num_lookup_tables(&self) -> usize {
        SVMMessage::num_lookup_tables(SanitizedTransaction::message(self))
    }

    fn message_address_table_lookups(&self) -> impl Iterator<Item = SVMMessageAddressTableLookup> {
        SVMMessage::message_address_table_lookups(SanitizedTransaction::message(self))
    }
}