Documentation ¶
Index ¶
- type EconomicsData
- func (ed *EconomicsData) AuctionEnableNonce() uint64
- func (ed *EconomicsData) BleedPercentagePerRound() float64
- func (ed *EconomicsData) CheckValidityTxValues(tx process.TransactionWithFeeHandler) error
- func (ed *EconomicsData) ComputeFee(tx process.TransactionWithFeeHandler) *big.Int
- func (ed *EconomicsData) ComputeGasLimit(tx process.TransactionWithFeeHandler) uint64
- func (ed *EconomicsData) DeveloperPercentage() float64
- func (ed *EconomicsData) GenesisNodePrice() *big.Int
- func (ed *EconomicsData) GenesisTotalSupply() *big.Int
- func (ed *EconomicsData) IsInterfaceNil() bool
- func (ed *EconomicsData) LeaderPercentage() float64
- func (ed *EconomicsData) MaxGasLimitPerBlock() uint64
- func (ed *EconomicsData) MaxInflationRate() float64
- func (ed *EconomicsData) MaximumPercentageToBleed() float64
- func (ed *EconomicsData) MinGasPrice() uint64
- func (ed *EconomicsData) MinInflationRate() float64
- func (ed *EconomicsData) MinStepValue() *big.Int
- func (ed *EconomicsData) NumNodes() uint32
- func (ed *EconomicsData) NumRoundsWithoutBleed() uint64
- func (ed *EconomicsData) RatingsData() *RatingsData
- func (ed *EconomicsData) StakeEnableNonce() uint64
- func (ed *EconomicsData) TotalSupply() *big.Int
- func (ed *EconomicsData) UnBondPeriod() uint64
- func (ed *EconomicsData) UnJailValue() *big.Int
- type RatingsData
- func (rd *RatingsData) MaxRating() uint32
- func (rd *RatingsData) MinRating() uint32
- func (rd *RatingsData) ProposerDecreaseRatingStep() uint32
- func (rd *RatingsData) ProposerIncreaseRatingStep() uint32
- func (rd *RatingsData) SelectionChances() []process.SelectionChance
- func (rd *RatingsData) StartRating() uint32
- func (rd *RatingsData) ValidatorDecreaseRatingStep() uint32
- func (rd *RatingsData) ValidatorIncreaseRatingStep() uint32
- type SelectionChance
- 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)
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 ¶
func (ed *EconomicsData) ComputeFee(tx process.TransactionWithFeeHandler) *big.Int
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) RatingsData ¶
func (ed *EconomicsData) RatingsData() *RatingsData
RatingsData will return the ratingsDataObject
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 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) SelectionChances ¶
func (rd *RatingsData) SelectionChances() []process.SelectionChance
SelectionChances will return the array of selectionChances and thresholds
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 SelectionChance ¶
Selection data contains the threshold and chancePercent to be selected
func (*SelectionChance) GetChancePercent ¶
func (sc *SelectionChance) GetChancePercent() uint32
GetChancePercent returns the chances percentage to be selected
func (*SelectionChance) GetMaxThreshold ¶
func (sc *SelectionChance) GetMaxThreshold() uint32
GetMaxThreshold returns the maximum threshold for which a chancePercent is active
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