[][src]Struct concordium_std::test_infrastructure::ContextTest

pub struct ContextTest<'a, C> { /* fields omitted */ }

Context used for testing. The type parameter C is used to determine whether this will be an init or receive context.

Implementations

impl<'a, C> ContextTest<'a, C>[src]

pub fn push_policy(&mut self, value: OwnedPolicy) -> &mut Self[src]

Push a new sender policy to the context. When the first policy is pushed this will set the policy vector to 'Some', even if it was undefined previously.

pub fn empty_policies(&mut self) -> &mut Self[src]

Set the policies to be defined, but an empty list. Such a situation can not realistically happen on the chain, but we provide functionality for it in case smart contract writers wish to program defensively.

pub fn set_parameter(&mut self, value: &'a [u8]) -> &mut Self[src]

pub fn metadata_mut(&mut self) -> &mut ChainMetaTest[src]

Get a mutable reference to the chain meta data placeholder

pub fn set_metadata_slot_time(&mut self, value: SlotTime) -> &mut Self[src]

Set the metadata block slot time

impl<'a> ContextTest<'a, InitOnlyDataTest>[src]

pub fn empty() -> Self[src]

Create an InitContextTest where every field is unset, and getting any of the fields will result in fail!.

pub fn set_init_origin(&mut self, value: AccountAddress) -> &mut Self[src]

Set init_origin in the InitContextTest

impl<'a> ContextTest<'a, ReceiveOnlyDataTest>[src]

pub fn empty() -> Self[src]

Create a ReceiveContextTest where every field is unset, and getting any of the fields will result in fail!.

pub fn set_invoker(&mut self, value: AccountAddress) -> &mut Self[src]

pub fn set_self_address(&mut self, value: ContractAddress) -> &mut Self[src]

pub fn set_self_balance(&mut self, value: Amount) -> &mut Self[src]

pub fn set_sender(&mut self, value: Address) -> &mut Self[src]

pub fn set_owner(&mut self, value: AccountAddress) -> &mut Self[src]

Trait Implementations

impl<'a, C: Clone> Clone for ContextTest<'a, C>[src]

impl<'a, C: Default> Default for ContextTest<'a, C>[src]

impl<'a, C> HasCommonData for ContextTest<'a, C>[src]

type MetadataType = ChainMetaTest

type ParamType = Cursor<&'a [u8]>

type PolicyIteratorType = IntoIter<TestPolicy>

type PolicyType = TestPolicy

Auto Trait Implementations

impl<'a, C> RefUnwindSafe for ContextTest<'a, C> where
    C: RefUnwindSafe
[src]

impl<'a, C> Send for ContextTest<'a, C> where
    C: Send
[src]

impl<'a, C> Sync for ContextTest<'a, C> where
    C: Sync
[src]

impl<'a, C> Unpin for ContextTest<'a, C> where
    C: Unpin
[src]

impl<'a, C> UnwindSafe for ContextTest<'a, C> where
    C: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.