Documentation ¶
Index ¶
- type ArgsNewEconomicsData
- type EconomicsData
- func (ed *EconomicsData) CheckValidityTxValues(tx process.TransactionWithFeeHandler) error
- func (ed *EconomicsData) ComputeGasLimit(tx process.TransactionWithFeeHandler) uint64
- func (ed *EconomicsData) ComputeMoveBalanceFee(tx process.TransactionWithFeeHandler) *big.Int
- func (ed *EconomicsData) ComputeTxFee(tx process.TransactionWithFeeHandler) *big.Int
- func (ed *EconomicsData) DeveloperPercentage() float64
- func (ed *EconomicsData) EpochConfirmed(epoch uint32)
- func (ed *EconomicsData) GasPerDataByte() uint64
- func (ed *EconomicsData) GenesisTotalSupply() *big.Int
- func (ed *EconomicsData) IsInterfaceNil() bool
- func (ed *EconomicsData) LeaderPercentage() float64
- func (ed *EconomicsData) MaxGasLimitPerBlock(shardID uint32) uint64
- func (ed *EconomicsData) MaxInflationRate(year uint32) float64
- func (ed *EconomicsData) MinGasLimit() uint64
- func (ed *EconomicsData) MinGasPrice() uint64
- func (ed *EconomicsData) MinInflationRate() float64
- func (ed *EconomicsData) ProtocolSustainabilityAddress() string
- func (ed *EconomicsData) ProtocolSustainabilityPercentage() float64
- type TestEconomicsData
- func (ted *TestEconomicsData) GetMinGasLimit() uint64
- func (ted *TestEconomicsData) GetMinGasPrice() uint64
- func (ted *TestEconomicsData) SetDataLimitForBaseCalc(dataLimitForBaseCalc uint64)
- func (ted *TestEconomicsData) SetGasPerDataByte(gasPerDataByte uint64)
- func (ted *TestEconomicsData) SetMaxGasLimitPerBlock(maxGasLimitPerBlock uint64)
- func (ted *TestEconomicsData) SetMinGasLimit(minGasLimit uint64)
- func (ted *TestEconomicsData) SetMinGasPrice(minGasPrice uint64)
- func (ted *TestEconomicsData) SetTotalSupply(totalSupply *big.Int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArgsNewEconomicsData ¶ added in v1.1.1
type ArgsNewEconomicsData struct { Economics *config.EconomicsConfig PenalizedTooMuchGasEnableEpoch uint32 EpochNotifier process.EpochNotifier }
ArgsNewEconomicsData defines the arguments needed for new economics data
type EconomicsData ¶
type EconomicsData struct {
// contains filtered or unexported fields
}
EconomicsData will store information about economics
func NewEconomicsData ¶
func NewEconomicsData(args ArgsNewEconomicsData) (*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) 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) ComputeMoveBalanceFee ¶ added in v1.1.1
func (ed *EconomicsData) ComputeMoveBalanceFee(tx process.TransactionWithFeeHandler) *big.Int
ComputeMoveBalanceFee computes the provided transaction's fee
func (*EconomicsData) ComputeTxFee ¶ added in v1.1.1
func (ed *EconomicsData) ComputeTxFee(tx process.TransactionWithFeeHandler) *big.Int
ComputeTxFee computes the provided transaction's fee using enable from epoch approach
func (*EconomicsData) DeveloperPercentage ¶
func (ed *EconomicsData) DeveloperPercentage() float64
DeveloperPercentage will return the developer percentage value
func (*EconomicsData) EpochConfirmed ¶ added in v1.1.1
func (ed *EconomicsData) EpochConfirmed(epoch uint32)
EpochConfirmed is called whenever a new epoch is confirmed
func (*EconomicsData) GasPerDataByte ¶ added in v1.0.114
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 ¶ added in v1.0.24
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 v1.0.147
func (ed *EconomicsData) ProtocolSustainabilityAddress() string
ProtocolSustainabilityAddress will return the protocol sustainability address
func (*EconomicsData) ProtocolSustainabilityPercentage ¶ added in v1.0.147
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 ¶ added in v1.0.115
func (ted *TestEconomicsData) SetTotalSupply(totalSupply *big.Int)
SetTotalSupply sets the total supply when booting the network