Help us shape the future of Go! Take the 2026 Go Developer Survey

state

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrVertexNotFound = errors.New("vertex not found")
	ErrInvalidStatus  = errors.New("invalid vertex status")
)

Functions

This section is empty.

Types

type State

type State interface {
	// GetVertex returns a vertex by its ID
	GetVertex(vertexID ids.ID) (Vertex, error)

	// AddVertex adds a vertex to the state
	AddVertex(vertex Vertex) error

	// VertexStatus returns the status of a vertex
	VertexStatus(vertexID ids.ID) choices.Status

	// SetVertexStatus sets the status of a vertex
	SetVertexStatus(vertexID ids.ID, status choices.Status) error

	// Edge returns the directed edge from vertex u to vertex v
	Edge(u, v ids.ID) bool

	// Conflicts returns vertices that conflict with the given vertex
	Conflicts(vertexID ids.ID) ([]ids.ID, error)
}

State manages vertex states for DAG consensus

type Vertex

type Vertex interface {
	ID() ids.ID
	Parents() []ids.ID
	Height() uint64
	Timestamp() int64
	Bytes() []byte
	Verify() error
}

Vertex represents a vertex in the DAG

Jump to

Keyboard shortcuts

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