Documentation ¶
Index ¶
- func NewNilRatingReader(startRating uint32) *nilRatingReader
- type BlockSigningRater
- func (bsr *BlockSigningRater) ComputeDecreaseProposer(val uint32) uint32
- func (bsr *BlockSigningRater) ComputeDecreaseValidator(val uint32) uint32
- func (bsr *BlockSigningRater) ComputeIncreaseProposer(val uint32) uint32
- func (bsr *BlockSigningRater) ComputeIncreaseValidator(val uint32) uint32
- func (bsr *BlockSigningRater) GetChance(currentRating uint32) uint32
- func (bsr *BlockSigningRater) GetRating(pk string) uint32
- func (bsr *BlockSigningRater) GetStartRating() uint32
- func (bsr *BlockSigningRater) IsInterfaceNil() bool
- func (bsr *BlockSigningRater) SetRatingReader(reader sharding.RatingReader)
- func (bsr *BlockSigningRater) UpdateRatingFromTempRating(pks []string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNilRatingReader ¶
func NewNilRatingReader(startRating uint32) *nilRatingReader
NewNilRatingReader create a new ratingReader that returns fixed values
Types ¶
type BlockSigningRater ¶
type BlockSigningRater struct { sharding.RatingReader // contains filtered or unexported fields }
BlockSigningRater defines the behaviour of a struct able to do ratings for validators
func NewBlockSigningRater ¶
func NewBlockSigningRater(ratingsData process.RatingsInfo) (*BlockSigningRater, error)
NewBlockSigningRater creates a new RaterHandler of Type BlockSigningRater
func (*BlockSigningRater) ComputeDecreaseProposer ¶
func (bsr *BlockSigningRater) ComputeDecreaseProposer(val uint32) uint32
ComputeDecreaseProposer computes the new rating for the decreaseLeader
func (*BlockSigningRater) ComputeDecreaseValidator ¶
func (bsr *BlockSigningRater) ComputeDecreaseValidator(val uint32) uint32
ComputeDecreaseValidator computes the new rating for the decreaseValidator
func (*BlockSigningRater) ComputeIncreaseProposer ¶
func (bsr *BlockSigningRater) ComputeIncreaseProposer(val uint32) uint32
ComputeIncreaseProposer computes the new rating for the increaseLeader
func (*BlockSigningRater) ComputeIncreaseValidator ¶
func (bsr *BlockSigningRater) ComputeIncreaseValidator(val uint32) uint32
ComputeIncreaseValidator computes the new rating for the increaseValidator
func (*BlockSigningRater) GetChance ¶
func (bsr *BlockSigningRater) GetChance(currentRating uint32) uint32
GetChance returns the RatingChance for the pk
func (*BlockSigningRater) GetRating ¶
func (bsr *BlockSigningRater) GetRating(pk string) uint32
GetRating returns the Rating for the specified public key
func (*BlockSigningRater) GetStartRating ¶
func (bsr *BlockSigningRater) GetStartRating() uint32
GetStartRating gets the StartingRating
func (*BlockSigningRater) IsInterfaceNil ¶
func (bsr *BlockSigningRater) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*BlockSigningRater) SetRatingReader ¶
func (bsr *BlockSigningRater) SetRatingReader(reader sharding.RatingReader)
SetRatingReader sets the Reader that can read ratings
func (*BlockSigningRater) UpdateRatingFromTempRating ¶
func (bsr *BlockSigningRater) UpdateRatingFromTempRating(pks []string) error
UpdateRatingFromTempRating returns the TempRating for the specified public keys