Documentation ¶
Index ¶
- Constants
- Variables
- func BuildBlockDistributionKey() []byte
- func BuildCommunityFeePoolKey() []byte
- func BuildDelegatorEarningStartInfoKey(validatorAddr btypes.Address, delegatorAddress btypes.Address) []byte
- func BuildDelegatorPeriodIncomeKey(validatorAddr, delegatorAddress btypes.Address, height uint64) []byte
- func BuildDelegatorPeriodIncomePrefixKey(height uint64) []byte
- func BuildLastProposerKey() []byte
- func BuildQueryDelegatorIncomeInfoCustomQueryPath(delegator, owner btypes.Address) string
- func BuildQueryValidatorPeriodInfoCustomQueryPath(owner btypes.Address) string
- func BuildValidatorCurrentPeriodSummaryKey(validatorAddr btypes.Address) []byte
- func BuildValidatorEcoFeePoolKey(validatorAddr btypes.Address) []byte
- func BuildValidatorHistoryPeriodSummaryKey(validatorAddr btypes.Address, period uint64) []byte
- func BuildValidatorHistoryPeriodSummaryPrefixKey(validatorAddr btypes.Address) []byte
- func GetDelegatorEarningStartInfoAddr(key []byte) (valAddr, deleAddr btypes.Address)
- func GetDelegatorEarningsStartInfoPrefixKey() []byte
- func GetDelegatorPeriodIncomeHeightAddr(key []byte) (valAddr btypes.Address, deleAddr btypes.Address, height uint64)
- func GetDelegatorPeriodIncomePrefixKey() []byte
- func GetValidatorCurrentPeriodSummaryAddr(key []byte) btypes.Address
- func GetValidatorCurrentPeriodSummaryPrefixKey() []byte
- func GetValidatorEcoFeePoolPrefixKey() []byte
- func GetValidatorEcoPoolAddress(key []byte) btypes.Address
- func GetValidatorHistoryPeriodSummaryAddrPeriod(key []byte) (valAddr btypes.Address, period uint64)
- func GetValidatorHistoryPeriodSummaryPrefixKey() []byte
- func RegisterCodec(cdc *amino.Codec)
- func ValidateGenesis(_ GenesisState) error
- type DelegatorEarningStartState
- type DelegatorEarningsStartInfo
- type DelegatorIncomeHeightState
- type GenesisState
- type Params
- type ValidatorCurrentPeriodState
- type ValidatorCurrentPeriodSummary
- type ValidatorEcoFeePool
- type ValidatorEcoFeePoolState
- type ValidatorHistoryPeriodState
Constants ¶
View Source
const ( AddrLen = 20 MapperName = "distribution" Distribution = "distribution" ValidatorPeriodInfo = "validatorPeriodInfo" DelegatorIncomeInfo = "delegatorIncomeInfo" )
Variables ¶
View Source
var ( EventTypeProposerReward = "proposer_reward" EventTypeDelegatorRewards = "delegator_rewards" EventTypeCommunity = "community" EventTypeCommission = "commission" EventTypeDelegatorReward = "delegator_reward" EventTypeDelegate = "delegate" AttributeKeyTokens = "tokens" AttributeKeyValidator = "validator" AttributeKeyDelegator = "delegator" )
Distribution module event types
View Source
var ( ParamSpace = "distribution" // keys for distribution p KeyProposerRewardRate = []byte("proposer_reward_rate") KeyCommunityRewardRate = []byte("community_reward_rate") KeyDelegatorsIncomePeriodHeight = []byte("delegator_income_period_height") KeyGasPerUnitCost = []byte("gas_per_unit_cost") )
View Source
var Cdc = baseabci.MakeQBaseCodec()
Functions ¶
func BuildBlockDistributionKey ¶
func BuildBlockDistributionKey() []byte
func BuildCommunityFeePoolKey ¶
func BuildCommunityFeePoolKey() []byte
func BuildLastProposerKey ¶
func BuildLastProposerKey() []byte
func GetDelegatorEarningsStartInfoPrefixKey ¶
func GetDelegatorEarningsStartInfoPrefixKey() []byte
func GetDelegatorPeriodIncomePrefixKey ¶
func GetDelegatorPeriodIncomePrefixKey() []byte
func GetValidatorCurrentPeriodSummaryPrefixKey ¶
func GetValidatorCurrentPeriodSummaryPrefixKey() []byte
func GetValidatorEcoFeePoolPrefixKey ¶
func GetValidatorEcoFeePoolPrefixKey() []byte
func GetValidatorHistoryPeriodSummaryPrefixKey ¶
func GetValidatorHistoryPeriodSummaryPrefixKey() []byte
func RegisterCodec ¶
func RegisterCodec(cdc *amino.Codec)
func ValidateGenesis ¶
func ValidateGenesis(_ GenesisState) error
Types ¶
type DelegatorEarningStartState ¶
type DelegatorEarningStartState struct { ValidatorPubKey crypto.PubKey `json:"validator_pub_key"` DeleAddress btypes.Address `json:"delegator_address"` DelegatorEarningsStartInfo DelegatorEarningsStartInfo `json:"earning_start_info"` }
type DelegatorEarningsStartInfo ¶
type DelegatorEarningsStartInfo struct { PreviousPeriod uint64 `json:"previous_period"` BondToken uint64 `json:"bond_token"` CurrentStartingHeight uint64 `json:"earns_starting_height"` FirstDelegateHeight uint64 `json:"first_delegate_height"` HistoricalRewardFees btypes.BigInt `json:"historical_rewards"` LastIncomeCalHeight uint64 `json:"last_income_calHeight"` LastIncomeCalFees btypes.BigInt `json:"last_income_calFees"` }
DelegatorEarningsStartInfo delegator计算收益信息
type GenesisState ¶
type GenesisState struct { CommunityFeePool btypes.BigInt `json:"community_fee_pool"` LastBlockProposer btypes.Address `json:"last_block_proposer"` PreDistributionQOSAmount btypes.BigInt `json:"pre_distribute_amount"` ValidatorHistoryPeriods []ValidatorHistoryPeriodState `json:"validators_history_period"` ValidatorCurrentPeriods []ValidatorCurrentPeriodState `json:"validators_current_period"` DelegatorEarningInfos []DelegatorEarningStartState `json:"delegator_earning_info"` DelegatorIncomeHeights []DelegatorIncomeHeightState `json:"delegator_income_height"` ValidatorEcoFeePools []ValidatorEcoFeePoolState `json:"validator_eco_fee_pools"` Params Params `json:"params"` }
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
func NewGenesisState ¶
func NewGenesisState(communityFeePool btypes.BigInt, lastBlockProposer btypes.Address, preDistributionQOSAmount btypes.BigInt, validatorHistoryPeriods []ValidatorHistoryPeriodState, validatorCurrentPeriods []ValidatorCurrentPeriodState, delegatorEarningInfos []DelegatorEarningStartState, delegatorIncomeHeights []DelegatorIncomeHeightState, validatorEcoFeePools []ValidatorEcoFeePoolState, params Params) GenesisState
type Params ¶
type Params struct { ProposerRewardRate qtypes.Fraction `json:"proposer_reward_rate"` CommunityRewardRate qtypes.Fraction `json:"community_reward_rate"` DelegatorsIncomePeriodHeight uint64 `json:"delegator_income_period_height"` GasPerUnitCost uint64 `json:"gas_per_unit_cost"` // how much gas = 1 QOS }
func DefaultParams ¶
func DefaultParams() Params
func (*Params) GetParamSpace ¶
func (*Params) KeyValuePairs ¶
func (p *Params) KeyValuePairs() qtypes.KeyValuePairs
type ValidatorCurrentPeriodState ¶
type ValidatorCurrentPeriodState struct { ValidatorPubKey crypto.PubKey `json:"validator_pub_key"` CurrentPeriodSummary ValidatorCurrentPeriodSummary `json:"current_period_summary"` }
type ValidatorCurrentPeriodSummary ¶
type ValidatorCurrentPeriodSummary struct { Fees btypes.BigInt `json:"fees"` Period uint64 `json:"period"` }
ValidatorCurrentPeriodSummary validator当前周期收益信息
type ValidatorEcoFeePool ¶
type ValidatorEcoFeePool struct { ProposerTotalRewardFee btypes.BigInt `json:"proposerTotalRewardFee"` //validator 通过proposer获取的总收益 CommissionTotalRewardFee btypes.BigInt `json:"commissionTotalRewardFee"` //validator 通过投票获取的佣金总收益 PreDistributeTotalRewardFee btypes.BigInt `json:"preDistributeTotalRewardFee"` //validator 通过投票获取的待分配金额总收益 PreDistributeRemainTotalFee btypes.BigInt `json:"preDistributeRemainTotalFee"` //validator 待分配金额中剩余的收益 }
ValidatorEcoFeePool validator收益信息
func NewValidatorEcoFeePool ¶
func NewValidatorEcoFeePool() ValidatorEcoFeePool
type ValidatorEcoFeePoolState ¶
type ValidatorEcoFeePoolState struct { ValidatorAddress btypes.Address `json:"validator_address"` EcoFeePool ValidatorEcoFeePool `json:"eco_fee_pool"` }
Click to show internal directories.
Click to hide internal directories.