candidatesutil

package
v0.5.0-rc5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2019 License: Apache-2.0 Imports: 8 Imported by: 8

Documentation

Index

Constants

View Source
const CandidatesPrefix = "Candidates."

CandidatesPrefix is the prefix of the key of candidateList

Variables

This section is empty.

Functions

func ConstructKey

func ConstructKey(height uint64) hash.Hash160

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL