vote

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: Apache-2.0 Imports: 5 Imported by: 4 modules, 6 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 Blacklist added in v0.11.0

type Blacklist struct {
	BlacklistInfos map[string]uint32
	IntensityRate  uint32
}

Blacklist defines a map where key is candidate's name and value is the counter which counts the unproductivity during kick-out epoch.

func (*Blacklist) Deserialize added in v0.11.0

func (bl *Blacklist) Deserialize(buf []byte) error

Deserialize deserializes bytes to delegate blacklist

func (*Blacklist) LoadProto added in v0.11.0

func (bl *Blacklist) LoadProto(blackListpb *iotextypes.ProbationCandidateList) error

LoadProto loads blacklist from proto

func (*Blacklist) Proto added in v0.11.0

Proto converts the blacklist to a protobuf message

func (*Blacklist) Serialize added in v0.11.0

func (bl *Blacklist) Serialize() ([]byte, error)

Serialize serializes map of blacklist to bytes

type UnproductiveDelegate added in v0.11.0

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

UnproductiveDelegate defines unproductive delegates information within kickout period

func NewUnproductiveDelegate added in v0.11.0

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

NewUnproductiveDelegate creates new UnproductiveDelegate with kickoutperiod and cacheSize

func (*UnproductiveDelegate) AddRecentUPD added in v0.11.0

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

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

func (*UnproductiveDelegate) DelegateList added in v0.11.0

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

DelegateList returns delegate list 2D array

func (*UnproductiveDelegate) Deserialize added in v0.11.0

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

Deserialize deserializes bytes to UnproductiveDelegate struct

func (*UnproductiveDelegate) Equal added in v0.11.0

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

func (*UnproductiveDelegate) LoadProto added in v0.11.0

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

LoadProto converts protobuf message to unproductvieDelegate struct

func (*UnproductiveDelegate) Proto added in v0.11.0

Proto converts the unproductvieDelegate struct to a protobuf message

func (*UnproductiveDelegate) ReadOldestUPD added in v0.11.0

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

ReadOldestUPD returns the last upd-list

func (*UnproductiveDelegate) Serialize added in v0.11.0

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