rewards

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateTotalStake added in v0.3.0

func CalculateTotalStake(validators *Validators) *big.Int

func GetMultipliedYield added in v0.3.0

func GetMultipliedYield(reward, stake *big.Int) *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 GetYieldForInterval(yields_sum, blocks_per_year *big.Int, elem_count int64) float64

func Max

func Max(x, y int64) int64

func Min

func Min(x, y int64) int64

func ZeroTotalRewards added in v0.3.2

func ZeroTotalRewards() (tr totalRewards)

Types

type Rewards

type Rewards struct {
	// contains filtered or unexported fields
}

func MakeRewards

func MakeRewards(storage storage.Storage, batch storage.Batch, config *common.Config, block *models.Pbft, validators []dpos_interface.DposInterfaceValidatorData) *Rewards

func (*Rewards) AfterCommit

func (r *Rewards) AfterCommit()

func (*Rewards) Process

func (r *Rewards) Process(total_minted *big.Int, dags []chain.DagBlock, trxs []models.Transaction, votes chain.VotesResponse)

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 []dpos_interface.DposInterfaceValidatorData) *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

Jump to

Keyboard shortcuts

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