Documentation ¶
Index ¶
- Variables
- func CalculateTotalStake(validators *Validators) *big.Int
- func GetMultipliedYield(reward, stake *big.Int) *big.Int
- func GetValidatorsYield(rewards map[string]*big.Int, validators *Validators) []storage.ValidatorYield
- func GetYieldForInterval(yields_sum, blocks_per_year *big.Int, elem_count int64) float64
- func Max(x, y int64) int64
- func Min(x, y int64) int64
- func ZeroTotalRewards() (tr totalPeriodRewards)
- type PeriodRewards
- type Rewards
- func (r *Rewards) AfterCommit()
- func (r *Rewards) GetIntervalRewards(periodRewards PeriodRewards, distributionFrequency uint32) PeriodRewards
- func (r *Rewards) Process(total_minted *big.Int, dags []chain.DagBlock, trxs []chain.Transaction, ...) (currentBlockFee *big.Int)
- func (r *Rewards) ProcessRewards(periodRewards PeriodRewards, total_minted *big.Int, totalStake *big.Int) (*big.Int, *big.Int)
- type Validators
Constants ¶
This section is empty.
Variables ¶
View Source
var YieldFractionDecimalPrecision = big.NewInt(1e+6)
Functions ¶
func CalculateTotalStake ¶ added in v0.3.0
func CalculateTotalStake(validators *Validators) *big.Int
func GetValidatorsYield ¶ added in v0.3.0
func GetValidatorsYield(rewards map[string]*big.Int, validators *Validators) []storage.ValidatorYield
func GetYieldForInterval ¶ added in v0.3.0
func ZeroTotalRewards ¶ added in v0.3.2
func ZeroTotalRewards() (tr totalPeriodRewards)
Types ¶
type PeriodRewards ¶ added in v0.4.0
type PeriodRewards struct { ValidatorRewards map[string]*big.Int TotalReward *big.Int BlockFee *big.Int }
func MakePeriodRewards ¶ added in v0.4.0
func MakePeriodRewards() (r PeriodRewards)
func (*PeriodRewards) ToStorage ¶ added in v0.4.0
func (p *PeriodRewards) ToStorage() storage.PeriodRewards
type Rewards ¶
type Rewards struct {
// contains filtered or unexported fields
}
func MakeRewards ¶
func (*Rewards) AfterCommit ¶
func (r *Rewards) AfterCommit()
func (*Rewards) GetIntervalRewards ¶ added in v0.4.0
func (r *Rewards) GetIntervalRewards(periodRewards PeriodRewards, distributionFrequency uint32) PeriodRewards
type Validators ¶ added in v0.3.3
type Validators struct {
// contains filtered or unexported fields
}
func MakeValidators ¶ added in v0.3.3
func MakeValidators(config *common.Config, validators []chain.Validator) *Validators
func (*Validators) Exists ¶ added in v0.3.3
func (v *Validators) Exists(address string) bool
func (*Validators) IsEligible ¶ added in v0.3.3
func (v *Validators) IsEligible(address string) bool
Click to show internal directories.
Click to hide internal directories.