Documentation ¶
Index ¶
- Constants
- func ConstructKey(height uint64) hash.Hash160
- func GetMostRecentCandidateMap(sm protocol.StateManager, blkHeight uint64) (map[hash.Hash160]*state.Candidate, error)
- func LoadAndAddCandidates(sm protocol.StateManager, blkHeight uint64, addr string) error
- func LoadAndDeleteCandidates(sm protocol.StateManager, blkHeight uint64, encodedAddr string) error
- func LoadAndUpdateCandidates(sm protocol.StateManager, blkHeight uint64, 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 ¶
func GetMostRecentCandidateMap(sm protocol.StateManager, blkHeight uint64) (map[hash.Hash160]*state.Candidate, error)
GetMostRecentCandidateMap gets the most recent candidateMap from trie
func LoadAndAddCandidates ¶
func LoadAndAddCandidates(sm protocol.StateManager, blkHeight uint64, addr string) error
LoadAndAddCandidates loads candidates from trie and adds a new candidate
func LoadAndDeleteCandidates ¶
func LoadAndDeleteCandidates(sm protocol.StateManager, blkHeight uint64, encodedAddr string) error
LoadAndDeleteCandidates loads candidates from trie and deletes a candidate if exists
func LoadAndUpdateCandidates ¶
func LoadAndUpdateCandidates(sm protocol.StateManager, blkHeight uint64, addr string, votingWeight *big.Int) error
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.