rating

package
v1.0.80 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 *economics.RatingsData) (*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) GetRating

func (bsr *BlockSigningRater) GetRating(pk string) uint32

GetRating returns the Rating for the specified public key

func (*BlockSigningRater) GetRatings added in v1.0.67

func (bsr *BlockSigningRater) GetRatings(addresses []string) map[string]uint32

GetRatings gets all the ratings that the current rater has

func (*BlockSigningRater) GetStartRating

func (bsr *BlockSigningRater) GetStartRating() uint32

GetStartRating gets the StartingRating

func (*BlockSigningRater) IsInterfaceNil

func (bsr *BlockSigningRater) IsInterfaceNil() bool

SetRatingReader sets the Reader that can read ratings

func (*BlockSigningRater) SetRatingReader

func (bsr *BlockSigningRater) SetRatingReader(reader sharding.RatingReader)

SetRatingReader sets the Reader that can read ratings

type NilRatingReader added in v1.0.67

type NilRatingReader struct {
}

func (*NilRatingReader) GetRating added in v1.0.67

func (*NilRatingReader) GetRating(string) uint32

GetRating gets the rating for the public key

func (*NilRatingReader) GetRatings added in v1.0.67

func (*NilRatingReader) GetRatings(pks []string) map[string]uint32

GetRatings gets all the ratings as a map[pk] ratingValue

func (*NilRatingReader) IsInterfaceNil added in v1.0.67

func (rr *NilRatingReader) IsInterfaceNil() bool

IsInterfaceNil verifies if the interface is nil

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL