event

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package event contains data structures that are attached to events in the relay. Though many of these events are triggered on-chain, that is not an inherent requirement of structures in this package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DKGResultSubmission

type DKGResultSubmission struct {
	MemberIndex    uint32
	GroupPublicKey []byte
	Misbehaved     []byte

	BlockNumber uint64
}

DKGResultSubmission represents a DKG result submission event. It is emitted after a submitted DKG result is positively validated on the chain. It contains the index of the member who submitted the result and a final public key of the group.

type EntryGenerated

type EntryGenerated struct {
	Value       *big.Int
	BlockNumber uint64
}

EntryGenerated indicates that new relay entry has ben generated by threshold relay. This event is intended to be used by threshold relay consumers.

type EntrySubmitted

type EntrySubmitted struct {
	BlockNumber uint64
}

EntrySubmitted indicates that valid relay entry has been submitted to the chain for the currently processed relay request. This event is intended to be used by operators for tracking entry generation and submission progress.

type GroupRegistration

type GroupRegistration struct {
	GroupPublicKey []byte

	BlockNumber uint64
}

GroupRegistration represents an event of registering a new group with the given public key.

type GroupSelectionStart

type GroupSelectionStart struct {
	NewEntry    *big.Int
	BlockNumber uint64
}

GroupSelectionStart represents a group selection start event.

type GroupSelectionTrack

type GroupSelectionTrack struct {
	Data  map[string]bool // <entry, bool>
	Mutex *sync.Mutex
}

GroupSelectionTrack is used to track a start for group selection after GroupSelectionStarted event is received. It is used to ensure that the process execution is not duplicated, i.e. when the client receives the same event multiple times. When event is received, it should be added in this struct. When a group selection process completes (no matter if it succeeded or failed), it should be removed from this struct.

func (*GroupSelectionTrack) Add

func (gst *GroupSelectionTrack) Add(entry string) bool

Add inserts a new entry into a map that reflects whether a new group selection has already started using an entry as a seed.

func (*GroupSelectionTrack) Remove

func (gst *GroupSelectionTrack) Remove(entry string)

Remove clears a map from an entry that was used to start a group selection.

type GroupTicketSubmission

type GroupTicketSubmission struct {
	TicketValue *big.Int

	BlockNumber uint64
}

GroupTicketSubmission represents a group selection ticket submission event.

type RelayRequestTrack

type RelayRequestTrack struct {
	Data  map[string]bool // <previousEntry, bool>
	Mutex *sync.Mutex
}

RelayRequestTrack is used to track requests for new entries after RelayEntryRequested event is received. It is used to ensure that the process execution is not duplicated, i.e. when the client receives the same event multiple times. When event is received, it should be added in this struct. When a new entry generation process completes (no matter if it succeeded or failed), it should be removed from this struct.

func (*RelayRequestTrack) Add

func (rrt *RelayRequestTrack) Add(previousEntry string) bool

Add inserts a previous entry into a map that reflects whether a new relay entry has already been requested.

func (*RelayRequestTrack) Remove

func (rrt *RelayRequestTrack) Remove(previousEntry string)

Remove clears a map from a previous entry.

type Request

type Request struct {
	PreviousEntry  []byte
	GroupPublicKey []byte
	BlockNumber    uint64
}

Request represents a request for an entry in the threshold relay.

Jump to

Keyboard shortcuts

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