Documentation ¶
Index ¶
- Constants
- func ConstructKey(height uint64) hash.PKHash
- func GetMostRecentCandidateMap(sm protocol.StateManager) (map[hash.PKHash]*state.Candidate, error)
- func LoadAndAddCandidates(sm protocol.StateManager, vote *action.Vote) error
- func LoadAndDeleteCandidates(sm protocol.StateManager, addr 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, vote *action.Vote) error
LoadAndAddCandidates loads candidates from trie and adds a new candidate
func LoadAndDeleteCandidates ¶
func LoadAndDeleteCandidates(sm protocol.StateManager, addr 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.