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 a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.