voting

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: ISC Imports: 4 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.Upstream, uint64, error)
	NumVoteOfDigest(blockdigest.Digest) int
	Reset()
	SetMinHeight(uint64)
	VoteBy(upstream.Upstream)
}

func NewVoting

func NewVoting() Voting

NewVoting - new voting object

type VotingData added in v0.12.0

type VotingData struct {
	Voting
	// contains filtered or unexported fields
}

func (*VotingData) ElectedCandidate added in v0.12.0

func (v *VotingData) ElectedCandidate() (upstream.Upstream, uint64, error)

ElectedCandidate - get candidate that is most vote

func (*VotingData) NumVoteOfDigest added in v0.12.0

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

NumVoteOfDigest - number of votest for a digest

func (*VotingData) Reset added in v0.12.0

func (v *VotingData) Reset()

Reset - reset voting

func (*VotingData) SetMinHeight added in v0.12.0

func (v *VotingData) SetMinHeight(height uint64)

SetMinHeight - set minimum height for vote

func (*VotingData) VoteBy added in v0.12.0

func (v *VotingData) VoteBy(candidate upstream.Upstream)

VoteBy - vote by some upstream

Jump to

Keyboard shortcuts

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