Documentation
¶
Index ¶
- type FactoryFunc
- type Handler
- func (b *Handler) AmMember(round uint64, step uint8) bool
- func (b *Handler) Committee(round uint64, step uint8) user.VotingCommittee
- func (b *Handler) IsMember(pubKeyBLS []byte, round uint64, step uint8) bool
- func (b *Handler) Quorum(round uint64) int
- func (b *Handler) VerifySignature(red message.Reduction) error
- func (b *Handler) VotesFor(pubKeyBLS []byte, round uint64, step uint8) int
- type Helper
- type Reducer
- type Timer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FactoryFunc ¶ added in v0.2.0
FactoryFunc is a shorthand for the reduction factories to create a Reducer
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.2.0
func NewHandler(keys key.Keys, p user.Provisioners) *Handler
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.2.0
func (b *Handler) Committee(round uint64, step uint8) user.VotingCommittee
Committee returns a VotingCommittee for a given round and step.
func (*Handler) IsMember ¶ added in v0.2.0
IsMember delegates the committee.Handler to check if a BLS public key belongs to a committee for the specified round and step
func (*Handler) Quorum ¶ added in v0.2.0
Quorum returns the amount of committee votes to reach a quorum
func (*Handler) VerifySignature ¶ added in v0.2.0
VerifySignature verifies the BLS signature of the Reduction event. Since the payload is nil, verifying the signature equates to verifying solely the Header
type Helper ¶ added in v0.2.0
type Helper struct {
PubKeyBLS []byte
Reducer Reducer
Bus *eventbus.EventBus
RBus *rpcbus.RPCBus
Keys []key.Keys
P *user.Provisioners
Handler *Handler
*consensus.SimplePlayer
CollectionWaitGroup sync.WaitGroup
// contains filtered or unexported fields
}
Helper for reducing test boilerplate
func NewHelper ¶ added in v0.2.0
func NewHelper(eb *eventbus.EventBus, rpcbus *rpcbus.RPCBus, provisioners int, factory FactoryFunc, timeOut time.Duration) *Helper
NewHelper creates a Helper
func (*Helper) Initialize ¶ added in v0.2.0
func (hlp *Helper) Initialize(ru consensus.RoundUpdate)
Initialize the reducer with a Round update
func (*Helper) SendBatch ¶ added in v0.2.0
SendBatch of consensus events to the reducer callback CollectReductionEvent
type Reducer ¶ added in v0.2.0
type Reducer interface {
consensus.Component
// Collect collects reduction consensus events in order to generate StepVotes or an Agreement
Collect(consensus.InternalPacket) error
}
Reducer abstracts the first and second step Reduction components