solana_svm/
transaction_processing_callback.rs

1use solana_sdk::{account::AccountSharedData, pubkey::Pubkey};
2
3/// Runtime callbacks for transaction processing.
4pub trait TransactionProcessingCallback {
5    fn account_matches_owners(&self, account: &Pubkey, owners: &[Pubkey]) -> Option<usize>;
6
7    fn get_account_shared_data(&self, pubkey: &Pubkey) -> Option<AccountSharedData>;
8
9    fn add_builtin_account(&self, _name: &str, _program_id: &Pubkey) {}
10
11    fn inspect_account(&self, _address: &Pubkey, _account_state: AccountState, _is_writable: bool) {
12    }
13}
14
15/// The state the account is in initially, before transaction processing
16#[derive(Debug)]
17pub enum AccountState<'a> {
18    /// This account is dead, and will be created by this transaction
19    Dead,
20    /// This account is alive, and already existed prior to this transaction
21    Alive(&'a AccountSharedData),
22}