Documentation ¶
Index ¶
Constants ¶
const BlockTopic = "block"
const SaltLength = 4
Variables ¶
This section is empty.
Functions ¶
func BlockDataListToBlockDataString ¶
func BlockDataListToBlockDataString(bdList []oracletypes.BlockData) string
BlockDataListToBlockDataString converts a list of BlockData to a string
func GenerateAbstainString ¶
GenerateAbstainString generates an abstain string from a list of chains To abstain from voting, we send a prevote with a negative blocknumber -1
func GeneratePrevoteHash ¶
GeneratePrevoteHash generates a prevote hash from a block data string and a salt
func GenerateSalt ¶
GenerateSalt generates a random salt string of length SaltLength by slicing a uuid string
Types ¶
type BaseFeeder ¶ added in v0.0.6
type BaseFeeder struct {
// contains filtered or unexported fields
}
func (*BaseFeeder) FetchNewRoundInfo ¶ added in v0.0.6
func (feeder *BaseFeeder) FetchNewRoundInfo(ctx context.Context)
func (*BaseFeeder) IsPreVotingPeriod ¶ added in v0.0.6
func (feeder *BaseFeeder) IsPreVotingPeriod(height int64) bool
IsPreVotingPeriod returns true if the current height is a prevoting period
func (*BaseFeeder) IsVotingPeriod ¶ added in v0.0.6
func (feeder *BaseFeeder) IsVotingPeriod(height int64) bool
IsVotingPeriod returns true if the current height is a voting period
func (*BaseFeeder) WantAbstain ¶ added in v0.0.6
func (feeder *BaseFeeder) WantAbstain(height int64) bool
WantAbstain returns true if the feeder wants to abstain from voting
type BlockFeeder ¶
type BlockFeeder struct { BaseFeeder // contains filtered or unexported fields }
func NewBlockFeeder ¶
func NewBlockFeeder( config *config.Config, sc *client.SettlusClient, subscribers []subscriber.Subscriber, logger log.Logger, ) (*BlockFeeder, error)
func (*BlockFeeder) HandleAbstain ¶
func (feeder *BlockFeeder) HandleAbstain(ctx context.Context) error
HandleAbstain Handles a prevote period when block data string cannot be gathered
func (*BlockFeeder) HandlePrevote ¶
func (feeder *BlockFeeder) HandlePrevote(ctx context.Context) error
HandlePrevote Handles a prevote period
func (*BlockFeeder) HandleVote ¶
func (feeder *BlockFeeder) HandleVote(ctx context.Context) error
HandleVote Handles a vote period
type BlockVoteInfo ¶
type Feeder ¶
type Feeder interface { IsPreVotingPeriod(height int64) bool IsVotingPeriod(height int64) bool WantAbstain(height int64) bool HandlePrevote(ctx context.Context) error HandleVote(ctx context.Context) error HandleAbstain(ctx context.Context) error FetchNewRoundInfo(ctx context.Context) }
func InitFeeders ¶
func InitFeeders(config *config.Config, sc *client.SettlusClient, chainClients []subscriber.Subscriber, logger log.Logger) ([]Feeder, error)
func NewFeeder ¶
func NewFeeder(feederType string, config *config.Config, sc *client.SettlusClient, chainClients []subscriber.Subscriber, logger log.Logger) (Feeder, error)