voting

package
v0.11.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2019 License: ISC Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Voting

type Voting interface {
	ElectedCandidate() (upstream.UpstreamIntf, uint64, error)
	NumVoteOfDigest(blockdigest.Digest) int
	Reset()
	SetMinHeight(uint64)
	VoteBy(upstream.UpstreamIntf)
}

func NewVoting

func NewVoting() Voting

NewVoting - new voting object

type VotingImpl

type VotingImpl struct {
	// contains filtered or unexported fields
}

func (*VotingImpl) ElectedCandidate

func (v *VotingImpl) ElectedCandidate() (upstream.UpstreamIntf, uint64, error)

ElectedCandidate - get candidate that is most vote

func (*VotingImpl) NumVoteOfDigest

func (v *VotingImpl) NumVoteOfDigest(digest blockdigest.Digest) int

NumVoteOfDigest - number of votest for a digest

func (*VotingImpl) Reset

func (v *VotingImpl) Reset()

Reset - reset voting

func (*VotingImpl) SetMinHeight

func (v *VotingImpl) SetMinHeight(height uint64)

SetMinHeight - set minimum height for vote

func (*VotingImpl) VoteBy

func (v *VotingImpl) VoteBy(candidate upstream.UpstreamIntf)

VoteBy - vote by some upstream

Jump to

Keyboard shortcuts

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