feeder

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const SaltLength = 4

Variables

This section is empty.

Functions

func GeneratePrevoteHash

func GeneratePrevoteHash(vda types.VoteDataArr, salt string) string

GeneratePrevoteHash generates a prevote hash from a block data string and a salt

func GenerateSalt

func GenerateSalt() (string, error)

GenerateSalt generates a random salt string of length SaltLength by slicing a uuid string

Types

type BlockVoteInfo

type BlockVoteInfo struct {
	RoundId  uint64
	Salt     string
	VoteData types.VoteDataArr
}

type Feeder

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

func NewFeeder

func NewFeeder(
	config *config.Config,
	sc *client.SettlusClient,
	subscribers []subscriber.Subscriber,
	logger log.Logger,
) (*Feeder, error)

func (*Feeder) FetchNewRoundInfo added in v0.0.6

func (feeder *Feeder) FetchNewRoundInfo(ctx context.Context)

func (*Feeder) HandleAbstain

func (feeder *Feeder) HandleAbstain(ctx context.Context) error

HandleAbstain Handles a prevote period when block data string cannot be gathered

func (*Feeder) HandlePrevote

func (feeder *Feeder) HandlePrevote(ctx context.Context) error

HandlePrevote Handles a prevote period

func (*Feeder) HandleVote

func (feeder *Feeder) HandleVote(ctx context.Context) error

HandleVote Handles a vote period

func (*Feeder) IsPreVotingPeriod

func (feeder *Feeder) IsPreVotingPeriod(height int64) bool

IsPreVotingPeriod returns true if the current height is a prevoting period

func (*Feeder) IsVotingPeriod

func (feeder *Feeder) IsVotingPeriod(height int64) bool

IsVotingPeriod returns true if the current height is a voting period

func (*Feeder) WantAbstain

func (feeder *Feeder) WantAbstain(height int64) bool

WantAbstain returns true if the feeder wants to abstain from voting

Jump to

Keyboard shortcuts

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