voting

package
v14.0.0-rc44 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Vote

type Vote [voteSize]byte

Vote is a vote cast by a node.

func VoteFromData

func VoteFromData(data []byte) Vote

VoteFromData hashes the given data and converts it to a vote.

func VoteFromHash

func VoteFromHash(bytes []byte) (Vote, error)

VoteFromHash converts the given byte slice containing a hash into a vote.

func (Vote) Bytes

func (v Vote) Bytes() []byte

Bytes returns a byte slice containing the hash.

func (Vote) String

func (v Vote) String() string

String returns the hex representation of the vote hash.

type VoteHash

type VoteHash struct {
	hash.Hash
}

VoteHash is the hash structure used to compute a Vote from arbitrary data.

func NewVoteHash

func NewVoteHash() VoteHash

NewVoteHash returns a new VoteHash.

func (VoteHash) Vote

func (v VoteHash) Vote() (Vote, error)

Vote hashes all data written into VoteHash and returns the resulting Vote.

Jump to

Keyboard shortcuts

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