Struct concordium_std::test_infrastructure::ContextTest [−][src]
pub struct ContextTest<'a, C> { /* fields omitted */ }
Expand description
Context used for testing. The type parameter C is used to determine whether this will be an init or receive context.
Implementations
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.
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.
Get a mutable reference to the chain meta data placeholder
Set the metadata block slot time
Create an InitContextTest
where every field is unset, and getting any
of the fields will result in fail!
.
Set init_origin
in the InitContextTest
Create a ReceiveContextTest
where every field is unset, and getting
any of the fields will result in fail!
.
Trait Implementations
Returns the “default value” for a type. Read more
type MetadataType = ChainMetaTest
type PolicyIteratorType = IntoIter<TestPolicy>
type PolicyType = TestPolicy
Get the cursor to the parameter.
Get the reference to chain metadata
Policies of the sender of the message. For init methods this is the would-be creator of the contract, for the receive this is the policies of the immediate sender. Read more
Auto Trait Implementations
impl<'a, C> RefUnwindSafe for ContextTest<'a, C> where
C: RefUnwindSafe,
impl<'a, C> Send for ContextTest<'a, C> where
C: Send,
impl<'a, C> Sync for ContextTest<'a, C> where
C: Sync,
impl<'a, C> Unpin for ContextTest<'a, C> where
C: Unpin,
impl<'a, C> UnwindSafe for ContextTest<'a, C> where
C: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more