Documentation ¶
Index ¶
- func NewEconomicsData(args ArgsNewEconomicsData) (*economicsData, error)
- type ArgsNewEconomicsData
- type TestEconomicsData
- func (ed TestEconomicsData) CheckValidityTxValues(tx process.TransactionWithFeeHandler) error
- func (ed TestEconomicsData) ComputeFeeForProcessing(tx process.TransactionWithFeeHandler, gasToUse uint64) *big.Int
- func (ed TestEconomicsData) ComputeGasLimit(tx process.TransactionWithFeeHandler) uint64
- func (ed TestEconomicsData) ComputeGasUsedAndFeeBasedOnRefundValue(tx process.TransactionWithFeeHandler, refundValue *big.Int) (uint64, *big.Int)
- func (ed TestEconomicsData) ComputeMoveBalanceFee(tx process.TransactionWithFeeHandler) *big.Int
- func (ed TestEconomicsData) ComputeTxFee(tx process.TransactionWithFeeHandler) *big.Int
- func (ed TestEconomicsData) ComputeTxFeeBasedOnGasUsed(tx process.TransactionWithFeeHandler, gasUsed uint64) *big.Int
- func (ed TestEconomicsData) DeveloperPercentage() float64
- func (ed TestEconomicsData) EpochConfirmed(epoch uint32)
- func (ed TestEconomicsData) GasPerDataByte() uint64
- func (ed TestEconomicsData) GasPriceForMove(tx process.TransactionWithFeeHandler) uint64
- func (ed TestEconomicsData) GasPriceForProcessing(tx process.TransactionWithFeeHandler) uint64
- func (ed TestEconomicsData) GasPriceModifier() float64
- func (ed TestEconomicsData) GenesisTotalSupply() *big.Int
- func (ted *TestEconomicsData) GetMinGasLimit() uint64
- func (ted *TestEconomicsData) GetMinGasPrice() uint64
- func (ed TestEconomicsData) IsInterfaceNil() bool
- func (ed TestEconomicsData) LeaderPercentage() float64
- func (ed TestEconomicsData) MaxGasLimitPerBlock(shardID uint32) uint64
- func (ed TestEconomicsData) MaxInflationRate(year uint32) float64
- func (ed TestEconomicsData) MinGasLimit() uint64
- func (ed TestEconomicsData) MinGasPrice() uint64
- func (ed TestEconomicsData) MinGasPriceForProcessing() uint64
- func (ed TestEconomicsData) MinInflationRate() float64
- func (ed TestEconomicsData) ProtocolSustainabilityAddress() string
- func (ed TestEconomicsData) ProtocolSustainabilityPercentage() float64
- func (ed TestEconomicsData) RewardsTopUpFactor() float64
- func (ed TestEconomicsData) RewardsTopUpGradientPoint() *big.Int
- func (ted *TestEconomicsData) SetGasPerDataByte(gasPerDataByte uint64)
- func (ted *TestEconomicsData) SetMaxGasLimitPerBlock(maxGasLimitPerBlock uint64)
- func (ted *TestEconomicsData) SetMaxInflationRate(maximumInflation float64)
- func (ted *TestEconomicsData) SetMinGasLimit(minGasLimit uint64)
- func (ted *TestEconomicsData) SetMinGasPrice(minGasPrice uint64)
- func (ted *TestEconomicsData) SetTotalSupply(totalSupply *big.Int)
- func (ed TestEconomicsData) SplitTxGasInCategories(tx process.TransactionWithFeeHandler) (gasLimitMove, gasLimitProcess uint64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEconomicsData ¶
func NewEconomicsData(args ArgsNewEconomicsData) (*economicsData, error)
NewEconomicsData will create and object with information about economics parameters
Types ¶
type ArgsNewEconomicsData ¶ added in v1.1.1
type ArgsNewEconomicsData struct { Economics *config.EconomicsConfig EpochNotifier process.EpochNotifier PenalizedTooMuchGasEnableEpoch uint32 GasPriceModifierEnableEpoch uint32 }
ArgsNewEconomicsData defines the arguments needed for new economics economicsData
type TestEconomicsData ¶
type TestEconomicsData struct {
// contains filtered or unexported fields
}
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 NewTestEconomicsData ¶ added in v1.1.15
func NewTestEconomicsData(internalData *economicsData) *TestEconomicsData
NewTestEconomicsData -
func (TestEconomicsData) CheckValidityTxValues ¶ added in v1.1.15
func (ed TestEconomicsData) CheckValidityTxValues(tx process.TransactionWithFeeHandler) error
CheckValidityTxValues checks if the provided transaction is economically correct
func (TestEconomicsData) ComputeFeeForProcessing ¶ added in v1.1.15
func (ed TestEconomicsData) ComputeFeeForProcessing(tx process.TransactionWithFeeHandler, gasToUse uint64) *big.Int
ComputeFeeForProcessing will compute the fee using the gas price modifier, the gas to use and the actual gas price
func (TestEconomicsData) ComputeGasLimit ¶ added in v1.1.15
func (ed TestEconomicsData) ComputeGasLimit(tx process.TransactionWithFeeHandler) uint64
ComputeGasLimit returns the gas limit need by the provided transaction in order to be executed
func (TestEconomicsData) ComputeGasUsedAndFeeBasedOnRefundValue ¶ added in v1.1.18
func (ed TestEconomicsData) ComputeGasUsedAndFeeBasedOnRefundValue(tx process.TransactionWithFeeHandler, refundValue *big.Int) (uint64, *big.Int)
ComputeGasUsedAndFeeBasedOnRefundValue will compute gas used value and transaction fee using refund value from a SCR
func (TestEconomicsData) ComputeMoveBalanceFee ¶ added in v1.1.15
func (ed TestEconomicsData) ComputeMoveBalanceFee(tx process.TransactionWithFeeHandler) *big.Int
ComputeMoveBalanceFee computes the provided transaction's fee
func (TestEconomicsData) ComputeTxFee ¶ added in v1.1.15
func (ed TestEconomicsData) ComputeTxFee(tx process.TransactionWithFeeHandler) *big.Int
ComputeTxFee computes the provided transaction's fee using enable from epoch approach
func (TestEconomicsData) ComputeTxFeeBasedOnGasUsed ¶ added in v1.1.18
func (ed TestEconomicsData) ComputeTxFeeBasedOnGasUsed(tx process.TransactionWithFeeHandler, gasUsed uint64) *big.Int
ComputeTxFeeBasedOnGasUsed will compute transaction fee
func (TestEconomicsData) DeveloperPercentage ¶ added in v1.1.15
func (ed TestEconomicsData) DeveloperPercentage() float64
DeveloperPercentage will return the developer percentage value
func (TestEconomicsData) EpochConfirmed ¶ added in v1.1.15
func (ed TestEconomicsData) EpochConfirmed(epoch uint32)
EpochConfirmed is called whenever a new epoch is confirmed
func (TestEconomicsData) GasPerDataByte ¶ added in v1.1.15
func (ed TestEconomicsData) GasPerDataByte() uint64
GasPerDataByte will return the gas required for a economicsData byte
func (TestEconomicsData) GasPriceForMove ¶ added in v1.1.15
func (ed TestEconomicsData) GasPriceForMove(tx process.TransactionWithFeeHandler) uint64
GasPriceForMove returns the gas price for transferring funds
func (TestEconomicsData) GasPriceForProcessing ¶ added in v1.1.15
func (ed TestEconomicsData) GasPriceForProcessing(tx process.TransactionWithFeeHandler) uint64
GasPriceForProcessing computes the price for the gas in addition to balance movement and data
func (TestEconomicsData) GasPriceModifier ¶ added in v1.1.15
func (ed TestEconomicsData) GasPriceModifier() float64
GasPriceModifier will return the gas price modifier
func (TestEconomicsData) GenesisTotalSupply ¶ added in v1.1.15
GenesisTotalSupply will return the genesis total supply
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) IsInterfaceNil ¶ added in v1.1.15
func (ed TestEconomicsData) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (TestEconomicsData) LeaderPercentage ¶ added in v1.1.15
func (ed TestEconomicsData) LeaderPercentage() float64
LeaderPercentage will return leader reward percentage
func (TestEconomicsData) MaxGasLimitPerBlock ¶ added in v1.1.15
MaxGasLimitPerBlock will return maximum gas limit allowed per block
func (TestEconomicsData) MaxInflationRate ¶ added in v1.1.15
MaxInflationRate will return the maximum inflation rate
func (TestEconomicsData) MinGasLimit ¶ added in v1.1.15
func (ed TestEconomicsData) MinGasLimit() uint64
MinGasLimit will return min gas limit
func (TestEconomicsData) MinGasPrice ¶ added in v1.1.15
func (ed TestEconomicsData) MinGasPrice() uint64
MinGasPrice will return min gas price
func (TestEconomicsData) MinGasPriceForProcessing ¶ added in v1.1.15
func (ed TestEconomicsData) MinGasPriceForProcessing() uint64
MinGasPriceForProcessing returns the minimum allowed gas price for processing
func (TestEconomicsData) MinInflationRate ¶ added in v1.1.15
func (ed TestEconomicsData) MinInflationRate() float64
MinInflationRate will return the minimum inflation rate
func (TestEconomicsData) ProtocolSustainabilityAddress ¶ added in v1.1.15
func (ed TestEconomicsData) ProtocolSustainabilityAddress() string
ProtocolSustainabilityAddress will return the protocol sustainability address
func (TestEconomicsData) ProtocolSustainabilityPercentage ¶ added in v1.1.15
func (ed TestEconomicsData) ProtocolSustainabilityPercentage() float64
ProtocolSustainabilityPercentage will return the protocol sustainability percentage value
func (TestEconomicsData) RewardsTopUpFactor ¶ added in v1.1.15
func (ed TestEconomicsData) RewardsTopUpFactor() float64
RewardsTopUpFactor returns the rewards top-up factor
func (TestEconomicsData) RewardsTopUpGradientPoint ¶ added in v1.1.15
RewardsTopUpGradientPoint returns the rewards top-up gradient point
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) SetMaxInflationRate ¶ added in v1.1.15
func (ted *TestEconomicsData) SetMaxInflationRate(maximumInflation float64)
SetMaxInflationRate sets the maximum inflation rate for a transaction to be accepted
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
func (TestEconomicsData) SplitTxGasInCategories ¶ added in v1.1.15
func (ed TestEconomicsData) SplitTxGasInCategories(tx process.TransactionWithFeeHandler) (gasLimitMove, gasLimitProcess uint64)
SplitTxGasInCategories returns the gas split per categories