Struct concordium_std::test_infrastructure::ContextTest [−][src]
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]
fn clone(&self) -> ContextTest<'a, C>[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<'a, C: Default> Default for ContextTest<'a, C>[src]
fn default() -> 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
fn parameter_cursor(&self) -> Self::ParamType[src]
fn metadata(&self) -> &Self::MetadataType[src]
fn policies(&self) -> Self::PolicyIteratorType[src]
Auto Trait Implementations
impl<'a, C> RefUnwindSafe for ContextTest<'a, C> where
C: RefUnwindSafe,
C: RefUnwindSafe,
impl<'a, C> Send for ContextTest<'a, C> where
C: Send,
C: Send,
impl<'a, C> Sync for ContextTest<'a, C> where
C: Sync,
C: Sync,
impl<'a, C> Unpin for ContextTest<'a, C> where
C: Unpin,
C: Unpin,
impl<'a, C> UnwindSafe for ContextTest<'a, C> where
C: UnwindSafe,
C: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,