economics

package
v1.0.84 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EconomicsData

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

EconomicsData will store information about economics

func NewEconomicsData

func NewEconomicsData(economics *config.ConfigEconomics) (*EconomicsData, error)

NewEconomicsData will create and object with information about economics parameters

func (*EconomicsData) BurnAddress added in v1.0.20

func (ed *EconomicsData) BurnAddress() string

BurnAddress will return burn address

func (*EconomicsData) BurnPercentage added in v1.0.20

func (ed *EconomicsData) BurnPercentage() float64

BurnPercentage will return burn percentage

func (*EconomicsData) CheckValidityTxValues

func (ed *EconomicsData) CheckValidityTxValues(tx process.TransactionWithFeeHandler) error

CheckValidityTxValues checks if the provided transaction is economically correct

func (*EconomicsData) CommunityAddress added in v1.0.20

func (ed *EconomicsData) CommunityAddress() string

CommunityAddress will return community address

func (*EconomicsData) CommunityPercentage added in v1.0.20

func (ed *EconomicsData) CommunityPercentage() float64

CommunityPercentage will return community reward percentage

func (*EconomicsData) ComputeFee

ComputeFee computes the provided transaction's fee

func (*EconomicsData) ComputeGasLimit

func (ed *EconomicsData) ComputeGasLimit(tx process.TransactionWithFeeHandler) uint64

ComputeGasLimit returns the gas limit need by the provided transaction in order to be executed

func (*EconomicsData) IsInterfaceNil

func (ed *EconomicsData) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*EconomicsData) LeaderPercentage

func (ed *EconomicsData) LeaderPercentage() float64

LeaderPercentage will return leader reward percentage

func (*EconomicsData) MaxGasLimitPerBlock

func (ed *EconomicsData) MaxGasLimitPerBlock() uint64

MaxGasLimitPerBlock will return maximum gas limit allowed per block

func (*EconomicsData) RatingsData

func (ed *EconomicsData) RatingsData() *RatingsData

RatingsData will return the ratingsDataObject

func (*EconomicsData) RewardsValue added in v1.0.20

func (ed *EconomicsData) RewardsValue() *big.Int

RewardsValue will return rewards value

func (*EconomicsData) StakeValue added in v1.0.39

func (ed *EconomicsData) StakeValue() *big.Int

StakeValue will return the minimum stake value

func (*EconomicsData) UnBoundPeriod added in v1.0.39

func (ed *EconomicsData) UnBoundPeriod() uint64

UnBoundPeriod will return the unbound period

type RatingsData

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

RatingsData will store information about ratingsComputation

func NewRatingsData

func NewRatingsData(
	settings config.RatingSettings,
) (*RatingsData, error)

NewRatingsData creates a new RatingsData instance

func (*RatingsData) MaxRating

func (rd *RatingsData) MaxRating() uint32

MaxRating will return the max rating

func (*RatingsData) MinRating

func (rd *RatingsData) MinRating() uint32

MinRating will return the min rating

func (*RatingsData) ProposerDecreaseRatingStep

func (rd *RatingsData) ProposerDecreaseRatingStep() uint32

ProposerDecreaseRatingStep will return the rating step decrease for proposer

func (*RatingsData) ProposerIncreaseRatingStep

func (rd *RatingsData) ProposerIncreaseRatingStep() uint32

ProposerIncreaseRatingStep will return the rating step increase for validator

func (*RatingsData) StartRating

func (rd *RatingsData) StartRating() uint32

StartRating will return the start rating

func (*RatingsData) ValidatorDecreaseRatingStep

func (rd *RatingsData) ValidatorDecreaseRatingStep() uint32

ValidatorDecreaseRatingStep will return the rating step decrease for validator

func (*RatingsData) ValidatorIncreaseRatingStep

func (rd *RatingsData) ValidatorIncreaseRatingStep() uint32

ValidatorIncreaseRatingStep will return the rating step increase for validator

type TestEconomicsData

type TestEconomicsData struct {
	*EconomicsData
}

TestEconomicsData extends EconomicsData and is used in integration tests as it exposes some functions that are not supposed to be used in production code Exported functions simplify the reproduction of edge cases

func (*TestEconomicsData) GetMinGasLimit

func (ted *TestEconomicsData) GetMinGasLimit() uint64

SetMinGasLimit sets the minimum gas limit for a transaction to be accepted

func (*TestEconomicsData) GetMinGasPrice

func (ted *TestEconomicsData) GetMinGasPrice() uint64

GetMinGasPrice returns the current min gas price

func (*TestEconomicsData) SetDataLimitForBaseCalc

func (ted *TestEconomicsData) SetDataLimitForBaseCalc(dataLimitForBaseCalc uint64)

SetDataLimitForBaseCalc sets base calc limit for gasLimit calculation

func (*TestEconomicsData) SetGasPerDataByte

func (ted *TestEconomicsData) SetGasPerDataByte(gasPerDataByte uint64)

SetGasPerDataByte sets gas per data byte for a transaction to be accepted

func (*TestEconomicsData) SetMaxGasLimitPerBlock

func (ted *TestEconomicsData) SetMaxGasLimitPerBlock(maxGasLimitPerBlock uint64)

SetMaxGasLimitPerBlock sets the maximum gas limit allowed per one block

func (*TestEconomicsData) SetMinGasLimit

func (ted *TestEconomicsData) SetMinGasLimit(minGasLimit uint64)

SetMinGasLimit sets the minimum gas limit for a transaction to be accepted

func (*TestEconomicsData) SetMinGasPrice

func (ted *TestEconomicsData) SetMinGasPrice(minGasPrice uint64)

SetMinGasPrice sets the minimum gas price for a transaction to be accepted

func (*TestEconomicsData) SetRewards added in v1.0.42

func (ted *TestEconomicsData) SetRewards(value *big.Int)

SetRewards sets the new reward value

Jump to

Keyboard shortcuts

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