Documentation ¶
Index ¶
- Variables
- func CanWithdrawInvariant(k Keeper) sdk.Invariant
- func DoAddShares(t *testing.T, ctx sdk.Context, sk staking.Keeper, delAddr sdk.AccAddress, ...)
- func DoAddSharesWithError(t *testing.T, ctx sdk.Context, sk staking.Keeper, delAddr sdk.AccAddress, ...)
- func DoBindProxy(t *testing.T, ctx sdk.Context, sk staking.Keeper, delAddr sdk.AccAddress, ...)
- func DoCreateValidator(t *testing.T, ctx sdk.Context, sk staking.Keeper, valAddr sdk.ValAddress, ...)
- func DoDeposit(t *testing.T, ctx sdk.Context, sk staking.Keeper, delAddr sdk.AccAddress, ...)
- func DoDepositWithError(t *testing.T, ctx sdk.Context, sk staking.Keeper, delAddr sdk.AccAddress, ...)
- func DoDestroyValidator(t *testing.T, ctx sdk.Context, sk staking.Keeper, delAddr sdk.AccAddress)
- func DoEditValidator(t *testing.T, ctx sdk.Context, sk staking.Keeper, valAddr sdk.ValAddress, ...)
- func DoRegProxy(t *testing.T, ctx sdk.Context, sk staking.Keeper, delAddr sdk.AccAddress, ...)
- func DoUnBindProxy(t *testing.T, ctx sdk.Context, sk staking.Keeper, delAddr sdk.AccAddress)
- func DoWithdraw(t *testing.T, ctx sdk.Context, sk staking.Keeper, delAddr sdk.AccAddress, ...)
- func GetQueriedDelegationRewards(t *testing.T, ctx sdk.Context, querier sdk.Querier, ...) (rewards sdk.DecCoins)
- func GetQueriedDelegationTotalRewards(t *testing.T, ctx sdk.Context, querier sdk.Querier, ...) types.QueryDelegatorTotalRewardsResponse
- func GetTestAddrs() ([]sdk.ValAddress, []crypto.PubKey, []sdk.ConsAddress)
- func HandleChangeDistributionTypeProposal(ctx sdk.Context, k Keeper, p types.ChangeDistributionTypeProposal) error
- func HandleCommunityPoolSpendProposal(ctx sdk.Context, k Keeper, p types.CommunityPoolSpendProposal) error
- func HandleRewardTruncatePrecisionProposal(ctx sdk.Context, k Keeper, p types.RewardTruncatePrecisionProposal) error
- func HandleWithdrawRewardEnabledProposal(ctx sdk.Context, k Keeper, p types.WithdrawRewardEnabledProposal) error
- func MakeTestCodec() *codec.Codec
- func ModuleAccountInvariant(k Keeper) sdk.Invariant
- func NewQuerier(k Keeper) sdk.Querier
- func NewTestSysCoin(i int64, precison int64) sdk.SysCoin
- func NewTestSysCoins(i int64, precison int64) sdk.SysCoins
- func NonNegativeCommissionsInvariant(k Keeper) sdk.Invariant
- func ReInit()
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- type Hooks
- func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddrs []sdk.ValAddress)
- func (h Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress)
- func (h Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress)
- func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
- func (h Hooks) AfterValidatorDestroyed(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
- func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress)
- func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddrs []sdk.ValAddress)
- func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)
- func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddrs []sdk.ValAddress)
- func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress)
- func (h Hooks) CheckEnabled(ctx sdk.Context) bool
- type Keeper
- func CreateTestInputAdvanced(t *testing.T, isCheckTx bool, initPower int64, communityTax sdk.Dec) (sdk.Context, auth.AccountKeeper, bank.Keeper, Keeper, staking.Keeper, ...)
- func CreateTestInputDefault(t *testing.T, isCheckTx bool, initPower int64) (sdk.Context, auth.AccountKeeper, Keeper, staking.Keeper, types.SupplyKeeper)
- func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, paramSpace params.Subspace, ...) Keeper
- func (k Keeper) AfterDepositPeriodPassed(_ sdk.Context, _ govTypes.Proposal)
- func (k Keeper) AfterSubmitProposalHandler(_ sdk.Context, _ govTypes.Proposal)
- func (k Keeper) AllocateTokens(ctx sdk.Context, totalPreviousPower int64, previousProposer sdk.ConsAddress, ...)
- func (k Keeper) AllocateTokensToValidator(ctx sdk.Context, val exported.ValidatorI, tokens sdk.SysCoins)
- func (k Keeper) CheckDistributionProposalValid(ctx sdk.Context) bool
- func (k Keeper) CheckInitExistedValidatorFlag(ctx sdk.Context) bool
- func (k Keeper) CheckMsgSubmitProposal(ctx sdk.Context, msg govTypes.MsgSubmitProposal) sdk.Error
- func (k Keeper) DeleteAllValidatorHistoricalRewards(ctx sdk.Context)
- func (k Keeper) DeleteDelegatorStartingInfo(ctx sdk.Context, val sdk.ValAddress, del sdk.AccAddress)
- func (k Keeper) DeleteValidatorCurrentRewards(ctx sdk.Context, val sdk.ValAddress)
- func (k Keeper) DeleteValidatorHistoricalReward(ctx sdk.Context, val sdk.ValAddress, period uint64)
- func (k Keeper) DeleteValidatorHistoricalRewards(ctx sdk.Context, val sdk.ValAddress)
- func (k Keeper) DeleteValidatorOutstandingRewards(ctx sdk.Context, val sdk.ValAddress)
- func (k Keeper) GetCommunityTax(ctx sdk.Context) (percent sdk.Dec)
- func (k Keeper) GetDelegatorStartingInfo(ctx sdk.Context, val sdk.ValAddress, del sdk.AccAddress) (period types.DelegatorStartingInfo)
- func (k Keeper) GetDelegatorWithdrawAddr(ctx sdk.Context, delAddr sdk.AccAddress) sdk.AccAddress
- func (k Keeper) GetDistributionAccount(ctx sdk.Context) exported.ModuleAccountI
- func (k Keeper) GetDistributionType(ctx sdk.Context) (distrType uint32)
- func (k Keeper) GetFeePool(ctx sdk.Context) (feePool types.FeePool)
- func (k Keeper) GetFeePoolCommunityCoins(ctx sdk.Context) sdk.SysCoins
- func (keeper Keeper) GetMaxDepositPeriod(ctx sdk.Context, content govTypes.Content) time.Duration
- func (keeper Keeper) GetMinDeposit(ctx sdk.Context, content govTypes.Content) (minDeposit sdk.SysCoins)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetParamsForInitGenesis(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetPreviousProposerConsAddr(ctx sdk.Context) (consAddr sdk.ConsAddress)
- func (k Keeper) GetRewardTruncatePrecision(ctx sdk.Context) (precision int64)
- func (k Keeper) GetTotalRewards(ctx sdk.Context) (totalRewards sdk.DecCoins)
- func (k Keeper) GetValidatorAccumulatedCommission(ctx sdk.Context, val sdk.ValAddress) (commission types.ValidatorAccumulatedCommission)
- func (k Keeper) GetValidatorCurrentRewards(ctx sdk.Context, val sdk.ValAddress) (rewards types.ValidatorCurrentRewards)
- func (k Keeper) GetValidatorHistoricalReferenceCount(ctx sdk.Context) (count uint64)
- func (k Keeper) GetValidatorHistoricalRewards(ctx sdk.Context, val sdk.ValAddress, period uint64) (rewards types.ValidatorHistoricalRewards)
- func (k Keeper) GetValidatorOutstandingRewards(ctx sdk.Context, val sdk.ValAddress) (rewards types.ValidatorOutstandingRewards)
- func (keeper Keeper) GetVotingPeriod(ctx sdk.Context, content govTypes.Content) time.Duration
- func (k Keeper) GetWithdrawAddrEnabled(ctx sdk.Context) (enabled bool)
- func (k Keeper) GetWithdrawRewardEnabled(ctx sdk.Context) (enabled bool)
- func (k Keeper) HasDelegatorStartingInfo(ctx sdk.Context, val sdk.ValAddress, del sdk.AccAddress) bool
- func (k Keeper) HasValidatorOutstandingRewards(ctx sdk.Context, val sdk.ValAddress) bool
- func (k Keeper) Hooks() Hooks
- func (k Keeper) IterateDelegatorStartingInfos(ctx sdk.Context, ...)
- func (k Keeper) IterateDelegatorWithdrawAddrs(ctx sdk.Context, ...)
- func (k Keeper) IterateValidatorAccumulatedCommissions(ctx sdk.Context, ...)
- func (k Keeper) IterateValidatorCurrentRewards(ctx sdk.Context, ...)
- func (k Keeper) IterateValidatorHistoricalRewards(ctx sdk.Context, ...)
- func (k Keeper) IterateValidatorOutstandingRewards(ctx sdk.Context, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) RejectedHandler(_ sdk.Context, _ govTypes.Content)
- func (k Keeper) SetCommunityTax(ctx sdk.Context, percent sdk.Dec)
- func (k Keeper) SetDelegatorStartingInfo(ctx sdk.Context, val sdk.ValAddress, del sdk.AccAddress, ...)
- func (k Keeper) SetDelegatorWithdrawAddr(ctx sdk.Context, delAddr, withdrawAddr sdk.AccAddress)
- func (k Keeper) SetDistributionType(ctx sdk.Context, distrType uint32)
- func (k Keeper) SetFeePool(ctx sdk.Context, feePool types.FeePool)
- func (k *Keeper) SetGovKeeper(gk types.GovKeeper)
- func (k Keeper) SetInitExistedValidatorFlag(ctx sdk.Context, init bool)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetParamsForInitGenesis(ctx sdk.Context, params types.Params)
- func (k Keeper) SetPreviousProposerConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress)
- func (k Keeper) SetRewardTruncatePrecision(ctx sdk.Context, precision int64)
- func (k Keeper) SetValidatorAccumulatedCommission(ctx sdk.Context, val sdk.ValAddress, ...)
- func (k Keeper) SetValidatorCurrentRewards(ctx sdk.Context, val sdk.ValAddress, rewards types.ValidatorCurrentRewards)
- func (k Keeper) SetValidatorHistoricalRewards(ctx sdk.Context, val sdk.ValAddress, period uint64, ...)
- func (k Keeper) SetValidatorOutstandingRewards(ctx sdk.Context, val sdk.ValAddress, rewards types.ValidatorOutstandingRewards)
- func (k Keeper) SetWithdrawAddr(ctx sdk.Context, delegatorAddr sdk.AccAddress, withdrawAddr sdk.AccAddress) error
- func (k Keeper) SetWithdrawAddrEnabled(ctx sdk.Context, enabled bool)
- func (k Keeper) SetWithdrawRewardEnabled(ctx sdk.Context, enabled bool)
- func (k Keeper) VoteHandler(_ sdk.Context, _ govTypes.Proposal, _ govTypes.Vote) (string, sdk.Error)
- func (k Keeper) WithdrawDelegationAllRewards(ctx sdk.Context, delAddr sdk.AccAddress) error
- func (k Keeper) WithdrawDelegationRewards(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, error)
- func (k Keeper) WithdrawValidatorCommission(ctx sdk.Context, valAddr sdk.ValAddress) (sdk.Coins, error)
Constants ¶
This section is empty.
Variables ¶
var ( // TODO move to common testing package for all modules // test addresses TestAddrs = []sdk.AccAddress{ delAddr1, delAddr2, delAddr3, delAddr4, proxyAddr1, proxyAddr2, proxyAddr3, proxyAddr4, valAccAddr1, valAccAddr2, valAccAddr3, valAccAddr4, } TestDelAddrs = []sdk.AccAddress{delAddr1, delAddr2, delAddr3, delAddr4} TestProxyAddrs = []sdk.AccAddress{proxyAddr1, proxyAddr2, proxyAddr3, proxyAddr4} TestValAddrs = []sdk.ValAddress{valOpAddr1, valOpAddr2, valOpAddr3, valOpAddr4} TestConsAddrs = []sdk.ConsAddress{valConsAddr1, valConsAddr2, valConsAddr3, valConsAddr4} TestValAccAddrs = []sdk.AccAddress{valAccAddr1, valAccAddr2, valAccAddr3, valAccAddr4} )
nolint: deadcode unused
Functions ¶
func CanWithdrawInvariant ¶
CanWithdrawInvariant checks that current commission can be completely withdrawn
func DoAddShares ¶
func DoAddShares(t *testing.T, ctx sdk.Context, sk staking.Keeper, delAddr sdk.AccAddress, valAddrs []sdk.ValAddress)
func DoAddSharesWithError ¶
func DoBindProxy ¶
func DoBindProxy(t *testing.T, ctx sdk.Context, sk staking.Keeper, delAddr sdk.AccAddress, proxyAddr sdk.AccAddress)
func DoCreateValidator ¶
func DoDepositWithError ¶
func DoDestroyValidator ¶
func DoEditValidator ¶
func DoRegProxy ¶
func DoUnBindProxy ¶
func DoWithdraw ¶
func GetQueriedDelegationTotalRewards ¶
func GetQueriedDelegationTotalRewards(t *testing.T, ctx sdk.Context, querier sdk.Querier, delegatorAddr sdk.AccAddress) types.QueryDelegatorTotalRewardsResponse
func GetTestAddrs ¶
func GetTestAddrs() ([]sdk.ValAddress, []crypto.PubKey, []sdk.ConsAddress)
GetTestAddrs returns valOpAddrs, valConsPks, valConsAddrs for test
func HandleChangeDistributionTypeProposal ¶
func HandleChangeDistributionTypeProposal(ctx sdk.Context, k Keeper, p types.ChangeDistributionTypeProposal) error
HandleChangeDistributionTypeProposal is a handler for executing a passed change distribution type proposal
func HandleCommunityPoolSpendProposal ¶
func HandleCommunityPoolSpendProposal(ctx sdk.Context, k Keeper, p types.CommunityPoolSpendProposal) error
HandleCommunityPoolSpendProposal is a handler for executing a passed community spend proposal
func HandleRewardTruncatePrecisionProposal ¶
func HandleRewardTruncatePrecisionProposal(ctx sdk.Context, k Keeper, p types.RewardTruncatePrecisionProposal) error
HandleRewardTruncatePrecisionProposal is a handler for executing a passed reward truncate precision proposal
func HandleWithdrawRewardEnabledProposal ¶
func HandleWithdrawRewardEnabledProposal(ctx sdk.Context, k Keeper, p types.WithdrawRewardEnabledProposal) error
HandleWithdrawRewardEnabledProposal is a handler for executing a passed set withdraw reward enabled proposal
func MakeTestCodec ¶
MakeTestCodec creates a codec used only for testing
func ModuleAccountInvariant ¶
ModuleAccountInvariant checks that the coins held by the distr ModuleAccount is consistent with the sum of accumulated commissions
func NewQuerier ¶
NewQuerier creates a querier for distribution REST endpoints
func NewTestSysCoin ¶
NewTestSysCoin returns one dec coin
func NewTestSysCoins ¶
NewTestSysCoins returns dec coins
func NonNegativeCommissionsInvariant ¶
NonNegativeCommissionsInvariant checks that accumulated commissions unwithdrawned fees are never negative
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers all distribution invariants
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks is struct of keepers from other module
func (Hooks) AfterDelegationModified ¶
func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddrs []sdk.ValAddress)
create new delegation period record
func (Hooks) AfterValidatorBeginUnbonding ¶
func (h Hooks) AfterValidatorBeginUnbonding(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress)
func (Hooks) AfterValidatorBonded ¶
func (h Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress)
func (Hooks) AfterValidatorCreated ¶
func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
AfterValidatorCreated initializes validator distribution record
func (Hooks) AfterValidatorDestroyed ¶
func (h Hooks) AfterValidatorDestroyed(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress)
AfterValidatorDestroyed nothing to do
func (Hooks) AfterValidatorRemoved ¶
func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress)
AfterValidatorRemoved cleans up for after validator is removed
func (Hooks) BeforeDelegationCreated ¶
func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddrs []sdk.ValAddress)
increment period
func (Hooks) BeforeDelegationRemoved ¶
func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)
func (Hooks) BeforeDelegationSharesModified ¶
func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddrs []sdk.ValAddress)
withdraw delegation rewards (which also increments period)
func (Hooks) BeforeValidatorModified ¶
func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress)
nolint - unused hooks
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the distribution store
func CreateTestInputAdvanced ¶
func CreateTestInputAdvanced(t *testing.T, isCheckTx bool, initPower int64, communityTax sdk.Dec) ( sdk.Context, auth.AccountKeeper, bank.Keeper, Keeper, staking.Keeper, params.Keeper, types.SupplyKeeper)
CreateTestInputAdvanced hogpodge of all sorts of input required for testing
func CreateTestInputDefault ¶
func CreateTestInputDefault(t *testing.T, isCheckTx bool, initPower int64) ( sdk.Context, auth.AccountKeeper, Keeper, staking.Keeper, types.SupplyKeeper)
CreateTestInputDefault test input with default values
func NewKeeper ¶
func NewKeeper( cdc *codec.Codec, key sdk.StoreKey, paramSpace params.Subspace, sk types.StakingKeeper, supplyKeeper types.SupplyKeeper, feeCollectorName string, blacklistedAddrs map[string]bool, ) Keeper
NewKeeper creates a new distribution Keeper instance
func (Keeper) AfterDepositPeriodPassed ¶
func (Keeper) AfterSubmitProposalHandler ¶
nolint
func (Keeper) AllocateTokens ¶
func (k Keeper) AllocateTokens(ctx sdk.Context, totalPreviousPower int64, previousProposer sdk.ConsAddress, previousVotes []abci.VoteInfo)
AllocateTokens allocates fees from fee_collector 1. 25% rewards to validators, equally. 2. 75% rewards to validators and candidates, by shares' weight
func (Keeper) AllocateTokensToValidator ¶
func (k Keeper) AllocateTokensToValidator(ctx sdk.Context, val exported.ValidatorI, tokens sdk.SysCoins)
AllocateTokensToValidator allocate tokens to a particular validator, splitting according to commissions
func (Keeper) CheckDistributionProposalValid ¶
func (Keeper) CheckInitExistedValidatorFlag ¶
CheckInitExistedValidatorFlag check init existed validator for distribution proposal flag
func (Keeper) CheckMsgSubmitProposal ¶
CheckMsgSubmitProposal validates MsgSubmitProposal
func (Keeper) DeleteAllValidatorHistoricalRewards ¶
delete all historical rewards
func (Keeper) DeleteDelegatorStartingInfo ¶
func (k Keeper) DeleteDelegatorStartingInfo(ctx sdk.Context, val sdk.ValAddress, del sdk.AccAddress)
delete the starting info associated with a delegator
func (Keeper) DeleteValidatorCurrentRewards ¶
func (k Keeper) DeleteValidatorCurrentRewards(ctx sdk.Context, val sdk.ValAddress)
delete current rewards for a validator
func (Keeper) DeleteValidatorHistoricalReward ¶
delete a historical reward
func (Keeper) DeleteValidatorHistoricalRewards ¶
func (k Keeper) DeleteValidatorHistoricalRewards(ctx sdk.Context, val sdk.ValAddress)
delete historical rewards for a validator
func (Keeper) DeleteValidatorOutstandingRewards ¶
func (k Keeper) DeleteValidatorOutstandingRewards(ctx sdk.Context, val sdk.ValAddress)
delete validator outstanding rewards
func (Keeper) GetCommunityTax ¶
GetCommunityTax returns the current CommunityTax rate from the global param store nolint: errcheck
func (Keeper) GetDelegatorStartingInfo ¶
func (k Keeper) GetDelegatorStartingInfo(ctx sdk.Context, val sdk.ValAddress, del sdk.AccAddress) (period types.DelegatorStartingInfo)
get the starting info associated with a delegator
func (Keeper) GetDelegatorWithdrawAddr ¶
func (k Keeper) GetDelegatorWithdrawAddr(ctx sdk.Context, delAddr sdk.AccAddress) sdk.AccAddress
GetDelegatorWithdrawAddr returns the delegator withdraw address, defaulting to the delegator address
func (Keeper) GetDistributionAccount ¶
func (k Keeper) GetDistributionAccount(ctx sdk.Context) exported.ModuleAccountI
GetDistributionAccount returns the distribution ModuleAccount
func (Keeper) GetDistributionType ¶
func (Keeper) GetFeePool ¶
GetFeePool returns the global fee pool distribution info
func (Keeper) GetFeePoolCommunityCoins ¶
GetFeePoolCommunityCoins returns the community coins
func (Keeper) GetMaxDepositPeriod ¶
nolint
func (Keeper) GetMinDeposit ¶
func (keeper Keeper) GetMinDeposit(ctx sdk.Context, content govTypes.Content) (minDeposit sdk.SysCoins)
nolint
func (Keeper) GetParamsForInitGenesis ¶
GetParamsForInitGenesis returns the total set of distribution parameters.
func (Keeper) GetPreviousProposerConsAddr ¶
func (k Keeper) GetPreviousProposerConsAddr(ctx sdk.Context) (consAddr sdk.ConsAddress)
GetPreviousProposerConsAddr returns the proposer public key for this block
func (Keeper) GetRewardTruncatePrecision ¶
func (Keeper) GetTotalRewards ¶
GetTotalRewards returns the total amount of fee distribution rewards held in the store
func (Keeper) GetValidatorAccumulatedCommission ¶
func (k Keeper) GetValidatorAccumulatedCommission(ctx sdk.Context, val sdk.ValAddress) ( commission types.ValidatorAccumulatedCommission)
GetValidatorAccumulatedCommission returns accumulated commission for a validator
func (Keeper) GetValidatorCurrentRewards ¶
func (k Keeper) GetValidatorCurrentRewards(ctx sdk.Context, val sdk.ValAddress) (rewards types.ValidatorCurrentRewards)
get current rewards for a validator
func (Keeper) GetValidatorHistoricalReferenceCount ¶
historical reference count (used for testcases)
func (Keeper) GetValidatorHistoricalRewards ¶
func (k Keeper) GetValidatorHistoricalRewards(ctx sdk.Context, val sdk.ValAddress, period uint64) (rewards types.ValidatorHistoricalRewards)
get historical rewards for a particular period
func (Keeper) GetValidatorOutstandingRewards ¶
func (k Keeper) GetValidatorOutstandingRewards(ctx sdk.Context, val sdk.ValAddress) (rewards types.ValidatorOutstandingRewards)
get validator outstanding rewards
func (Keeper) GetVotingPeriod ¶
nolint
func (Keeper) GetWithdrawAddrEnabled ¶
GetWithdrawAddrEnabled returns the current WithdrawAddrEnabled nolint: errcheck
func (Keeper) GetWithdrawRewardEnabled ¶
func (Keeper) HasDelegatorStartingInfo ¶
func (k Keeper) HasDelegatorStartingInfo(ctx sdk.Context, val sdk.ValAddress, del sdk.AccAddress) bool
check existence of the starting info associated with a delegator
func (Keeper) HasValidatorOutstandingRewards ¶
set validator outstanding rewards
func (Keeper) IterateDelegatorStartingInfos ¶
func (k Keeper) IterateDelegatorStartingInfos(ctx sdk.Context, handler func(val sdk.ValAddress, del sdk.AccAddress, info types.DelegatorStartingInfo) (stop bool))
iterate over delegator starting infos
func (Keeper) IterateDelegatorWithdrawAddrs ¶
func (k Keeper) IterateDelegatorWithdrawAddrs(ctx sdk.Context, handler func(del sdk.AccAddress, addr sdk.AccAddress) (stop bool))
IterateDelegatorWithdrawAddrs iterates over delegator withdraw addrs
func (Keeper) IterateValidatorAccumulatedCommissions ¶
func (k Keeper) IterateValidatorAccumulatedCommissions(ctx sdk.Context, handler func(val sdk.ValAddress, commission types.ValidatorAccumulatedCommission) (stop bool))
IterateValidatorAccumulatedCommissions iterates over accumulated commissions
func (Keeper) IterateValidatorCurrentRewards ¶
func (k Keeper) IterateValidatorCurrentRewards(ctx sdk.Context, handler func(val sdk.ValAddress, rewards types.ValidatorCurrentRewards) (stop bool))
iterate over current rewards
func (Keeper) IterateValidatorHistoricalRewards ¶
func (k Keeper) IterateValidatorHistoricalRewards(ctx sdk.Context, handler func(val sdk.ValAddress, period uint64, rewards types.ValidatorHistoricalRewards) (stop bool))
iterate over historical rewards
func (Keeper) IterateValidatorOutstandingRewards ¶
func (k Keeper) IterateValidatorOutstandingRewards(ctx sdk.Context, handler func(val sdk.ValAddress, rewards types.ValidatorOutstandingRewards) (stop bool))
iterate validator outstanding rewards
func (Keeper) SetCommunityTax ¶
SetCommunityTax sets the value of community tax nolint: errcheck
func (Keeper) SetDelegatorStartingInfo ¶
func (k Keeper) SetDelegatorStartingInfo(ctx sdk.Context, val sdk.ValAddress, del sdk.AccAddress, period types.DelegatorStartingInfo)
set the starting info associated with a delegator
func (Keeper) SetDelegatorWithdrawAddr ¶
func (k Keeper) SetDelegatorWithdrawAddr(ctx sdk.Context, delAddr, withdrawAddr sdk.AccAddress)
SetDelegatorWithdrawAddr sets the delegator withdraw address
func (Keeper) SetDistributionType ¶
func (Keeper) SetFeePool ¶
SetFeePool sets the global fee pool distribution info
func (*Keeper) SetGovKeeper ¶
SetGovKeeper sets keeper of gov
func (Keeper) SetInitExistedValidatorFlag ¶
SetInitExistedValidatorFlag set init existed validator for distribution proposal flag
func (Keeper) SetParamsForInitGenesis ¶
SetParamsForInitGenesis sets the distribution parameters to the param space, and ignore the target keys for additional
func (Keeper) SetPreviousProposerConsAddr ¶
func (k Keeper) SetPreviousProposerConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress)
SetPreviousProposerConsAddr sets the proposer public key for this block
func (Keeper) SetRewardTruncatePrecision ¶
func (Keeper) SetValidatorAccumulatedCommission ¶
func (k Keeper) SetValidatorAccumulatedCommission(ctx sdk.Context, val sdk.ValAddress, commission types.ValidatorAccumulatedCommission)
SetValidatorAccumulatedCommission sets accumulated commission for a validator
func (Keeper) SetValidatorCurrentRewards ¶
func (k Keeper) SetValidatorCurrentRewards(ctx sdk.Context, val sdk.ValAddress, rewards types.ValidatorCurrentRewards)
set current rewards for a validator
func (Keeper) SetValidatorHistoricalRewards ¶
func (k Keeper) SetValidatorHistoricalRewards(ctx sdk.Context, val sdk.ValAddress, period uint64, rewards types.ValidatorHistoricalRewards)
set historical rewards for a particular period
func (Keeper) SetValidatorOutstandingRewards ¶
func (k Keeper) SetValidatorOutstandingRewards(ctx sdk.Context, val sdk.ValAddress, rewards types.ValidatorOutstandingRewards)
set validator outstanding rewards
func (Keeper) SetWithdrawAddr ¶
func (k Keeper) SetWithdrawAddr(ctx sdk.Context, delegatorAddr sdk.AccAddress, withdrawAddr sdk.AccAddress) error
SetWithdrawAddr sets a new address that will receive the rewards upon withdrawal
func (Keeper) SetWithdrawAddrEnabled ¶
SetWithdrawAddrEnabled sets the value of enabled nolint: errcheck
func (Keeper) SetWithdrawRewardEnabled ¶
func (Keeper) VoteHandler ¶
func (Keeper) WithdrawDelegationAllRewards ¶
withdraw all rewards
func (Keeper) WithdrawDelegationRewards ¶
func (k Keeper) WithdrawDelegationRewards(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, error)
withdraw rewards from a delegation
func (Keeper) WithdrawValidatorCommission ¶
func (k Keeper) WithdrawValidatorCommission(ctx sdk.Context, valAddr sdk.ValAddress) (sdk.Coins, error)
WithdrawValidatorCommission withdraws validator commission
Source Files ¶
- alias_functions.go
- allocation.go
- allocation_distr_proposal.go
- delegation.go
- hooks.go
- hooks_distr_proposal.go
- invariants.go
- keeper.go
- keeper_distr_proposal.go
- params.go
- params_distr_proposal.go
- proposal_handler.go
- proposal_handler_distr_proposal.go
- querier.go
- querier_distr_proposal.go
- store.go
- store_distr_proposal.go
- test_common.go
- test_common_distr_proposal.go
- validator.go
- validator_distr_proposal.go