Documentation ¶
Index ¶
- func Launch(eventBroker wire.EventBroker, handler ScoreEventHandler, timeout time.Duration)
- func LaunchNotification(eventbus wire.EventSubscriber) <-chan *ScoreEvent
- func MarshalScoreEvent(r *bytes.Buffer, ev wire.Event) error
- func MockSelectionEventBuffer(round uint64, hash []byte) *bytes.Buffer
- func UnmarshalScoreEvent(r *bytes.Buffer, ev wire.Event) error
- type ScoreEvent
- type ScoreEventHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Launch ¶
func Launch(eventBroker wire.EventBroker, handler ScoreEventHandler, timeout time.Duration)
Launch creates and launches the component which responsibility is to validate and select the best score among the blind bidders. The component publishes under the topic BestScoreTopic
func LaunchNotification ¶
func LaunchNotification(eventbus wire.EventSubscriber) <-chan *ScoreEvent
func MarshalScoreEvent ¶
MarshalScoreEvent the buffer into a committee Event Field order is the following: * Consensus Header [Round; Step] * Blind Bid Fields [Score, Proof, Z, BidList, Seed, Candidate Block Hash]
func MockSelectionEventBuffer ¶
MockSelectionEventBuffer mocks a Selection event, marshals it, and returns the resulting buffer.
Types ¶
type ScoreEvent ¶
type ScoreEvent struct { // Fields related to the consensus Round uint64 // Fields related to the score Score []byte Proof []byte Z []byte BidListSubset []byte PrevHash []byte Certificate *block.Certificate Seed []byte VoteHash []byte }
ScoreEvent represents the Score Message with the fields consistent with the Blind Bid data structure
func MockSelectionEvent ¶
func MockSelectionEvent(round uint64, hash []byte) *ScoreEvent
MockSelectionEvent mocks a Selection event and returns it.
func (*ScoreEvent) Equal ¶
func (e *ScoreEvent) Equal(ev wire.Event) bool
Equal as specified in the Event interface
func (*ScoreEvent) Sender ¶
func (e *ScoreEvent) Sender() []byte
Sender of a Score event is the anonymous Z
type ScoreEventHandler ¶
type ScoreEventHandler interface { consensus.EventHandler wire.EventPrioritizer UpdateBidList(user.Bid) RemoveExpiredBids(uint64) ResetThreshold() LowerThreshold() }
ScoreEventHandler extends the consensus.EventHandler interface with methods specific to the handling of score events.