candidatesutil

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: 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 CurKickoutKey = "CurrentKickoutKey."

CurKickoutKey is the key of current kickout list

View Source
const NxtCandidateKey = "NextCandidateList."

NxtCandidateKey is the key of next candidate list

View Source
const NxtKickoutKey = "NextKickoutKey."

NxtKickoutKey is the key of next kickout list

View Source
const UnproductiveDelegateKey = "UnproductiveDelegateKey."

UnproductiveDelegateKey is the key of unproductive Delegate struct

Variables

This section is empty.

Functions

func CandidatesByHeight added in v0.11.0

func CandidatesByHeight(sr protocol.StateReader, height uint64) ([]*state.Candidate, error)

CandidatesByHeight returns array of Candidates in candidate pool of a given height (deprecated version)

func CandidatesFromDB added in v0.11.0

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

CandidatesFromDB returns array of Candidates at 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 KickoutListFromDB added in v0.11.0

func KickoutListFromDB(sr protocol.StateReader, epochStartPoint bool, opts ...protocol.StateOption) (*vote.Blacklist, uint64, error)

KickoutListFromDB returns array of kickout list at current epoch

func LoadAndAddCandidates

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

LoadAndAddCandidates loads candidates from trie and adds a new candidate // KickoutListFromDB returns array of kickout 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