types

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

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")
)

Functions

func BuildBlockDistributionKey

func BuildBlockDistributionKey() []byte

func BuildCommunityFeePoolKey

func BuildCommunityFeePoolKey() []byte

func BuildDelegatorEarningStartInfoKey

func BuildDelegatorEarningStartInfoKey(validatorAddr btypes.Address, delegatorAddress btypes.Address) []byte

func BuildDelegatorPeriodIncomeKey

func BuildDelegatorPeriodIncomeKey(validatorAddr, delegatorAddress btypes.Address, height uint64) []byte

func BuildDelegatorPeriodIncomePrefixKey

func BuildDelegatorPeriodIncomePrefixKey(height uint64) []byte

func BuildLastProposerKey

func BuildLastProposerKey() []byte

func BuildQueryDelegatorIncomeInfoCustomQueryPath

func BuildQueryDelegatorIncomeInfoCustomQueryPath(delegator, owner btypes.Address) string

func BuildQueryValidatorPeriodInfoCustomQueryPath

func BuildQueryValidatorPeriodInfoCustomQueryPath(owner btypes.Address) string

func BuildValidatorCurrentPeriodSummaryKey

func BuildValidatorCurrentPeriodSummaryKey(validatorAddr btypes.Address) []byte

func BuildValidatorEcoFeePoolKey

func BuildValidatorEcoFeePoolKey(validatorAddr btypes.Address) []byte

func BuildValidatorHistoryPeriodSummaryKey

func BuildValidatorHistoryPeriodSummaryKey(validatorAddr btypes.Address, period uint64) []byte

func BuildValidatorHistoryPeriodSummaryPrefixKey

func BuildValidatorHistoryPeriodSummaryPrefixKey(validatorAddr btypes.Address) []byte

func GetDelegatorEarningStartInfoAddr

func GetDelegatorEarningStartInfoAddr(key []byte) (valAddr, deleAddr btypes.Address)

func GetDelegatorEarningsStartInfoPrefixKey

func GetDelegatorEarningsStartInfoPrefixKey() []byte

func GetDelegatorPeriodIncomeHeightAddr

func GetDelegatorPeriodIncomeHeightAddr(key []byte) (valAddr btypes.Address, deleAddr btypes.Address, height uint64)

func GetDelegatorPeriodIncomePrefixKey

func GetDelegatorPeriodIncomePrefixKey() []byte

func GetValidatorCurrentPeriodSummaryAddr

func GetValidatorCurrentPeriodSummaryAddr(key []byte) btypes.Address

func GetValidatorCurrentPeriodSummaryPrefixKey

func GetValidatorCurrentPeriodSummaryPrefixKey() []byte

func GetValidatorEcoFeePoolPrefixKey

func GetValidatorEcoFeePoolPrefixKey() []byte

func GetValidatorEcoPoolAddress

func GetValidatorEcoPoolAddress(key []byte) btypes.Address

func GetValidatorHistoryPeriodSummaryAddrPeriod

func GetValidatorHistoryPeriodSummaryAddrPeriod(key []byte) (valAddr btypes.Address, period uint64)

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 DelegatorIncomeHeightState

type DelegatorIncomeHeightState struct {
	ValidatorPubKey crypto.PubKey  `json:"validator_pub_key"`
	DeleAddress     btypes.Address `json:"delegator_address"`
	Height          uint64         `json:"height"`
}

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 (p *Params) GetParamSpace() string

func (*Params) KeyValuePairs

func (p *Params) KeyValuePairs() qtypes.KeyValuePairs

func (*Params) Validate

func (p *Params) Validate(key string, value string) (interface{}, btypes.Error)

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"`
}

type ValidatorHistoryPeriodState

type ValidatorHistoryPeriodState struct {
	ValidatorPubKey crypto.PubKey   `json:"validator_pubkey"`
	Period          uint64          `json:"period"`
	Summary         qtypes.Fraction `json:"summary"`
}

Jump to

Keyboard shortcuts

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