Trait oasis_contract_sdk::context::Context

source ·
pub trait Context {
    type PublicStore: PublicStore;
    type ConfidentialStore: ConfidentialStore;
    type Env: Env + Crypto;

    // Required methods
    fn instance_id(&self) -> InstanceId;
    fn instance_address(&self) -> &Address;
    fn caller_address(&self) -> &Address;
    fn deposited_tokens(&self) -> &[BaseUnits];
    fn is_read_only(&self) -> bool;
    fn call_format(&self) -> CallFormat;
    fn emit_message(&mut self, msg: Message);
    fn emit_event<E: Event>(&mut self, event: E);
    fn public_store(&mut self) -> &mut Self::PublicStore;
    fn confidential_store(&mut self) -> &mut Self::ConfidentialStore;
    fn env(&self) -> &Self::Env;
}
Expand description

Execution context.

Required Associated Types§

source

type PublicStore: PublicStore

The public store.

source

type ConfidentialStore: ConfidentialStore

The confidential store.

source

type Env: Env + Crypto

The environment.

Required Methods§

source

fn instance_id(&self) -> InstanceId

Contract instance identifier.

source

fn instance_address(&self) -> &Address

Contract instance address.

source

fn caller_address(&self) -> &Address

Caller address.

source

fn deposited_tokens(&self) -> &[BaseUnits]

Tokens deposited by the caller.

source

fn is_read_only(&self) -> bool

Whether the call is read-only and must not make any storage modifications.

source

fn call_format(&self) -> CallFormat

Call format.

source

fn emit_message(&mut self, msg: Message)

Emits a message.

source

fn emit_event<E: Event>(&mut self, event: E)

Emits an event.

source

fn public_store(&mut self) -> &mut Self::PublicStore

Public contract store.

source

fn confidential_store(&mut self) -> &mut Self::ConfidentialStore

Confidential contract store.

source

fn env(&self) -> &Self::Env

Environment.

Object Safety§

This trait is not object safe.

Implementors§