Documentation ¶
Index ¶
- Constants
- func ConstructKey(height uint64) hash.Hash160
- func GetMostRecentCandidateMap(sm protocol.StateManager) (map[hash.Hash160]*state.Candidate, error)
- func LoadAndAddCandidates(sm protocol.StateManager, addr string) error
- func LoadAndDeleteCandidates(sm protocol.StateManager, encodedAddr string) error
- func LoadAndUpdateCandidates(sm protocol.StateManager, addr string, votingWeight *big.Int) error
Constants ¶
View Source
const CandidatesPrefix = "Candidates."
CandidatesPrefix is the prefix of the key of candidateList
Variables ¶
This section is empty.
Functions ¶
func ConstructKey ¶
ConstructKey constructs a key for candidates storage
func GetMostRecentCandidateMap ¶
GetMostRecentCandidateMap gets the most recent candidateMap from trie
func LoadAndAddCandidates ¶
func LoadAndAddCandidates(sm protocol.StateManager, addr string) error
LoadAndAddCandidates loads candidates from trie and adds a new candidate
func LoadAndDeleteCandidates ¶
func LoadAndDeleteCandidates(sm protocol.StateManager, encodedAddr string) error
LoadAndDeleteCandidates loads candidates from trie and deletes a candidate if exists
func LoadAndUpdateCandidates ¶
LoadAndUpdateCandidates loads candidates from trie and updates an existing candidate
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.