events

package
v0.2403.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeValue

func DecodeValue(value string, ev TypedAttribute) error

DecodeValue decodes the attribute event value.

func EncodeValue

func EncodeValue(ev TypedAttribute) string

EncodeValue encodes the attribute event value.

func IsAttributeKind

func IsAttributeKind(key string, kind TypedAttribute) bool

IsAttributeKind checks whether the given attribute key corresponds to the passed typed attribute.

func NewEventName added in v0.2400.0

func NewEventName(module string, event string) string

NewEventName creates a new event name.

Module and event must be unique. If they are not, this method will panic.

Types

type CustomTypedAttribute

type CustomTypedAttribute interface {
	TypedAttribute

	// EventValue returns a string representation of this events value.
	EventValue() string

	// DecodeValue decodes the value encoded vy the EventValue.
	DecodeValue(value string) error
}

CustomTypedAttribute is an interface implemented by types which can be transparently used as event attributes with custom value encoding.

type Provable added in v0.2300.0

type Provable interface {
	// ShouldProve returns true iff the event should be included in the event proof tree.
	ShouldProve() bool

	// ProvableRepresentation returns the provable representation of an event.
	//
	// Since this representation is part of commitments that are included in consensus layer state
	// any changes to this representation are consensus-breaking.
	ProvableRepresentation() any
}

Provable is an interface implemented by event types which can be proven.

type TypedAttribute

type TypedAttribute interface {
	// EventKind returns a string representation of this event's kind.
	EventKind() string
}

TypedAttribute is an interface implemented by types which can be transparently used as event attributes with CBOR-marshalled value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL