pub trait HasReceiveContext<Error: Default = ()>: HasCommonData {
    type ReceiveData;

    // Required methods
    fn open(data: Self::ReceiveData) -> Self;
    fn invoker(&self) -> AccountAddress;
    fn self_address(&self) -> ContractAddress;
    fn sender(&self) -> Address;
    fn owner(&self) -> AccountAddress;
    fn named_entrypoint(&self) -> OwnedEntrypointName;
}
Expand description

Types which can act as receive contexts.

§Deprecation notice

This trait is deprecated along with crate::test_infrastructure.

Use ReceiveContext instead unless you intend to use the deprecated test infrastructure.

See the crate documentation for more details.

Required Associated Types§

Required Methods§

source

fn open(data: Self::ReceiveData) -> Self

Open the receive context for reading and accessing values.

source

fn invoker(&self) -> AccountAddress

Who is the account that initiated the top-level transaction this invocation is a part of.

source

fn self_address(&self) -> ContractAddress

The address of the contract being invoked.

source

fn sender(&self) -> Address

The immediate sender of the message. In general different from the invoker.

source

fn owner(&self) -> AccountAddress

Account which created the contract instance.

source

fn named_entrypoint(&self) -> OwnedEntrypointName

Get the name of the entrypoint that was named. In case a default entrypoint is invoked this can be different from the name of the entrypoint that is being executed.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl HasReceiveContext for ExternContext<ExternReceiveContext>

§Trait implementations for the receive context

source§

impl<'a> HasReceiveContext for TestReceiveContext<'a>