vote

package
v2.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProbationList

type ProbationList struct {
	ProbationInfo map[string]uint32
	IntensityRate uint32
}

ProbationList defines a map where key is candidate's name and value is the counter which counts the unproductivity during probation epoch.

func NewProbationList

func NewProbationList(intensity uint32) *ProbationList

NewProbationList returns a new probation list

func (*ProbationList) Decode added in v2.3.0

Decode decodes a GenericValue into ProbationList

func (*ProbationList) Deserialize

func (pl *ProbationList) Deserialize(buf []byte) error

Deserialize deserializes bytes to delegate ProbationList

func (*ProbationList) Encode added in v2.3.0

New creates a new instance of ProbationList

func (*ProbationList) LoadProto

func (pl *ProbationList) LoadProto(probationListpb *iotextypes.ProbationCandidateList) error

LoadProto loads ProbationList from proto

func (*ProbationList) Proto

Proto converts the ProbationList to a protobuf message

func (*ProbationList) Serialize

func (pl *ProbationList) Serialize() ([]byte, error)

Serialize serializes map of ProbationList to bytes

type UnproductiveDelegate

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

UnproductiveDelegate defines unproductive delegates information within probation period

func NewUnproductiveDelegate

func NewUnproductiveDelegate(probationPeriod uint64, cacheSize uint64) (*UnproductiveDelegate, error)

NewUnproductiveDelegate creates new UnproductiveDelegate with probationperiod and cacheSize

func (*UnproductiveDelegate) AddRecentUPD

func (upd *UnproductiveDelegate) AddRecentUPD(new map[string]uint64) error

AddRecentUPD adds new epoch upd-list at the leftmost and shift existing lists to the right

func (*UnproductiveDelegate) Decode added in v2.3.0

func (*UnproductiveDelegate) DelegateList

func (upd *UnproductiveDelegate) DelegateList() [][]string

DelegateList returns delegate list 2D array

func (*UnproductiveDelegate) Deserialize

func (upd *UnproductiveDelegate) Deserialize(buf []byte) error

Deserialize deserializes bytes to UnproductiveDelegate struct

func (*UnproductiveDelegate) Encode added in v2.3.0

New creates a new instance of UnproductiveDelegate

func (*UnproductiveDelegate) Equal

Equal compares with other upd struct and returns true if it's equal

func (*UnproductiveDelegate) LoadProto

func (upd *UnproductiveDelegate) LoadProto(updPb *updpb.UnproductiveDelegate) error

LoadProto converts protobuf message to unproductvieDelegate struct

func (*UnproductiveDelegate) Proto

Proto converts the unproductvieDelegate struct to a protobuf message

func (*UnproductiveDelegate) ReadOldestUPD

func (upd *UnproductiveDelegate) ReadOldestUPD() []string

ReadOldestUPD returns the last upd-list

func (*UnproductiveDelegate) Serialize

func (upd *UnproductiveDelegate) Serialize() ([]byte, error)

Serialize serializes unproductvieDelegate struct to bytes

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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