iotex-core: Index | Files

package candidatesutil

import ""


Package Files



const CandidatesPrefix = "Candidates."

CandidatesPrefix is the prefix of the key of candidateList

func ConstructKey Uses

func ConstructKey(height uint64) hash.Hash160

ConstructKey constructs a key for candidates storage

func GetMostRecentCandidateMap Uses

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

GetMostRecentCandidateMap gets the most recent candidateMap from trie

func LoadAndAddCandidates Uses

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

LoadAndAddCandidates loads candidates from trie and adds a new candidate

func LoadAndDeleteCandidates Uses

func LoadAndDeleteCandidates(sm protocol.StateManager, blkHeight uint64, encodedAddr string) error

LoadAndDeleteCandidates loads candidates from trie and deletes a candidate if exists

func LoadAndUpdateCandidates Uses

func LoadAndUpdateCandidates(sm protocol.StateManager, blkHeight uint64, addr string, votingWeight *big.Int) error

LoadAndUpdateCandidates loads candidates from trie and updates an existing candidate

Package candidatesutil imports 8 packages (graph) and is imported by 2 packages. Updated 2019-08-20. Refresh now. Tools for package owners.