economics

package
v1.0.107 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 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 EconomicsData

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

EconomicsData will store information about economics

func NewEconomicsData

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

NewEconomicsData will create and object with information about economics parameters

func (*EconomicsData) AuctionEnableNonce

func (ed *EconomicsData) AuctionEnableNonce() uint64

AuctionEnableNonce returns the nonce from which the auction process is enabled

func (*EconomicsData) BleedPercentagePerRound

func (ed *EconomicsData) BleedPercentagePerRound() float64

BleedPercentagePerRound will return the bleedPercentagePerRound

func (*EconomicsData) CheckValidityTxValues

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

CheckValidityTxValues checks if the provided transaction is economically correct

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) DeveloperPercentage

func (ed *EconomicsData) DeveloperPercentage() float64

DeveloperPercentage will return the developer percentage value

func (*EconomicsData) GenesisNodePrice

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

GenesisNodePrice will return the minimum stake value

func (*EconomicsData) GenesisTotalSupply

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

GenesisTotalSupply will return the genesis total supply

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) MaxInflationRate

func (ed *EconomicsData) MaxInflationRate() float64

MaxInflationRate will return the maximum inflation rate

func (*EconomicsData) MaximumPercentageToBleed

func (ed *EconomicsData) MaximumPercentageToBleed() float64

MaximumPercentageToBleed will return the maximumPercentageToBleed

func (*EconomicsData) MinGasPrice

func (ed *EconomicsData) MinGasPrice() uint64

MinGasPrice will return min gas price

func (*EconomicsData) MinInflationRate

func (ed *EconomicsData) MinInflationRate() float64

MinInflationRate will return the minimum inflation rate

func (*EconomicsData) MinStepValue

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

MinStepValue returns the step value which is considered in the node price determination

func (*EconomicsData) NumNodes

func (ed *EconomicsData) NumNodes() uint32

NumNodes returns the total node number for current setting

func (*EconomicsData) NumRoundsWithoutBleed

func (ed *EconomicsData) NumRoundsWithoutBleed() uint64

NumRoundsWithoutBleed will return the numRoundsWithoutBleed period

func (*EconomicsData) StakeEnableNonce

func (ed *EconomicsData) StakeEnableNonce() uint64

StakeEnableNonce returns the nonce from which the staking/unstaking function is enabled

func (*EconomicsData) TotalSupply

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

TotalSupply returns the total supply of the protocol

func (*EconomicsData) UnBondPeriod

func (ed *EconomicsData) UnBondPeriod() uint64

UnBondPeriod will return the unbond period

func (*EconomicsData) UnJailValue

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

UnJailValue returns the unjail value which is considered the price to bail out of jail

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

GetMinGasLimit returns 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

Jump to

Keyboard shortcuts

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