choices

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decidable

type Decidable interface {
	// ID returns the unique ID of this element
	ID() string
	// Accept marks this element as accepted
	Accept() error
	// Reject marks this element as rejected
	Reject() error
	// Status returns the current status
	Status() Status
}

Decidable represents an element that can be decided

type Preference

type Preference struct {
	// Status is the current status
	Status Status
	// DualCert indicates if both BLS and RT certificates are present
	DualCert bool
}

Preference returns the preferred status

type Quasar

type Quasar interface {
	Decidable
	// SetQuantum marks this element as having quantum-secure finality
	SetQuantum() error
	// HasDualCert returns true if both BLS and RT certificates are present
	HasDualCert() bool
}

Quasar extends Decidable with quantum-secure finality

type Status

type Status uint32

Status represents the current status of a block or vertex

const (
	// Unknown means the status is not known
	Unknown Status = iota
	// Processing means the block is being processed
	Processing
	// Rejected means the block was rejected
	Rejected
	// Accepted means the block was accepted with dual certificates
	Accepted
	// Quantum means the block has quantum-secure finality
	Quantum
)

func (Status) Decided

func (s Status) Decided() bool

Decided returns true if the block has been decided

func (Status) Fetched

func (s Status) Fetched() bool

Fetched returns true if the block has been fetched

func (Status) IsAccepted

func (s Status) IsAccepted() bool

IsAccepted returns true if the block was accepted

func (Status) IsQuantum

func (s Status) IsQuantum() bool

IsQuantum returns true if the block has quantum-secure finality

func (Status) String

func (s Status) String() string

func (Status) Valid

func (s Status) Valid() bool

Valid returns true if the status is a valid status

type TestDecidable

type TestDecidable struct {
	IDV         string
	StatusV     Status
	PreferenceV Preference
}

TestDecidable is a test interface for decidable blocks

func (*TestDecidable) Accept

func (t *TestDecidable) Accept() error

func (*TestDecidable) ID

func (t *TestDecidable) ID() string

func (*TestDecidable) Reject

func (t *TestDecidable) Reject() error

func (*TestDecidable) SetQuantum

func (t *TestDecidable) SetQuantum() error

func (*TestDecidable) Status

func (t *TestDecidable) Status() Status

Jump to

Keyboard shortcuts

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