Documentation ¶
Index ¶
- Constants
- func AggregateSignatureAndValidatorBitSet(votes []*model.Vote, validators []*tmtypes.Validator) ([]byte, *bitset.BitSet, error)
- func CalculateEventHash(event *model.Event, chainId string) []byte
- func DtoToEntity(v *model.Vote) (*votepool.Vote, error)
- func EntityToDto(from *votepool.Vote, challengeId uint64) *model.Vote
- type DataHandler
- func (h *DataHandler) FetchEventsForCollate(currentHeight uint64) ([]*model.Event, error)
- func (h *DataHandler) FetchEventsForSelfVote(currentHeight uint64) ([]*model.Event, uint64, error)
- func (h *DataHandler) FetchVotesForCollate(eventHash string) ([]*model.Vote, error)
- func (h *DataHandler) IsVoteExists(eventHash string, pubKey string) (bool, error)
- func (h *DataHandler) SaveVote(vote *model.Vote) error
- func (h *DataHandler) SaveVoteAndUpdateEventStatus(vote *model.Vote, challengeId uint64) error
- func (h *DataHandler) UpdateEventStatus(challengeId uint64, status model.EventStatus) error
- type DataProvider
- type VoteBroadcaster
- type VoteCollator
- type VoteCollector
- type VoteSigner
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func AggregateSignatureAndValidatorBitSet ¶
func AggregateSignatureAndValidatorBitSet(votes []*model.Vote, validators []*tmtypes.Validator) ([]byte, *bitset.BitSet, error)
AggregateSignatureAndValidatorBitSet aggregates signature from multiple votes, and marks the bitset of validators who contribute votes
Types ¶
type DataHandler ¶
type DataHandler struct {
// contains filtered or unexported fields
}
func NewDataHandler ¶
func NewDataHandler(daoManager *dao.DaoManager, executor *executor.Executor) *DataHandler
func (*DataHandler) FetchEventsForCollate ¶
func (h *DataHandler) FetchEventsForCollate(currentHeight uint64) ([]*model.Event, error)
func (*DataHandler) FetchEventsForSelfVote ¶
func (*DataHandler) FetchVotesForCollate ¶ added in v0.0.2
func (h *DataHandler) FetchVotesForCollate(eventHash string) ([]*model.Vote, error)
func (*DataHandler) IsVoteExists ¶
func (h *DataHandler) IsVoteExists(eventHash string, pubKey string) (bool, error)
func (*DataHandler) SaveVoteAndUpdateEventStatus ¶ added in v0.0.2
func (h *DataHandler) SaveVoteAndUpdateEventStatus(vote *model.Vote, challengeId uint64) error
func (*DataHandler) UpdateEventStatus ¶
func (h *DataHandler) UpdateEventStatus(challengeId uint64, status model.EventStatus) error
type DataProvider ¶
type DataProvider interface { FetchEventsForSelfVote(currentHeight uint64) ([]*model.Event, uint64, error) FetchEventsForCollate(currentHeight uint64) ([]*model.Event, error) FetchVotesForCollate(eventHash string) ([]*model.Vote, error) UpdateEventStatus(challengeId uint64, status model.EventStatus) error SaveVote(vote *model.Vote) error SaveVoteAndUpdateEventStatus(vote *model.Vote, challengeId uint64) error IsVoteExists(eventHash string, pubKey string) (bool, error) }
type VoteBroadcaster ¶
type VoteBroadcaster struct {
// contains filtered or unexported fields
}
func NewVoteBroadcaster ¶
func NewVoteBroadcaster(cfg *config.Config, signer *VoteSigner, executor *executor.Executor, broadcasterDataProvider DataProvider, metricService *metrics.MetricService, ) *VoteBroadcaster
func (*VoteBroadcaster) BroadcastVotesLoop ¶
func (p *VoteBroadcaster) BroadcastVotesLoop()
type VoteCollator ¶
type VoteCollator struct {
// contains filtered or unexported fields
}
func NewVoteCollator ¶
func NewVoteCollator(cfg *config.Config, signer *VoteSigner, executor *executor.Executor, collatorDataProvider DataProvider, metricService *metrics.MetricService, ) *VoteCollator
func (*VoteCollator) CollateVotesLoop ¶
func (p *VoteCollator) CollateVotesLoop()
type VoteCollector ¶
type VoteCollector struct {
// contains filtered or unexported fields
}
func NewVoteCollector ¶
func NewVoteCollector(cfg *config.Config, executor *executor.Executor, collectorDataProvider DataProvider, metricService *metrics.MetricService) *VoteCollector
func (*VoteCollector) CollectVotesLoop ¶
func (p *VoteCollector) CollectVotesLoop()
type VoteSigner ¶
type VoteSigner struct {
// contains filtered or unexported fields
}
func NewVoteSigner ¶
func NewVoteSigner(pk []byte) *VoteSigner
Click to show internal directories.
Click to hide internal directories.