Documentation ¶
Index ¶
- Constants
- func CandidatesByHeight(sr protocol.StateReader, height uint64) ([]*state.Candidate, error)
- func CandidatesFromDB(sr protocol.StateReader, epochStartPoint bool, opts ...protocol.StateOption) ([]*state.Candidate, uint64, error)
- func ConstructKey(key string) hash.Hash256
- func ConstructLegacyKey(height uint64) hash.Hash160
- func GetMostRecentCandidateMap(sm protocol.StateManager, blkHeight uint64) (map[hash.Hash160]*state.Candidate, error)
- func KickoutListFromDB(sr protocol.StateReader, epochStartPoint bool, opts ...protocol.StateOption) (*vote.Blacklist, uint64, error)
- func LoadAndAddCandidates(sm protocol.StateManager, blkHeight uint64, addr string) error
- func UnproductiveDelegateFromDB(sr protocol.StateReader) (*vote.UnproductiveDelegate, error)
Constants ¶
const CandidatesPrefix = "Candidates."
CandidatesPrefix is the prefix of the key of candidateList
const CurCandidateKey = "CurrentCandidateList."
CurCandidateKey is the key of current candidate list
const CurKickoutKey = "CurrentKickoutKey."
CurKickoutKey is the key of current kickout list
const NxtCandidateKey = "NextCandidateList."
NxtCandidateKey is the key of next candidate list
const NxtKickoutKey = "NextKickoutKey."
NxtKickoutKey is the key of next kickout list
const UnproductiveDelegateKey = "UnproductiveDelegateKey."
UnproductiveDelegateKey is the key of unproductive Delegate struct
Variables ¶
This section is empty.
Functions ¶
func CandidatesByHeight ¶ added in v0.11.0
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 ConstructLegacyKey ¶ added in v0.11.0
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.