Struct oasis_runtime_sdk::state::Environment
source · pub struct Environment { /* private fields */ }
Expand description
Information about the execution environment.
Implementations§
source§impl Environment
impl Environment
sourcepub fn is_check_only(&self) -> bool
pub fn is_check_only(&self) -> bool
Whether the execution mode is such that only checks should be performed.
sourcepub fn is_pre_schedule(&self) -> bool
pub fn is_pre_schedule(&self) -> bool
Whether the execution mode is Mode::PreSchedule
.
sourcepub fn is_simulation(&self) -> bool
pub fn is_simulation(&self) -> bool
Whether the execution mode is Mode::Simulate
.
sourcepub fn is_execute(&self) -> bool
pub fn is_execute(&self) -> bool
Whether the execution mode is Mode::Execute
.
sourcepub fn is_transaction(&self) -> bool
pub fn is_transaction(&self) -> bool
Whether there is an active transaction in the current environment.
sourcepub fn tx_index(&self) -> usize
pub fn tx_index(&self) -> usize
An active transaction’s index (order) within the block.
§Panics
This method will panic if called outside a transaction environment.
sourcepub fn tx_size(&self) -> u32
pub fn tx_size(&self) -> u32
An active transaction’s size in bytes.
§Panics
This method will panic if called outside a transaction environment.
sourcepub fn tx_auth_info(&self) -> &AuthInfo
pub fn tx_auth_info(&self) -> &AuthInfo
An active transaction’s authentication information.
§Panics
This method will panic if called outside a transaction environment.
sourcepub fn tx_call_format(&self) -> CallFormat
pub fn tx_call_format(&self) -> CallFormat
An active transaction’s call format.
§Panics
This method will panic if called outside a transaction environment.
sourcepub fn is_read_only(&self) -> bool
pub fn is_read_only(&self) -> bool
An active transaction’s read only flag.
§Panics
This method will panic if called outside a transaction environment.
sourcepub fn is_internal(&self) -> bool
pub fn is_internal(&self) -> bool
Whether the current execution environment is part of an internal subcall.
sourcepub fn tx_caller_address(&self) -> Address
pub fn tx_caller_address(&self) -> Address
Authenticated address of the caller.
In case there are multiple signers of a transaction, this will return the address corresponding to the first signer. If there are no signers, it returns the default address.
§Panics
This method will panic if called outside a transaction environment.
Trait Implementations§
source§impl Clone for Environment
impl Clone for Environment
source§fn clone(&self) -> Environment
fn clone(&self) -> Environment
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more