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
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.
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.
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.
filtered_event_subscription(node_id \\ Node.example_random_id())
I demonstrate filtered event subscription using FooEvent
and BarEvent
.
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.