TxVMHooksContext

Struct TxVMHooksContext 

Source
pub struct TxVMHooksContext<S: InstanceState> { /* private fields */ }

Implementations§

Source§

impl<S: InstanceState> TxVMHooksContext<S>

Source

pub fn new(tx_context_ref: TxContextRef, instance_state_ref: S) -> Self

Trait Implementations§

Source§

impl<S: InstanceState> Debug for TxVMHooksContext<S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S: InstanceState> VMHooksContext for TxVMHooksContext<S>

Source§

unsafe fn memory_load(&self, offset: MemPtr, length: MemLength) -> Vec<u8>

Loads a slice of memory from the instance. Read more
Source§

unsafe fn memory_store(&self, mem_ptr: MemPtr, data: &[u8])

Writes to instance memory. Read more
Source§

fn m_types_lock(&self) -> MutexGuard<'_, ManagedTypeContainer>

Source§

fn gas_schedule(&self) -> &GasSchedule

Source§

fn use_gas(&mut self, gas: u64) -> Result<(), VMHooksEarlyExit>

Source§

fn input_ref(&self) -> &TxInput

Source§

fn random_next_bytes(&self, length: usize) -> Vec<u8>

Random number generator, based on the blockchain randomness source.
Source§

fn result_lock(&self) -> MutexGuard<'_, TxResult>

Source§

fn storage_read_any_address(&self, address: &VMAddress, key: &[u8]) -> Vec<u8>

Source§

fn storage_write( &mut self, key: &[u8], value: &[u8], ) -> Result<(), VMHooksEarlyExit>

Source§

fn get_block_config(&self) -> &BlockConfig

Source§

fn back_transfers_lock(&self) -> MutexGuard<'_, BackTransfers>

Source§

fn account_data(&self, address: &VMAddress) -> Option<AccountData>

For ownership reasons, needs to return a clone. Read more
Source§

fn account_code(&self, address: &VMAddress) -> Vec<u8>

Source§

fn perform_async_call( &mut self, to: VMAddress, egld_value: BigUint, func_name: TxFunctionName, arguments: Vec<Vec<u8>>, ) -> Result<(), VMHooksEarlyExit>

Source§

fn perform_execute_on_dest_context( &mut self, to: VMAddress, egld_value: BigUint, func_name: TxFunctionName, arguments: Vec<Vec<u8>>, ) -> Result<Vec<Vec<u8>>, VMHooksEarlyExit>

Source§

fn perform_execute_on_dest_context_readonly( &mut self, to: VMAddress, func_name: TxFunctionName, arguments: Vec<Vec<u8>>, ) -> Result<Vec<Vec<u8>>, VMHooksEarlyExit>

Source§

fn perform_deploy( &mut self, egld_value: BigUint, contract_code: Vec<u8>, code_metadata: VMCodeMetadata, args: Vec<Vec<u8>>, ) -> Result<(VMAddress, Vec<Vec<u8>>), VMHooksEarlyExit>

Source§

fn perform_transfer_execute( &mut self, to: VMAddress, egld_value: BigUint, func_name: TxFunctionName, arguments: Vec<Vec<u8>>, ) -> Result<(), VMHooksEarlyExit>

Source§

fn current_address(&self) -> &VMAddress

Source§

fn tx_hash(&self) -> H256

Source§

fn push_tx_log(&self, tx_log: TxLog)

Source§

fn storage_read(&self, key: &[u8]) -> Vec<u8>

Auto Trait Implementations§

§

impl<S> Freeze for TxVMHooksContext<S>
where S: Freeze,

§

impl<S> !RefUnwindSafe for TxVMHooksContext<S>

§

impl<S> Send for TxVMHooksContext<S>
where S: Send,

§

impl<S> Sync for TxVMHooksContext<S>
where S: Sync,

§

impl<S> Unpin for TxVMHooksContext<S>
where S: Unpin,

§

impl<S> !UnwindSafe for TxVMHooksContext<S>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.