Documentation ¶
Index ¶
- Constants
- Variables
- func AllInvariants(k Keeper, stk types.StakingKeeper) sdk.Invariant
- func CanWithdrawInvariant(k Keeper, sk types.StakingKeeper) sdk.Invariant
- 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, ...)
- func GetDelegatorStartingInfoAddresses(key []byte) (valAddr sdk.ValAddress, delAddr sdk.AccAddress)
- func GetDelegatorStartingInfoKey(v sdk.ValAddress, d sdk.AccAddress) []byte
- func GetDelegatorWithdrawAddrKey(delAddr sdk.AccAddress) []byte
- func GetDelegatorWithdrawInfoAddress(key []byte) (delAddr sdk.AccAddress)
- func GetValidatorAccumulatedCommissionAddress(key []byte) (valAddr sdk.ValAddress)
- func GetValidatorAccumulatedCommissionKey(v sdk.ValAddress) []byte
- func GetValidatorCurrentRewardsAddress(key []byte) (valAddr sdk.ValAddress)
- func GetValidatorCurrentRewardsKey(v sdk.ValAddress) []byte
- func GetValidatorHistoricalRewardsAddressPeriod(key []byte) (valAddr sdk.ValAddress, period uint64)
- func GetValidatorHistoricalRewardsKey(v sdk.ValAddress, k uint64) []byte
- func GetValidatorHistoricalRewardsPrefix(v sdk.ValAddress) []byte
- func GetValidatorOutstandingRewardsAddress(key []byte) (valAddr sdk.ValAddress)
- func GetValidatorOutstandingRewardsKey(valAddr sdk.ValAddress) []byte
- func GetValidatorSlashEventAddressHeight(key []byte) (valAddr sdk.ValAddress, height uint64)
- func GetValidatorSlashEventKey(v sdk.ValAddress, height uint64) []byte
- func GetValidatorSlashEventPrefix(v sdk.ValAddress) []byte
- func MakeTestCodec() *codec.Codec
- func NewQuerier(k Keeper) sdk.Querier
- func NonNegativeOutstandingInvariant(k Keeper) sdk.Invariant
- func ParamKeyTable() params.KeyTable
- func ReferenceCountInvariant(k Keeper, sk types.StakingKeeper) sdk.Invariant
- func RegisterInvariants(c types.CrisisKeeper, k Keeper, stk types.StakingKeeper)
- type DummyFeeCollectionKeeper
- func (fck DummyFeeCollectionKeeper) AddCollectedFees(_ sdk.Context, in sdk.Coins) sdk.Coins
- func (fck DummyFeeCollectionKeeper) ClearCollectedFees(_ sdk.Context)
- func (fck DummyFeeCollectionKeeper) GetCollectedFees(_ sdk.Context) sdk.Coins
- func (fck DummyFeeCollectionKeeper) SetCollectedFees(in sdk.Coins)
- type Hooks
- func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress)
- func (h Hooks) AfterValidatorBonded(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress)
- func (h Hooks) AfterValidatorCreated(ctx sdk.Context, 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, valAddr sdk.ValAddress)
- func (h Hooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
- func (h Hooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress)
- func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec)
- type Keeper
- func (k Keeper) AllocateTokens(ctx sdk.Context, sumPreviousPrecommitPower, totalPreviousPower int64, ...)
- func (k Keeper) AllocateTokensToValidator(ctx sdk.Context, val sdk.Validator, tokens sdk.DecCoins)
- func (k Keeper) DeleteAllValidatorHistoricalRewards(ctx sdk.Context)
- func (k Keeper) DeleteAllValidatorSlashEvents(ctx sdk.Context)
- func (k Keeper) DeleteDelegatorStartingInfo(ctx sdk.Context, val sdk.ValAddress, del sdk.AccAddress)
- func (k Keeper) DeleteDelegatorWithdrawAddr(ctx sdk.Context, delAddr, withdrawAddr sdk.AccAddress)
- func (k Keeper) DeleteValidatorAccumulatedCommission(ctx sdk.Context, val sdk.ValAddress)
- 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) DeleteValidatorSlashEvents(ctx sdk.Context, val sdk.ValAddress)
- func (k Keeper) DistributeFeePool(ctx sdk.Context, amount sdk.Coins, receiveAddr sdk.AccAddress) sdk.Error
- func (k Keeper) GetBaseProposerReward(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetBonusProposerReward(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetCommunityTax(ctx sdk.Context) 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) GetFeePool(ctx sdk.Context) (feePool types.FeePool)
- func (k Keeper) GetFeePoolCommunityCoins(ctx sdk.Context) sdk.DecCoins
- func (k Keeper) GetPreviousProposerConsAddr(ctx sdk.Context) (consAddr sdk.ConsAddress)
- 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 (k Keeper) GetValidatorOutstandingRewardsCoins(ctx sdk.Context, val sdk.ValAddress) sdk.DecCoins
- func (k Keeper) GetValidatorSlashEvent(ctx sdk.Context, val sdk.ValAddress, height uint64) (event types.ValidatorSlashEvent, found bool)
- func (k Keeper) GetWithdrawAddrEnabled(ctx sdk.Context) bool
- func (k Keeper) HasDelegatorStartingInfo(ctx sdk.Context, val sdk.ValAddress, del sdk.AccAddress) 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) IterateValidatorSlashEvents(ctx sdk.Context, ...)
- func (k Keeper) IterateValidatorSlashEventsBetween(ctx sdk.Context, val sdk.ValAddress, startingHeight uint64, ...)
- func (k Keeper) SetBaseProposerReward(ctx sdk.Context, percent sdk.Dec)
- func (k Keeper) SetBonusProposerReward(ctx sdk.Context, percent sdk.Dec)
- 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) SetFeePool(ctx sdk.Context, feePool types.FeePool)
- func (k Keeper) SetPreviousProposerConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress)
- 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) SetValidatorSlashEvent(ctx sdk.Context, val sdk.ValAddress, height uint64, ...)
- func (k Keeper) SetWithdrawAddr(ctx sdk.Context, delegatorAddr sdk.AccAddress, withdrawAddr sdk.AccAddress) sdk.Error
- func (k Keeper) SetWithdrawAddrEnabled(ctx sdk.Context, enabled bool)
- func (k Keeper) WithdrawDelegationRewards(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, sdk.Error)
- func (k Keeper) WithdrawValidatorCommission(ctx sdk.Context, valAddr sdk.ValAddress) (sdk.Coins, sdk.Error)
- type QueryDelegationRewardsParams
- type QueryDelegatorParams
- type QueryDelegatorWithdrawAddrParams
- type QueryValidatorCommissionParams
- type QueryValidatorOutstandingRewardsParams
- type QueryValidatorSlashesParams
Constants ¶
const ( QueryParams = "params" QueryValidatorOutstandingRewards = "validator_outstanding_rewards" QueryValidatorCommission = "validator_commission" QueryValidatorSlashes = "validator_slashes" QueryDelegationRewards = "delegation_rewards" QueryDelegatorTotalRewards = "delegator_total_rewards" QueryDelegatorValidators = "delegator_validators" QueryWithdrawAddr = "withdraw_addr" QueryCommunityPool = "community_pool" ParamCommunityTax = "community_tax" ParamBaseProposerReward = "base_proposer_reward" ParamBonusProposerReward = "bonus_proposer_reward" ParamWithdrawAddrEnabled = "withdraw_addr_enabled" )
nolint
const ( // default paramspace for params keeper DefaultParamspace = types.ModuleName )
Variables ¶
var ( FeePoolKey = []byte{0x00} // key for global distribution state ProposerKey = []byte{0x01} // key for the proposer operator address ValidatorOutstandingRewardsPrefix = []byte{0x02} // key for outstanding rewards DelegatorWithdrawAddrPrefix = []byte{0x03} // key for delegator withdraw address DelegatorStartingInfoPrefix = []byte{0x04} // key for delegator starting info ValidatorHistoricalRewardsPrefix = []byte{0x05} // key for historical validators rewards / stake ValidatorCurrentRewardsPrefix = []byte{0x06} // key for current validator rewards ValidatorAccumulatedCommissionPrefix = []byte{0x07} // key for accumulated validator commission ValidatorSlashEventPrefix = []byte{0x08} // key for validator slash fraction ParamStoreKeyCommunityTax = []byte("communitytax") ParamStoreKeyBaseProposerReward = []byte("baseproposerreward") ParamStoreKeyBonusProposerReward = []byte("bonusproposerreward") ParamStoreKeyWithdrawAddrEnabled = []byte("withdrawaddrenabled") )
keys
var ( // test addresses TestAddrs = []sdk.AccAddress{ delAddr1, delAddr2, delAddr3, valAccAddr1, valAccAddr2, valAccAddr3, } )
Functions ¶
func AllInvariants ¶
func AllInvariants(k Keeper, stk types.StakingKeeper) sdk.Invariant
AllInvariants runs all invariants of the distribution module
func CanWithdrawInvariant ¶
func CanWithdrawInvariant(k Keeper, sk types.StakingKeeper) sdk.Invariant
CanWithdrawInvariant checks that current rewards can be completely withdrawn
func CreateTestInputAdvanced ¶ added in v0.25.0
func CreateTestInputAdvanced(t *testing.T, isCheckTx bool, initPower int64, communityTax sdk.Dec) (sdk.Context, auth.AccountKeeper, bank.Keeper, Keeper, staking.Keeper, DummyFeeCollectionKeeper, params.Keeper)
hogpodge of all sorts of input required for testing
func CreateTestInputDefault ¶ added in v0.25.0
func CreateTestInputDefault(t *testing.T, isCheckTx bool, initPower int64) ( sdk.Context, auth.AccountKeeper, Keeper, staking.Keeper, DummyFeeCollectionKeeper)
test input with default values
func GetDelegatorStartingInfoAddresses ¶ added in v0.30.0
func GetDelegatorStartingInfoAddresses(key []byte) (valAddr sdk.ValAddress, delAddr sdk.AccAddress)
gets the addresses from a delegator starting info key
func GetDelegatorStartingInfoKey ¶ added in v0.30.0
func GetDelegatorStartingInfoKey(v sdk.ValAddress, d sdk.AccAddress) []byte
gets the key for a delegator's starting info
func GetDelegatorWithdrawAddrKey ¶ added in v0.25.0
func GetDelegatorWithdrawAddrKey(delAddr sdk.AccAddress) []byte
gets the key for a delegator's withdraw addr
func GetDelegatorWithdrawInfoAddress ¶ added in v0.26.0
func GetDelegatorWithdrawInfoAddress(key []byte) (delAddr sdk.AccAddress)
gets an address from a delegator's withdraw info key
func GetValidatorAccumulatedCommissionAddress ¶ added in v0.30.0
func GetValidatorAccumulatedCommissionAddress(key []byte) (valAddr sdk.ValAddress)
gets the address from a validator's accumulated commission key
func GetValidatorAccumulatedCommissionKey ¶ added in v0.30.0
func GetValidatorAccumulatedCommissionKey(v sdk.ValAddress) []byte
gets the key for a validator's current commission
func GetValidatorCurrentRewardsAddress ¶ added in v0.30.0
func GetValidatorCurrentRewardsAddress(key []byte) (valAddr sdk.ValAddress)
gets the address from a validator's current rewards key
func GetValidatorCurrentRewardsKey ¶ added in v0.30.0
func GetValidatorCurrentRewardsKey(v sdk.ValAddress) []byte
gets the key for a validator's current rewards
func GetValidatorHistoricalRewardsAddressPeriod ¶ added in v0.30.0
func GetValidatorHistoricalRewardsAddressPeriod(key []byte) (valAddr sdk.ValAddress, period uint64)
gets the address & period from a validator's historical rewards key
func GetValidatorHistoricalRewardsKey ¶ added in v0.30.0
func GetValidatorHistoricalRewardsKey(v sdk.ValAddress, k uint64) []byte
gets the key for a validator's historical rewards
func GetValidatorHistoricalRewardsPrefix ¶ added in v0.30.0
func GetValidatorHistoricalRewardsPrefix(v sdk.ValAddress) []byte
gets the prefix key for a validator's historical rewards
func GetValidatorOutstandingRewardsAddress ¶ added in v0.33.0
func GetValidatorOutstandingRewardsAddress(key []byte) (valAddr sdk.ValAddress)
gets an address from a validator's outstanding rewards key
func GetValidatorOutstandingRewardsKey ¶ added in v0.33.0
func GetValidatorOutstandingRewardsKey(valAddr sdk.ValAddress) []byte
gets the outstanding rewards key for a validator
func GetValidatorSlashEventAddressHeight ¶ added in v0.30.0
func GetValidatorSlashEventAddressHeight(key []byte) (valAddr sdk.ValAddress, height uint64)
gets the height from a validator's slash event key
func GetValidatorSlashEventKey ¶ added in v0.30.0
func GetValidatorSlashEventKey(v sdk.ValAddress, height uint64) []byte
gets the key for a validator's slash fraction
func GetValidatorSlashEventPrefix ¶ added in v0.30.0
func GetValidatorSlashEventPrefix(v sdk.ValAddress) []byte
gets the prefix key for a validator's slash fractions
func MakeTestCodec ¶ added in v0.25.0
create a codec used only for testing
func NewQuerier ¶
func NonNegativeOutstandingInvariant ¶
NonNegativeOutstandingInvariant checks that outstanding unwithdrawn fees are never negative
func ParamKeyTable ¶ added in v0.31.0
type declaration for parameters
func ReferenceCountInvariant ¶
func ReferenceCountInvariant(k Keeper, sk types.StakingKeeper) sdk.Invariant
ReferenceCountInvariant checks that the number of historical rewards records is correct
func RegisterInvariants ¶
func RegisterInvariants(c types.CrisisKeeper, k Keeper, stk types.StakingKeeper)
register all distribution invariants
Types ¶
type DummyFeeCollectionKeeper ¶ added in v0.25.0
type DummyFeeCollectionKeeper struct{}
__________________________________________________________________________________ fee collection keeper used only for testing
func (DummyFeeCollectionKeeper) AddCollectedFees ¶ added in v0.34.0
nolint
func (DummyFeeCollectionKeeper) ClearCollectedFees ¶ added in v0.25.0
func (fck DummyFeeCollectionKeeper) ClearCollectedFees(_ sdk.Context)
func (DummyFeeCollectionKeeper) GetCollectedFees ¶ added in v0.25.0
func (fck DummyFeeCollectionKeeper) GetCollectedFees(_ sdk.Context) sdk.Coins
func (DummyFeeCollectionKeeper) SetCollectedFees ¶ added in v0.25.0
func (fck DummyFeeCollectionKeeper) SetCollectedFees(in sdk.Coins)
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Wrapper struct
func (Hooks) AfterDelegationModified ¶
func (h Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
func (Hooks) AfterValidatorBeginUnbonding ¶
func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress)
func (Hooks) AfterValidatorBonded ¶
func (h Hooks) AfterValidatorBonded(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress)
func (Hooks) AfterValidatorCreated ¶
func (h Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress)
nolint
func (Hooks) AfterValidatorRemoved ¶
func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress)
func (Hooks) BeforeDelegationCreated ¶
func (h Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
func (Hooks) BeforeDelegationRemoved ¶
func (h Hooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
func (Hooks) BeforeDelegationSharesModified ¶
func (h Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress)
func (Hooks) BeforeValidatorModified ¶
func (h Hooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress)
func (Hooks) BeforeValidatorSlashed ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
keeper of the staking store
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, paramSpace params.Subspace, ck types.BankKeeper, sk types.StakingKeeper, fck types.FeeCollectionKeeper, codespace sdk.CodespaceType) Keeper
create a new keeper
func (Keeper) AllocateTokens ¶
func (k Keeper) AllocateTokens(ctx sdk.Context, sumPreviousPrecommitPower, totalPreviousPower int64, previousProposer sdk.ConsAddress, previousVotes []abci.VoteInfo)
allocate fees handles distribution of the collected fees
func (Keeper) AllocateTokensToValidator ¶
allocate tokens to a particular validator, splitting according to commission
func (Keeper) DeleteAllValidatorHistoricalRewards ¶
delete all historical rewards
func (Keeper) DeleteAllValidatorSlashEvents ¶
delete all slash events
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) DeleteDelegatorWithdrawAddr ¶
func (k Keeper) DeleteDelegatorWithdrawAddr(ctx sdk.Context, delAddr, withdrawAddr sdk.AccAddress)
delete a delegator withdraw addr
func (Keeper) DeleteValidatorAccumulatedCommission ¶
func (k Keeper) DeleteValidatorAccumulatedCommission(ctx sdk.Context, val sdk.ValAddress)
delete accumulated commission for a validator
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) DeleteValidatorSlashEvents ¶
func (k Keeper) DeleteValidatorSlashEvents(ctx sdk.Context, val sdk.ValAddress)
delete slash events for a particular validator
func (Keeper) DistributeFeePool ¶ added in v0.34.0
func (k Keeper) DistributeFeePool(ctx sdk.Context, amount sdk.Coins, receiveAddr sdk.AccAddress) sdk.Error
DistributeFeePool distributes funds from the the community pool to a receiver address
func (Keeper) GetBaseProposerReward ¶
returns the current BaseProposerReward rate from the global param store nolint: errcheck
func (Keeper) GetBonusProposerReward ¶
returns the current BaseProposerReward rate from the global param store nolint: errcheck
func (Keeper) 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
get the delegator withdraw address, defaulting to the delegator address
func (Keeper) GetFeePool ¶
get the global fee pool distribution info
func (Keeper) GetFeePoolCommunityCoins ¶
get the community coins
func (Keeper) GetPreviousProposerConsAddr ¶
func (k Keeper) GetPreviousProposerConsAddr(ctx sdk.Context) (consAddr sdk.ConsAddress)
get the proposer public key for this block
func (Keeper) GetValidatorAccumulatedCommission ¶
func (k Keeper) GetValidatorAccumulatedCommission(ctx sdk.Context, val sdk.ValAddress) (commission types.ValidatorAccumulatedCommission)
get 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) GetValidatorOutstandingRewardsCoins ¶
func (k Keeper) GetValidatorOutstandingRewardsCoins(ctx sdk.Context, val sdk.ValAddress) sdk.DecCoins
get outstanding rewards
func (Keeper) GetValidatorSlashEvent ¶
func (k Keeper) GetValidatorSlashEvent(ctx sdk.Context, val sdk.ValAddress, height uint64) (event types.ValidatorSlashEvent, found bool)
get slash event for height
func (Keeper) GetWithdrawAddrEnabled ¶
returns the current WithdrawAddrEnabled nolint: errcheck
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) 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))
iterate over delegator withdraw addrs
func (Keeper) IterateValidatorAccumulatedCommissions ¶
func (k Keeper) IterateValidatorAccumulatedCommissions(ctx sdk.Context, handler func(val sdk.ValAddress, commission types.ValidatorAccumulatedCommission) (stop bool))
iterate 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) IterateValidatorSlashEvents ¶
func (k Keeper) IterateValidatorSlashEvents(ctx sdk.Context, handler func(val sdk.ValAddress, height uint64, event types.ValidatorSlashEvent) (stop bool))
iterate over all slash events
func (Keeper) IterateValidatorSlashEventsBetween ¶
func (k Keeper) IterateValidatorSlashEventsBetween(ctx sdk.Context, val sdk.ValAddress, startingHeight uint64, endingHeight uint64, handler func(height uint64, event types.ValidatorSlashEvent) (stop bool))
iterate over slash events between heights, inclusive
func (Keeper) SetBaseProposerReward ¶ added in v0.25.0
nolint: errcheck
func (Keeper) SetBonusProposerReward ¶ added in v0.25.0
nolint: errcheck
func (Keeper) SetCommunityTax ¶ added in v0.25.0
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)
set the delegator withdraw address
func (Keeper) SetFeePool ¶
set the global fee pool distribution info
func (Keeper) SetPreviousProposerConsAddr ¶
func (k Keeper) SetPreviousProposerConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress)
set the proposer public key for this block
func (Keeper) SetValidatorAccumulatedCommission ¶
func (k Keeper) SetValidatorAccumulatedCommission(ctx sdk.Context, val sdk.ValAddress, commission types.ValidatorAccumulatedCommission)
set 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) SetValidatorSlashEvent ¶
func (k Keeper) SetValidatorSlashEvent(ctx sdk.Context, val sdk.ValAddress, height uint64, event types.ValidatorSlashEvent)
set slash event for height
func (Keeper) SetWithdrawAddr ¶
func (k Keeper) SetWithdrawAddr(ctx sdk.Context, delegatorAddr sdk.AccAddress, withdrawAddr sdk.AccAddress) sdk.Error
set withdraw address
func (Keeper) SetWithdrawAddrEnabled ¶ added in v0.30.0
nolint: errcheck
func (Keeper) WithdrawDelegationRewards ¶
func (k Keeper) WithdrawDelegationRewards(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, sdk.Error)
withdraw rewards from a delegation
type QueryDelegationRewardsParams ¶ added in v0.30.0
type QueryDelegationRewardsParams struct { DelegatorAddress sdk.AccAddress `json:"delegator_address"` ValidatorAddress sdk.ValAddress `json:"validator_address"` }
params for query 'custom/distr/delegation_rewards'
func NewQueryDelegationRewardsParams ¶ added in v0.30.0
func NewQueryDelegationRewardsParams(delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) QueryDelegationRewardsParams
creates a new instance of QueryDelegationRewardsParams
type QueryDelegatorParams ¶ added in v0.31.0
type QueryDelegatorParams struct {
DelegatorAddress sdk.AccAddress `json:"delegator_address"`
}
params for query 'custom/distr/delegator_total_rewards' and 'custom/distr/delegator_validators'
func NewQueryDelegatorParams ¶ added in v0.31.0
func NewQueryDelegatorParams(delegatorAddr sdk.AccAddress) QueryDelegatorParams
creates a new instance of QueryDelegationRewardsParams
type QueryDelegatorWithdrawAddrParams ¶ added in v0.31.0
type QueryDelegatorWithdrawAddrParams struct {
DelegatorAddress sdk.AccAddress `json:"delegator_address"`
}
params for query 'custom/distr/withdraw_addr'
func NewQueryDelegatorWithdrawAddrParams ¶ added in v0.31.0
func NewQueryDelegatorWithdrawAddrParams(delegatorAddr sdk.AccAddress) QueryDelegatorWithdrawAddrParams
NewQueryDelegatorWithdrawAddrParams creates a new instance of QueryDelegatorWithdrawAddrParams.
type QueryValidatorCommissionParams ¶ added in v0.30.0
type QueryValidatorCommissionParams struct {
ValidatorAddress sdk.ValAddress `json:"validator_address"`
}
params for query 'custom/distr/validator_commission'
func NewQueryValidatorCommissionParams ¶ added in v0.30.0
func NewQueryValidatorCommissionParams(validatorAddr sdk.ValAddress) QueryValidatorCommissionParams
creates a new instance of QueryValidatorCommissionParams
type QueryValidatorOutstandingRewardsParams ¶ added in v0.33.0
type QueryValidatorOutstandingRewardsParams struct {
ValidatorAddress sdk.ValAddress `json:"validator_address"`
}
params for query 'custom/distr/validator_outstanding_rewards'
func NewQueryValidatorOutstandingRewardsParams ¶ added in v0.33.0
func NewQueryValidatorOutstandingRewardsParams(validatorAddr sdk.ValAddress) QueryValidatorOutstandingRewardsParams
creates a new instance of QueryValidatorOutstandingRewardsParams
type QueryValidatorSlashesParams ¶ added in v0.30.0
type QueryValidatorSlashesParams struct { ValidatorAddress sdk.ValAddress `json:"validator_address"` StartingHeight uint64 `json:"starting_height"` EndingHeight uint64 `json:"ending_height"` }
params for query 'custom/distr/validator_slashes'
func NewQueryValidatorSlashesParams ¶ added in v0.30.0
func NewQueryValidatorSlashesParams(validatorAddr sdk.ValAddress, startingHeight uint64, endingHeight uint64) QueryValidatorSlashesParams
creates a new instance of QueryValidatorSlashesParams