Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ProvisionerNr = 10
ProvisionerNr is the default amount of Provisioners utilized in the selection tests. This nr is just used to create the RoundUpdate and bares no importance in the selection step.
Functions ¶
This section is empty.
Types ¶
type Handler ¶ added in v0.2.0
Handler is responsible for performing operations that need to know about specific event fields.
func NewHandler ¶ added in v0.4.4
NewHandler will return a Handler, injected with the passed committee and an unmarshaller which uses the injected validation function.
func (*Handler) Committee ¶ added in v0.4.4
func (b *Handler) Committee(round uint64, step uint8) user.VotingCommittee
Committee returns a VotingCommittee for a given round and step.
type Helper ¶ added in v0.2.0
type Helper struct { *consensus.Emitter Round uint64 Step uint8 P *user.Provisioners // contains filtered or unexported fields }
Helper for reducing selection test boilerplate.
func (*Helper) RoundUpdate ¶ added in v0.4.0
func (h *Helper) RoundUpdate() consensus.RoundUpdate
RoundUpdate mocks a round update with the Round and Step embedded in the Helper.
type Phase ¶ added in v0.4.0
Phase is the implementation of the Selection step component.
func New ¶ added in v0.4.0
func New(next consensus.Phase, g blockgenerator.BlockGenerator, e *consensus.Emitter, timeout time.Duration, db database.DB) *Phase
New creates and launches the component which responsibility is to validate and select a Provisioner to propagate NewBlock message.
func (*Phase) Initialize ¶ added in v0.4.0
func (p *Phase) Initialize(_ consensus.InternalPacket) consensus.PhaseFn
Initialize returns the Phase state function for the next phase, and initializes it with the result from this phase.