model

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event any

Event is received by monitors, and used for validation.

type EventVerified

type EventVerified struct {
	ID       string
	Layer    types.LayerID
	Verified types.LayerID
	Revert   bool
}

EventVerified is raised when tortoise outputs verified layer.

type Message

type Message any

Message is an alias to interface.

type MessageAtx

type MessageAtx struct {
	Atx *types.ActivationTx
}

MessageAtx is an event producing an atx.

type MessageBallot

type MessageBallot struct {
	Ballot *types.Ballot
}

MessageBallot is an event for ballots.

type MessageBeacon

type MessageBeacon struct {
	EpochID types.EpochID
	Beacon  types.Beacon
}

MessageBeacon is an event producing a beacon for epoch. There could be multiple instances of beacon or none. "Honest" core machine should produce random beacon if it didn't receive beacon from messages.

type MessageBlock

type MessageBlock struct {
	Block *types.Block
}

MessageBlock is an event producing a block.

type MessageCoinflip

type MessageCoinflip struct {
	LayerID  types.LayerID
	Coinflip bool
}

MessageCoinflip is an event producing coinflip.

type MessageLayerEnd

type MessageLayerEnd struct {
	LayerID types.LayerID
}

MessageLayerEnd ...

type MessageLayerStart

type MessageLayerStart struct {
	LayerID types.LayerID
}

MessageLayerStart ...

type Messenger

type Messenger interface {
	Send(...Message)
	Notify(...Event)
	PopMessage() Message
	PopEvent() Event
}

Messenger is an interface for communicating with state machines and monitors.

type Monitor

type Monitor interface {
	OnEvent(Event)
	Test()
}

Monitor is an interface for monitors.

Jump to

Keyboard shortcuts

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