Anoma.Node.Examples.EEvent.EDefEvent (Anoma v0.29.0)

Summary

Functions

I create a filter module when the filter option is provided.

I create a typed struct with specified fields.

I enforce required fields when the enforce option is true.

I demonstrate filtered event subscription using FooEvent and BarEvent.

I do not create a filter module when the filter option is nil.

Functions

Link to this function

create_filter_module()

@spec create_filter_module() :: {term(), Code.binding()}

I create a filter module when the filter option is provided.

I assert that the filter module is created with the expected functions.

Link to this function

create_struct_with_fields()

@spec create_struct_with_fields() :: {term(), Code.binding()}

I create a typed struct with specified fields.

I assert that the struct can be created with the expected values.

Link to this function

enforce_required_fields()

@spec enforce_required_fields() :: any()

I enforce required fields when the enforce option is true.

I assert that an error is raised when required fields are missing.

Link to this function

filtered_event_subscription(node_id \\ Node.example_random_id())

@spec filtered_event_subscription(String.t()) :: String.t()

I demonstrate filtered event subscription using FooEvent and BarEvent.

Link to this function

no_filter_module()

@spec no_filter_module() :: {term(), Code.binding()}

I do not create a filter module when the filter option is nil.

I assert that no filter module is created.