Documentation ¶
Index ¶
- Constants
- func AggregateSignatureAndValidatorBitSet(votes []*model.Vote, validators interface{}) ([]byte, *bitset.BitSet, error)
- func DtoToEntity(v *model.Vote) (*votepool.Vote, error)
- func EntityToDto(from *votepool.Vote, channelId uint8, sequence uint64, payload []byte, ...) *model.Vote
- func VerifySignature(vote *votepool.Vote, eventHash []byte) error
- type BSCVoteProcessor
- type GreenfieldVoteProcessor
- type VoteSigner
Constants ¶
View Source
const ( ValidatorsCapacity = 256 QueryVotepoolMaxRetryTimes = 5 VotePoolQueryRetryInterval = 300 * time.Millisecond )
Variables ¶
This section is empty.
Functions ¶
func AggregateSignatureAndValidatorBitSet ¶
func AggregateSignatureAndValidatorBitSet(votes []*model.Vote, validators interface{}) ([]byte, *bitset.BitSet, error)
AggregateSignatureAndValidatorBitSet aggregates signature from multiple votes, and marks the bitset of validators who contribute votes
func EntityToDto ¶
Types ¶
type BSCVoteProcessor ¶
type BSCVoteProcessor struct {
// contains filtered or unexported fields
}
func NewBSCVoteProcessor ¶
func NewBSCVoteProcessor(cfg *config.Config, dao *dao.DaoManager, signer *VoteSigner, bscExecutor *executor.BSCExecutor) *BSCVoteProcessor
func (*BSCVoteProcessor) CollectVotesLoop ¶
func (p *BSCVoteProcessor) CollectVotesLoop()
func (*BSCVoteProcessor) SignAndBroadcastVoteLoop ¶
func (p *BSCVoteProcessor) SignAndBroadcastVoteLoop()
type GreenfieldVoteProcessor ¶
type GreenfieldVoteProcessor struct {
// contains filtered or unexported fields
}
func NewGreenfieldVoteProcessor ¶
func NewGreenfieldVoteProcessor(cfg *config.Config, dao *dao.DaoManager, signer *VoteSigner, greenfieldExecutor *executor.GreenfieldExecutor, ) *GreenfieldVoteProcessor
func (*GreenfieldVoteProcessor) CollectVotesLoop ¶
func (p *GreenfieldVoteProcessor) CollectVotesLoop()
func (*GreenfieldVoteProcessor) SignAndBroadcastLoop ¶
func (p *GreenfieldVoteProcessor) SignAndBroadcastLoop()
SignAndBroadcastLoop signs tx using the relayer's bls private key, then broadcasts the vote to Greenfield votepool
type VoteSigner ¶
type VoteSigner struct {
// contains filtered or unexported fields
}
func NewVoteSigner ¶
func NewVoteSigner(pk []byte) *VoteSigner
func (*VoteSigner) SignVote ¶
func (signer *VoteSigner) SignVote(vote *votepool.Vote)
SignVote signs a vote by relayer's private key
Click to show internal directories.
Click to hide internal directories.