pub struct MessageProcessor { /* private fields */ }
Implementations§
Source§impl MessageProcessor
impl MessageProcessor
Sourcepub fn add_program(
&mut self,
program_id: Pubkey,
process_instruction: ProcessInstructionWithContext,
)
pub fn add_program( &mut self, program_id: Pubkey, process_instruction: ProcessInstructionWithContext, )
Add a static entrypoint to intercept instructions before the dynamic loader.
Sourcepub fn create_pre_accounts(
message: &Message,
instruction: &CompiledInstruction,
accounts: &[(Pubkey, Rc<RefCell<AccountSharedData>>)],
) -> Vec<PreAccount>
pub fn create_pre_accounts( message: &Message, instruction: &CompiledInstruction, accounts: &[(Pubkey, Rc<RefCell<AccountSharedData>>)], ) -> Vec<PreAccount>
Record the initial state of the accounts so that they can be compared after the instruction is processed
Sourcepub fn verify_account_references(
accounts: &[(Pubkey, Rc<RefCell<AccountSharedData>>)],
program_indices: &[usize],
) -> Result<(), InstructionError>
pub fn verify_account_references( accounts: &[(Pubkey, Rc<RefCell<AccountSharedData>>)], program_indices: &[usize], ) -> Result<(), InstructionError>
Verify there are no outstanding borrows
Sourcepub fn verify(
message: &Message,
instruction: &CompiledInstruction,
pre_accounts: &[PreAccount],
program_indices: &[usize],
accounts: &[(Pubkey, Rc<RefCell<AccountSharedData>>)],
rent: &Rent,
timings: &mut ExecuteDetailsTimings,
logger: Rc<RefCell<dyn Logger>>,
demote_program_write_locks: bool,
) -> Result<(), InstructionError>
pub fn verify( message: &Message, instruction: &CompiledInstruction, pre_accounts: &[PreAccount], program_indices: &[usize], accounts: &[(Pubkey, Rc<RefCell<AccountSharedData>>)], rent: &Rent, timings: &mut ExecuteDetailsTimings, logger: Rc<RefCell<dyn Logger>>, demote_program_write_locks: bool, ) -> Result<(), InstructionError>
Verify the results of an instruction
Sourcepub fn process_message(
&self,
message: &Message,
program_indices: &[Vec<usize>],
accounts: &[(Pubkey, Rc<RefCell<AccountSharedData>>)],
rent_collector: &RentCollector,
log_collector: Option<Rc<LogCollector>>,
executors: Rc<RefCell<Executors>>,
instruction_recorders: Option<&[InstructionRecorder]>,
feature_set: Arc<FeatureSet>,
compute_budget: ComputeBudget,
compute_meter: Rc<RefCell<dyn ComputeMeter>>,
timings: &mut ExecuteDetailsTimings,
account_db: Arc<Accounts>,
ancestors: &Ancestors,
blockhash: Hash,
fee_calculator: FeeCalculator,
) -> Result<(), TransactionError>
pub fn process_message( &self, message: &Message, program_indices: &[Vec<usize>], accounts: &[(Pubkey, Rc<RefCell<AccountSharedData>>)], rent_collector: &RentCollector, log_collector: Option<Rc<LogCollector>>, executors: Rc<RefCell<Executors>>, instruction_recorders: Option<&[InstructionRecorder]>, feature_set: Arc<FeatureSet>, compute_budget: ComputeBudget, compute_meter: Rc<RefCell<dyn ComputeMeter>>, timings: &mut ExecuteDetailsTimings, account_db: Arc<Accounts>, ancestors: &Ancestors, blockhash: Hash, fee_calculator: FeeCalculator, ) -> Result<(), TransactionError>
Process a message. This method calls each instruction in the message over the set of loaded Accounts The accounts are committed back to the bank only if every instruction succeeds
Trait Implementations§
Source§impl AbiExample for MessageProcessor
impl AbiExample for MessageProcessor
Source§impl Clone for MessageProcessor
impl Clone for MessageProcessor
Source§fn clone(&self) -> MessageProcessor
fn clone(&self) -> MessageProcessor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MessageProcessor
impl Debug for MessageProcessor
Source§impl Default for MessageProcessor
impl Default for MessageProcessor
Source§fn default() -> MessageProcessor
fn default() -> MessageProcessor
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for MessageProcessor
impl<'de> Deserialize<'de> for MessageProcessor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl !Freeze for MessageProcessor
impl RefUnwindSafe for MessageProcessor
impl Send for MessageProcessor
impl Sync for MessageProcessor
impl Unpin for MessageProcessor
impl UnwindSafe for MessageProcessor
Blanket Implementations§
Source§impl<T> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, _digester: &mut AbiDigester, ) -> Result<AbiDigester, DigestError>
Source§impl<T> AbiEnumVisitor for T
impl<T> AbiEnumVisitor for T
default fn visit_for_abi( &self, digester: &mut AbiDigester, ) -> Result<AbiDigester, DigestError>
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more