quorum

package
v0.0.0-...-648c852 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MaxStake = int64(math.MaxInt64) / 8

MaxStake - the maximum allowed stake.

Variables

This section is empty.

Functions

This section is empty.

Types

type Includer

type Includer struct {
	PubKey crypto.PubKey

	Stake int64
}

func NewIncluder

func NewIncluder(pK crypto.PubKey, stake int64) *Includer

func (*Includer) Validate

func (i *Includer) Validate() error

Validate performs basic validation.

type Includers

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

Includers contains all available includers (+ the signer), sorted by the stake amount in a decreasing order

func NewIncludersSet

func NewIncludersSet(v []*Includer) *Includers

func (*Includers) GetByPubKey

func (incl *Includers) GetByPubKey(pubK []byte) *Includer

func (*Includers) Len

func (incl *Includers) Len() int

func (*Includers) Less

func (incl *Includers) Less(i, j int) bool

func (*Includers) Swap

func (incl *Includers) Swap(i, j int)

func (*Includers) TotalStake

func (incl *Includers) TotalStake() int64

func (*Includers) Validate

func (incl *Includers) Validate() error

type Quorum

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

func NewQuorum

func NewQuorum(includers *Includers) *Quorum

func (*Quorum) Add

func (q *Quorum) Add(msg rebro.Message) error

func (*Quorum) Delete

func (q *Quorum) Delete(id rebro.MessageID) bool

func (*Quorum) Finalize

func (q *Quorum) Finalize() (bool, error)

func (*Quorum) Get

func (q *Quorum) Get(id rebro.MessageID) (rebro.Certificate, bool)

func (*Quorum) List

func (q *Quorum) List() []rebro.Certificate

Jump to

Keyboard shortcuts

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