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
impl<'a, C> ContextTest<'a, C>
[src]
impl<'a, C> ContextTest<'a, C>
[src]pub fn push_policy(&mut self, value: OwnedPolicy) -> &mut Self
[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]
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]
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]
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]
impl<'a> ContextTest<'a, InitOnlyDataTest>
[src]pub fn empty() -> Self
[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]
pub fn set_init_origin(&mut self, value: AccountAddress) -> &mut Self
[src]Set init_origin
in the InitContextTest
impl<'a> ContextTest<'a, ReceiveOnlyDataTest>
[src]
impl<'a> ContextTest<'a, ReceiveOnlyDataTest>
[src]pub fn empty() -> Self
[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: Clone> Clone for ContextTest<'a, C>
[src]fn clone(&self) -> ContextTest<'a, C>
[src]
fn clone(&self) -> ContextTest<'a, C>
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl<'a, C: Default> Default for ContextTest<'a, C>
[src]
impl<'a, C: Default> Default for ContextTest<'a, C>
[src]fn default() -> ContextTest<'a, C>
[src]
fn default() -> ContextTest<'a, C>
[src]Returns the “default value” for a type. Read more
impl<'a, C> HasCommonData 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
fn parameter_cursor(&self) -> Self::ParamType
[src]
fn parameter_cursor(&self) -> Self::ParamType
[src]Get the cursor to the parameter.
fn metadata(&self) -> &Self::MetadataType
[src]
fn metadata(&self) -> &Self::MetadataType
[src]Get the reference to chain metadata
fn policies(&self) -> Self::PolicyIteratorType
[src]
fn policies(&self) -> Self::PolicyIteratorType
[src]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,
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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more