pub struct VMContext {Show 16 fields
pub current_account_id: AccountId,
pub signer_account_id: AccountId,
pub signer_account_pk: PublicKey,
pub predecessor_account_id: AccountId,
pub input: Vec<u8>,
pub block_height: BlockHeight,
pub block_timestamp: u64,
pub epoch_height: EpochHeight,
pub account_balance: Balance,
pub account_locked_balance: Balance,
pub storage_usage: StorageUsage,
pub attached_deposit: Balance,
pub prepaid_gas: Gas,
pub random_seed: Vec<u8>,
pub view_config: Option<ViewConfig>,
pub output_data_receivers: Vec<AccountId>,
}Expand description
Context for the contract execution.
Fields§
§current_account_id: AccountIdThe account id of the current contract that we are executing.
signer_account_id: AccountIdThe account id of that signed the original transaction that led to this execution.
signer_account_pk: PublicKeyThe public key that was used to sign the original transaction that led to this execution.
predecessor_account_id: AccountIdIf this execution is the result of cross-contract call or a callback then
predecessor is the account that called it.
If this execution is the result of direct execution of transaction then it
is equal to signer_account_id.
input: Vec<u8>The input to the contract call. Encoded as base64 string to be able to pass input in borsh binary format.
block_height: BlockHeightThe current block height.
block_timestamp: u64The current block timestamp (number of non-leap-nanoseconds since January 1, 1970 0:00:00 UTC).
epoch_height: EpochHeightThe current epoch height.
account_balance: BalanceThe balance attached to the given account. Excludes the attached_deposit that was
attached to the transaction.
account_locked_balance: BalanceThe balance of pledging tokens on the given account.
storage_usage: StorageUsageThe account’s storage usage before the contract execution
attached_deposit: BalanceThe balance that was attached to the call that will be immediately deposited before the contract execution starts.
prepaid_gas: GasThe gas attached to the call that can be used to pay for the gas fees.
random_seed: Vec<u8>Initial seed for randomness
view_config: Option<ViewConfig>If Some, it means that execution is made in a view mode and defines its configuration. View mode means that only read-only operations are allowed.
output_data_receivers: Vec<AccountId>How many DataReceipt’s should receive this execution result. This should be empty if
this function call is a part of a batch and it is not the last action.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VMContext
impl RefUnwindSafe for VMContext
impl Send for VMContext
impl Sync for VMContext
impl Unpin for VMContext
impl UnwindSafe for VMContext
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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>
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>
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