epochcheck

package
v0.0.0-...-59e56fa Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotRelevant indicates the event's epoch isn't equal to current epoch.
	ErrNotRelevant = errors.New("event is too old or too new")
	// ErrAuth indicates that event's creator isn't authorized to create events in current epoch.
	ErrAuth = errors.New("event creator isn't validator")
)

Functions

This section is empty.

Types

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

Checker which require only current epoch info

func New

func New(config *lachesis.DagConfig, reader DagReader) *Checker

func (*Checker) Validate

func (v *Checker) Validate(e *inter.Event) error

Validate event

type DagReader

type DagReader interface {
	GetEpochValidators() (*pos.Validators, idx.Epoch)
}

DagReader is accessed by the validator to get the current state.

Jump to

Keyboard shortcuts

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