Struct concordium_std::test_infrastructure::TestContext
source · pub struct TestContext<'a, C> { /* private fields */ }
Expand description
Context used for testing. The type parameter C is used to determine whether this will be an init or receive context.
Implementations§
source§impl<'a, C> TestContext<'a, C>
impl<'a, C> TestContext<'a, C>
sourcepub fn push_policy(&mut self, value: OwnedPolicy) -> &mut Self
👎Deprecated since 8.1.0: Deprecated in favor of concordium-smart-contract-testing.
pub fn push_policy(&mut self, value: OwnedPolicy) -> &mut Self
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.
sourcepub fn empty_policies(&mut self) -> &mut Self
👎Deprecated since 8.1.0: Deprecated in favor of concordium-smart-contract-testing.
pub fn empty_policies(&mut self) -> &mut Self
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
sourcepub fn metadata_mut(&mut self) -> &mut TestChainMeta
👎Deprecated since 8.1.0: Deprecated in favor of concordium-smart-contract-testing.
pub fn metadata_mut(&mut self) -> &mut TestChainMeta
Get a mutable reference to the chain meta data placeholder
sourcepub fn set_metadata_slot_time(&mut self, value: SlotTime) -> &mut Self
👎Deprecated since 8.1.0: Deprecated in favor of concordium-smart-contract-testing.
pub fn set_metadata_slot_time(&mut self, value: SlotTime) -> &mut Self
Set the metadata block slot time
source§impl<'a> TestContext<'a, TestInitOnlyData>
impl<'a> TestContext<'a, TestInitOnlyData>
sourcepub fn empty() -> Self
👎Deprecated since 8.1.0: Deprecated in favor of concordium-smart-contract-testing.
pub fn empty() -> Self
Create an TestInitContext
where every field is unset, and getting any
of the fields will result in fail!
.
sourcepub fn set_init_origin(&mut self, value: AccountAddress) -> &mut Self
👎Deprecated since 8.1.0: Deprecated in favor of concordium-smart-contract-testing.
pub fn set_init_origin(&mut self, value: AccountAddress) -> &mut Self
Set init_origin
in the TestInitContext
source§impl<'a> TestContext<'a, TestReceiveOnlyData>
impl<'a> TestContext<'a, TestReceiveOnlyData>
sourcepub fn empty() -> Self
👎Deprecated since 8.1.0: Deprecated in favor of concordium-smart-contract-testing.
pub fn empty() -> Self
Create a TestReceiveContext
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
pub fn set_self_address(&mut self, value: ContractAddress) -> &mut Self
pub fn set_sender(&mut self, value: Address) -> &mut Self
pub fn set_owner(&mut self, value: AccountAddress) -> &mut Self
pub fn set_named_entrypoint(&mut self, value: OwnedEntrypointName) -> &mut Self
Trait Implementations§
source§impl<'a, C: Clone> Clone for TestContext<'a, C>
impl<'a, C: Clone> Clone for TestContext<'a, C>
source§fn clone(&self) -> TestContext<'a, C>
fn clone(&self) -> TestContext<'a, C>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more