Struct oasis_contract_sdk::testing::MockContext
source · pub struct MockContext {
pub ec: ExecutionContext,
pub public_store: MockStore,
pub confidential_store: MockStore,
pub env: MockEnv,
pub messages: Vec<Message>,
pub events: Vec<Event>,
}
Expand description
A mock contract context suitable for testing.
Fields§
§ec: ExecutionContext
Execution context.
public_store: MockStore
Public store.
confidential_store: MockStore
“Confidential” store.
env: MockEnv
Environment.
messages: Vec<Message>
Emitted messages.
events: Vec<Event>
Emitted events.
Trait Implementations§
source§impl Context for MockContext
impl Context for MockContext
§type PublicStore = MockStore
type PublicStore = MockStore
The public store.
§type ConfidentialStore = MockStore
type ConfidentialStore = MockStore
The confidential store.
source§fn instance_id(&self) -> InstanceId
fn instance_id(&self) -> InstanceId
Contract instance identifier.
source§fn instance_address(&self) -> &Address
fn instance_address(&self) -> &Address
Contract instance address.
source§fn caller_address(&self) -> &Address
fn caller_address(&self) -> &Address
Caller address.
source§fn deposited_tokens(&self) -> &[BaseUnits]
fn deposited_tokens(&self) -> &[BaseUnits]
Tokens deposited by the caller.
source§fn is_read_only(&self) -> bool
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
fn call_format(&self) -> CallFormat
Call format.
source§fn emit_message(&mut self, msg: Message)
fn emit_message(&mut self, msg: Message)
Emits a message.
source§fn emit_event<E: Event>(&mut self, event: E)
fn emit_event<E: Event>(&mut self, event: E)
Emits an event.
source§fn public_store(&mut self) -> &mut Self::PublicStore
fn public_store(&mut self) -> &mut Self::PublicStore
Public contract store.
source§fn confidential_store(&mut self) -> &mut Self::ConfidentialStore
fn confidential_store(&mut self) -> &mut Self::ConfidentialStore
Confidential contract store.
Auto Trait Implementations§
impl RefUnwindSafe for MockContext
impl Send for MockContext
impl Sync for MockContext
impl Unpin for MockContext
impl UnwindSafe for MockContext
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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