economics

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: GPL-3.0 Imports: 6 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) 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) GasPerDataByte

func (ed *EconomicsData) GasPerDataByte() uint64

GasPerDataByte will return the gas required for a data byte

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(shardID uint32) uint64

MaxGasLimitPerBlock will return maximum gas limit allowed per block

func (*EconomicsData) MaxInflationRate

func (ed *EconomicsData) MaxInflationRate(year uint32) float64

MaxInflationRate will return the maximum inflation rate

func (*EconomicsData) MinGasLimit

func (ed *EconomicsData) MinGasLimit() uint64

MinGasLimit will return min gas limit

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) ProtocolSustainabilityAddress added in v0.0.2

func (ed *EconomicsData) ProtocolSustainabilityAddress() string

ProtocolSustainabilityAddress will return the protocol sustainability address

func (*EconomicsData) ProtocolSustainabilityPercentage added in v0.0.2

func (ed *EconomicsData) ProtocolSustainabilityPercentage() float64

ProtocolSustainabilityPercentage will return the protocol sustainability percentage value

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

func (*TestEconomicsData) SetTotalSupply

func (ted *TestEconomicsData) SetTotalSupply(totalSupply *big.Int)

SetTotalSupply sets the total supply when booting the network

Jump to

Keyboard shortcuts

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