candidatesutil

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 11 Imported by: 8

Documentation

Index

Constants

View Source
const CandidatesPrefix = "Candidates."

CandidatesPrefix is the prefix of the key of candidateList

View Source
const CurCandidateKey = "CurrentCandidateList."

CurCandidateKey is the key of current candidate list

View Source
const CurProbationKey = "CurrentKickoutKey."

CurProbationKey is the key of current probation list

View Source
const NxtCandidateKey = "NextCandidateList."

NxtCandidateKey is the key of next candidate list

View Source
const NxtProbationKey = "NextKickoutKey."

NxtProbationKey is the key of next probation list

View Source
const UnproductiveDelegateKey = "UnproductiveDelegateKey."

UnproductiveDelegateKey is the key of unproductive Delegate struct

Variables

This section is empty.

Functions

func CandidatesFromDB added in v0.11.0

func CandidatesFromDB(sr protocol.StateReader, height uint64, loadCandidatesLegacy bool, epochStartPoint bool) ([]*state.Candidate, uint64, error)

CandidatesFromDB returns array of Candidates in candidate pool of a given height or current epoch

func ConstructKey

func ConstructKey(key string) hash.Hash256

ConstructKey constructs a const key

func ConstructLegacyKey added in v0.11.0

func ConstructLegacyKey(height uint64) hash.Hash160

ConstructLegacyKey constructs a key for candidates storage (deprecated version)

func GetMostRecentCandidateMap

func GetMostRecentCandidateMap(sm protocol.StateManager, blkHeight uint64) (map[hash.Hash160]*state.Candidate, error)

GetMostRecentCandidateMap gets the most recent candidateMap from trie

func LoadAndAddCandidates

func LoadAndAddCandidates(sm protocol.StateManager, blkHeight uint64, addr string) error

LoadAndAddCandidates loads candidates from trie and adds a new candidate

func ProbationListFromDB added in v1.0.0

func ProbationListFromDB(sr protocol.StateReader, epochStartPoint bool) (*vote.ProbationList, uint64, error)

ProbationListFromDB returns array of probation list at current epoch

func UnproductiveDelegateFromDB added in v0.11.0

func UnproductiveDelegateFromDB(sr protocol.StateReader) (*vote.UnproductiveDelegate, error)

UnproductiveDelegateFromDB returns latest UnproductiveDelegate struct

Types

This section is empty.

Jump to

Keyboard shortcuts

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