Documentation ¶
Index ¶
- func AllInvariants(k Keeper) sdk.Invariant
- func CanWithdrawInvariant(k Keeper) sdk.Invariant
- func ModuleAccountInvariant(k Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NonNegativeOutstandingInvariant(k Keeper) sdk.Invariant
- func ReferenceCountInvariant(k Keeper) sdk.Invariant
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- type Hooks
- func (h Hooks) AfterDelegationModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h Hooks) AfterUnbondingInitiated(_ context.Context, _ uint64) error
- func (h Hooks) AfterValidatorBeginUnbonding(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
- func (h Hooks) AfterValidatorBonded(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
- func (h Hooks) AfterValidatorCreated(ctx context.Context, valAddr sdk.ValAddress) error
- func (h Hooks) AfterValidatorRemoved(ctx context.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeDelegationCreated(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeDelegationRemoved(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
- func (h Hooks) BeforeDelegationSharesModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeValidatorModified(_ context.Context, _ sdk.ValAddress) error
- func (h Hooks) BeforeValidatorSlashed(ctx context.Context, valAddr sdk.ValAddress, fraction sdkmath.LegacyDec) error
- type Keeper
- func (k Keeper) AllocateTokens(ctx context.Context, totalPreviousPower int64, bondedVotes []abci.VoteInfo) error
- func (k Keeper) AllocateTokensToValidator(ctx context.Context, val stakingtypes.ValidatorI, tokens sdk.DecCoins) error
- func (k Keeper) CalculateDelegationEmission(ctx context.Context, val stakingtypes.ValidatorI, del stakingtypes.DelegationI) (rewards sdk.DecCoins, err error)
- func (k Keeper) CalculateDelegationRewards(ctx context.Context, val stakingtypes.ValidatorI, del stakingtypes.DelegationI, ...) (rewards sdk.DecCoins, err error)
- func (k Keeper) DeleteAllValidatorHistoricalRewards(ctx context.Context)
- func (k Keeper) DeleteAllValidatorSlashEvents(ctx context.Context)
- func (k Keeper) DeleteDelegatorStartingInfo(ctx context.Context, val sdk.ValAddress, del sdk.AccAddress) error
- func (k Keeper) DeleteDelegatorWithdrawAddr(ctx context.Context, delAddr, withdrawAddr sdk.AccAddress) error
- func (k Keeper) DeleteValidatorAccumulatedCommission(ctx context.Context, val sdk.ValAddress) error
- func (k Keeper) DeleteValidatorCurrentRewards(ctx context.Context, val sdk.ValAddress) error
- func (k Keeper) DeleteValidatorHistoricalReward(ctx context.Context, val sdk.ValAddress, period uint64) error
- func (k Keeper) DeleteValidatorHistoricalRewards(ctx context.Context, val sdk.ValAddress)
- func (k Keeper) DeleteValidatorOutstandingRewards(ctx context.Context, val sdk.ValAddress) error
- func (k Keeper) DeleteValidatorSlashEvents(ctx context.Context, val sdk.ValAddress)
- func (k Keeper) DistributeFromFeePool(ctx context.Context, amount sdk.Coins, receiveAddr sdk.AccAddress) error
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) FundCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetBurnRate(ctx context.Context) (dec math.LegacyDec, err error)
- func (k Keeper) GetCommunityTax(ctx context.Context) (math.LegacyDec, error)
- func (k Keeper) GetDelegatorStartingInfo(ctx context.Context, val sdk.ValAddress, del sdk.AccAddress) (period types.DelegatorStartingInfo, err error)
- func (k Keeper) GetDelegatorWithdrawAddr(ctx context.Context, delAddr sdk.AccAddress) (sdk.AccAddress, error)
- func (k Keeper) GetDistributionAccount(ctx context.Context) sdk.ModuleAccountI
- func (k Keeper) GetPreviousProposerConsAddr(ctx context.Context) (sdk.ConsAddress, error)
- func (k Keeper) GetTotalRewards(ctx context.Context) (totalRewards sdk.DecCoins)
- func (k Keeper) GetValidatorAccumulatedCommission(ctx context.Context, val sdk.ValAddress) (commission types.ValidatorAccumulatedCommission, err error)
- func (k Keeper) GetValidatorCommissionRate(ctx context.Context) (dec math.LegacyDec, err error)
- func (k Keeper) GetValidatorCurrentRewards(ctx context.Context, val sdk.ValAddress) (rewards types.ValidatorCurrentRewards, err error)
- func (k Keeper) GetValidatorHistoricalReferenceCount(ctx context.Context) (count uint64)
- func (k Keeper) GetValidatorHistoricalRewards(ctx context.Context, val sdk.ValAddress, period uint64) (rewards types.ValidatorHistoricalRewards, err error)
- func (k Keeper) GetValidatorOutstandingRewards(ctx context.Context, val sdk.ValAddress) (rewards types.ValidatorOutstandingRewards, err error)
- func (k Keeper) GetValidatorOutstandingRewardsCoins(ctx context.Context, val sdk.ValAddress) (sdk.DecCoins, error)
- func (k Keeper) GetValidatorSlashEvent(ctx context.Context, val sdk.ValAddress, height, period uint64) (event types.ValidatorSlashEvent, found bool, err error)
- func (k Keeper) GetWithdrawAddrEnabled(ctx context.Context) (enabled bool, err error)
- func (k Keeper) HasDelegatorStartingInfo(ctx context.Context, val sdk.ValAddress, del sdk.AccAddress) (bool, error)
- func (k Keeper) Hooks() Hooks
- func (k Keeper) IncrementValidatorPeriod(ctx context.Context, val stakingtypes.ValidatorI) (uint64, error)
- func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
- func (k Keeper) IterateDelegatorStartingInfos(ctx context.Context, ...)
- func (k Keeper) IterateDelegatorWithdrawAddrs(ctx context.Context, handler func(del, addr sdk.AccAddress) (stop bool))
- func (k Keeper) IterateValidatorAccumulatedCommissions(ctx context.Context, ...)
- func (k Keeper) IterateValidatorCurrentRewards(ctx context.Context, ...)
- func (k Keeper) IterateValidatorHistoricalRewards(ctx context.Context, ...)
- func (k Keeper) IterateValidatorOutstandingRewards(ctx context.Context, ...)
- func (k Keeper) IterateValidatorSlashEvents(ctx context.Context, ...)
- func (k Keeper) IterateValidatorSlashEventsBetween(ctx context.Context, val sdk.ValAddress, startingHeight, endingHeight uint64, ...)
- func (k Keeper) Logger(ctx context.Context) log.Logger
- func (k Keeper) SetDelegatorStartingInfo(ctx context.Context, val sdk.ValAddress, del sdk.AccAddress, ...) error
- func (k Keeper) SetDelegatorWithdrawAddr(ctx context.Context, delAddr, withdrawAddr sdk.AccAddress) error
- func (k Keeper) SetPreviousProposerConsAddr(ctx context.Context, consAddr sdk.ConsAddress) error
- func (k Keeper) SetValidatorAccumulatedCommission(ctx context.Context, val sdk.ValAddress, ...) error
- func (k Keeper) SetValidatorCurrentRewards(ctx context.Context, val sdk.ValAddress, rewards types.ValidatorCurrentRewards) error
- func (k Keeper) SetValidatorHistoricalRewards(ctx context.Context, val sdk.ValAddress, period uint64, ...) error
- func (k Keeper) SetValidatorOutstandingRewards(ctx context.Context, val sdk.ValAddress, ...) error
- func (k Keeper) SetValidatorSlashEvent(ctx context.Context, val sdk.ValAddress, height, period uint64, ...) error
- func (k Keeper) SetWithdrawAddr(ctx context.Context, delegatorAddr, withdrawAddr sdk.AccAddress) error
- func (k Keeper) WithdrawDelegationRewards(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, error)
- func (k Keeper) WithdrawValidatorCommission(ctx context.Context, valAddr sdk.ValAddress) (sdk.Coins, error)
- type Querier
- func (k Querier) CommunityPool(ctx context.Context, req *types.QueryCommunityPoolRequest) (*types.QueryCommunityPoolResponse, error)
- func (k Querier) DelegationRewards(ctx context.Context, req *types.QueryDelegationRewardsRequest) (*types.QueryDelegationRewardsResponse, error)
- func (k Querier) DelegationTotalRewards(ctx context.Context, req *types.QueryDelegationTotalRewardsRequest) (*types.QueryDelegationTotalRewardsResponse, error)
- func (k Querier) DelegatorValidators(ctx context.Context, req *types.QueryDelegatorValidatorsRequest) (*types.QueryDelegatorValidatorsResponse, error)
- func (k Querier) DelegatorWithdrawAddress(ctx context.Context, req *types.QueryDelegatorWithdrawAddressRequest) (*types.QueryDelegatorWithdrawAddressResponse, error)
- func (k Querier) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Querier) ValidatorCommission(ctx context.Context, req *types.QueryValidatorCommissionRequest) (*types.QueryValidatorCommissionResponse, error)
- func (k Querier) ValidatorDistributionInfo(ctx context.Context, req *types.QueryValidatorDistributionInfoRequest) (*types.QueryValidatorDistributionInfoResponse, error)
- func (k Querier) ValidatorOutstandingRewards(ctx context.Context, req *types.QueryValidatorOutstandingRewardsRequest) (*types.QueryValidatorOutstandingRewardsResponse, error)
- func (k Querier) ValidatorSlashes(ctx context.Context, req *types.QueryValidatorSlashesRequest) (*types.QueryValidatorSlashesResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllInvariants ¶
AllInvariants runs all invariants of the distribution module
func CanWithdrawInvariant ¶
CanWithdrawInvariant checks that current rewards can be completely withdrawn
func ModuleAccountInvariant ¶
ModuleAccountInvariant checks that the coins held by the distr ModuleAccount is consistent with the sum of validator outstanding rewards
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the distribution MsgServer interface for the provided Keeper.
func NonNegativeOutstandingInvariant ¶
NonNegativeOutstandingInvariant checks that outstanding unwithdrawn fees are never negative
func ReferenceCountInvariant ¶
ReferenceCountInvariant checks that the number of historical rewards records is correct
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
register all distribution invariants
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Wrapper struct
func (Hooks) AfterDelegationModified ¶
func (h Hooks) AfterDelegationModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
create new delegation period record
func (Hooks) AfterUnbondingInitiated ¶
func (Hooks) AfterValidatorBeginUnbonding ¶
func (h Hooks) AfterValidatorBeginUnbonding(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
func (Hooks) AfterValidatorBonded ¶
func (h Hooks) AfterValidatorBonded(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error
func (Hooks) AfterValidatorCreated ¶
initialize validator distribution record
func (Hooks) AfterValidatorRemoved ¶
func (h Hooks) AfterValidatorRemoved(ctx context.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress) error
AfterValidatorRemoved performs clean up after a validator is removed
func (Hooks) BeforeDelegationCreated ¶
func (h Hooks) BeforeDelegationCreated(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
increment period
func (Hooks) BeforeDelegationRemoved ¶
func (h Hooks) BeforeDelegationRemoved(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error
func (Hooks) BeforeDelegationSharesModified ¶
func (h Hooks) BeforeDelegationSharesModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
withdraw delegation rewards (which also increments period)
func (Hooks) BeforeValidatorModified ¶
func (Hooks) BeforeValidatorSlashed ¶
func (h Hooks) BeforeValidatorSlashed(ctx context.Context, valAddr sdk.ValAddress, fraction sdkmath.LegacyDec) error
record the slash event
type Keeper ¶
type Keeper struct { Schema collections.Schema Params collections.Item[types.Params] FeePool collections.Item[types.FeePool] // contains filtered or unexported fields }
Keeper of the distribution store
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeService store.KVStoreService, ak types.AccountKeeper, bk types.BankKeeper, sk types.StakingKeeper, feeCollectorName, authority string, ) Keeper
NewKeeper creates a new distribution Keeper instance
func (Keeper) AllocateTokens ¶
func (k Keeper) AllocateTokens(ctx context.Context, totalPreviousPower int64, bondedVotes []abci.VoteInfo) error
AllocateTokens performs reward and fee distribution to all validators based on the F1 fee distribution specification.
func (Keeper) AllocateTokensToValidator ¶
func (k Keeper) AllocateTokensToValidator(ctx context.Context, val stakingtypes.ValidatorI, tokens sdk.DecCoins) error
AllocateTokensToValidator allocate tokens to a particular validator, splitting according to commission.
func (Keeper) CalculateDelegationEmission ¶
func (k Keeper) CalculateDelegationEmission(ctx context.Context, val stakingtypes.ValidatorI, del stakingtypes.DelegationI) (rewards sdk.DecCoins, err error)
func (Keeper) CalculateDelegationRewards ¶
func (k Keeper) CalculateDelegationRewards(ctx context.Context, val stakingtypes.ValidatorI, del stakingtypes.DelegationI, endingPeriod uint64) (rewards sdk.DecCoins, err error)
calculate the total rewards accrued by a delegation
func (Keeper) DeleteAllValidatorHistoricalRewards ¶
delete all historical rewards
func (Keeper) DeleteAllValidatorSlashEvents ¶
delete all slash events
func (Keeper) DeleteDelegatorStartingInfo ¶
func (k Keeper) DeleteDelegatorStartingInfo(ctx context.Context, val sdk.ValAddress, del sdk.AccAddress) error
delete the starting info associated with a delegator
func (Keeper) DeleteDelegatorWithdrawAddr ¶
func (k Keeper) DeleteDelegatorWithdrawAddr(ctx context.Context, delAddr, withdrawAddr sdk.AccAddress) error
delete a delegator withdraw addr
func (Keeper) DeleteValidatorAccumulatedCommission ¶
delete accumulated commission for a validator
func (Keeper) DeleteValidatorCurrentRewards ¶
delete current rewards for a validator
func (Keeper) DeleteValidatorHistoricalReward ¶
func (k Keeper) DeleteValidatorHistoricalReward(ctx context.Context, val sdk.ValAddress, period uint64) error
delete a historical reward
func (Keeper) DeleteValidatorHistoricalRewards ¶
func (k Keeper) DeleteValidatorHistoricalRewards(ctx context.Context, val sdk.ValAddress)
delete historical rewards for a validator
func (Keeper) DeleteValidatorOutstandingRewards ¶
delete validator outstanding rewards
func (Keeper) DeleteValidatorSlashEvents ¶
func (k Keeper) DeleteValidatorSlashEvents(ctx context.Context, val sdk.ValAddress)
delete slash events for a particular validator
func (Keeper) DistributeFromFeePool ¶
func (k Keeper) DistributeFromFeePool(ctx context.Context, amount sdk.Coins, receiveAddr sdk.AccAddress) error
DistributeFromFeePool distributes funds from the distribution module account to a receiver address while updating the community pool
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns a GenesisState for a given context and keeper.
func (Keeper) FundCommunityPool ¶
func (k Keeper) FundCommunityPool(ctx context.Context, amount sdk.Coins, sender sdk.AccAddress) error
FundCommunityPool allows an account to directly fund the community fund pool. The amount is first added to the distribution module account and then directly added to the pool. An error is returned if the amount cannot be sent to the module account.
func (Keeper) GetAuthority ¶
GetAuthority returns the x/distribution module's authority.
func (Keeper) GetBurnRate ¶
GetBurnRate returns the current burn rate on fee distribution
func (Keeper) GetCommunityTax ¶
GetCommunityTax returns the current distribution community tax.
func (Keeper) GetDelegatorStartingInfo ¶
func (k Keeper) GetDelegatorStartingInfo(ctx context.Context, val sdk.ValAddress, del sdk.AccAddress) (period types.DelegatorStartingInfo, err error)
get the starting info associated with a delegator
func (Keeper) GetDelegatorWithdrawAddr ¶
func (k Keeper) GetDelegatorWithdrawAddr(ctx context.Context, delAddr sdk.AccAddress) (sdk.AccAddress, error)
get the delegator withdraw address, defaulting to the delegator address
func (Keeper) GetDistributionAccount ¶
func (k Keeper) GetDistributionAccount(ctx context.Context) sdk.ModuleAccountI
GetDistributionAccount returns the distribution ModuleAccount
func (Keeper) GetPreviousProposerConsAddr ¶
GetPreviousProposerConsAddr returns the proposer consensus address for the current block.
func (Keeper) GetTotalRewards ¶
GetTotalRewards returns the total amount of fee distribution rewards held in the store
func (Keeper) GetValidatorAccumulatedCommission ¶
func (k Keeper) GetValidatorAccumulatedCommission(ctx context.Context, val sdk.ValAddress) (commission types.ValidatorAccumulatedCommission, err error)
get accumulated commission for a validator
func (Keeper) GetValidatorCommissionRate ¶
GetValidatorCommissionRate returns the current validator commission rate
func (Keeper) GetValidatorCurrentRewards ¶
func (k Keeper) GetValidatorCurrentRewards(ctx context.Context, val sdk.ValAddress) (rewards types.ValidatorCurrentRewards, err error)
get current rewards for a validator
func (Keeper) GetValidatorHistoricalReferenceCount ¶
historical reference count (used for testcases)
func (Keeper) GetValidatorHistoricalRewards ¶
func (k Keeper) GetValidatorHistoricalRewards(ctx context.Context, val sdk.ValAddress, period uint64) (rewards types.ValidatorHistoricalRewards, err error)
get historical rewards for a particular period
func (Keeper) GetValidatorOutstandingRewards ¶
func (k Keeper) GetValidatorOutstandingRewards(ctx context.Context, val sdk.ValAddress) (rewards types.ValidatorOutstandingRewards, err error)
get validator outstanding rewards
func (Keeper) GetValidatorOutstandingRewardsCoins ¶
func (k Keeper) GetValidatorOutstandingRewardsCoins(ctx context.Context, val sdk.ValAddress) (sdk.DecCoins, error)
get outstanding rewards
func (Keeper) GetValidatorSlashEvent ¶
func (k Keeper) GetValidatorSlashEvent(ctx context.Context, val sdk.ValAddress, height, period uint64) (event types.ValidatorSlashEvent, found bool, err error)
get slash event for height
func (Keeper) GetWithdrawAddrEnabled ¶
GetWithdrawAddrEnabled returns the current distribution withdraw address enabled parameter.
func (Keeper) HasDelegatorStartingInfo ¶
func (k Keeper) HasDelegatorStartingInfo(ctx context.Context, val sdk.ValAddress, del sdk.AccAddress) (bool, error)
check existence of the starting info associated with a delegator
func (Keeper) IncrementValidatorPeriod ¶
func (k Keeper) IncrementValidatorPeriod(ctx context.Context, val stakingtypes.ValidatorI) (uint64, error)
increment validator period, returning the period just ended
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState)
InitGenesis sets distribution information for genesis
func (Keeper) IterateDelegatorStartingInfos ¶
func (k Keeper) IterateDelegatorStartingInfos(ctx context.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 context.Context, handler func(del, addr sdk.AccAddress) (stop bool))
iterate over delegator withdraw addrs
func (Keeper) IterateValidatorAccumulatedCommissions ¶
func (k Keeper) IterateValidatorAccumulatedCommissions(ctx context.Context, handler func(val sdk.ValAddress, commission types.ValidatorAccumulatedCommission) (stop bool))
iterate over accumulated commissions
func (Keeper) IterateValidatorCurrentRewards ¶
func (k Keeper) IterateValidatorCurrentRewards(ctx context.Context, handler func(val sdk.ValAddress, rewards types.ValidatorCurrentRewards) (stop bool))
iterate over current rewards
func (Keeper) IterateValidatorHistoricalRewards ¶
func (k Keeper) IterateValidatorHistoricalRewards(ctx context.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 context.Context, handler func(val sdk.ValAddress, rewards types.ValidatorOutstandingRewards) (stop bool))
iterate validator outstanding rewards
func (Keeper) IterateValidatorSlashEvents ¶
func (k Keeper) IterateValidatorSlashEvents(ctx context.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 context.Context, val sdk.ValAddress, startingHeight, endingHeight uint64, handler func(height uint64, event types.ValidatorSlashEvent) (stop bool), )
iterate over slash events between heights, inclusive
func (Keeper) SetDelegatorStartingInfo ¶
func (k Keeper) SetDelegatorStartingInfo(ctx context.Context, val sdk.ValAddress, del sdk.AccAddress, period types.DelegatorStartingInfo) error
set the starting info associated with a delegator
func (Keeper) SetDelegatorWithdrawAddr ¶
func (k Keeper) SetDelegatorWithdrawAddr(ctx context.Context, delAddr, withdrawAddr sdk.AccAddress) error
set the delegator withdraw address
func (Keeper) SetPreviousProposerConsAddr ¶
set the proposer public key for this block
func (Keeper) SetValidatorAccumulatedCommission ¶
func (k Keeper) SetValidatorAccumulatedCommission(ctx context.Context, val sdk.ValAddress, commission types.ValidatorAccumulatedCommission) error
set accumulated commission for a validator
func (Keeper) SetValidatorCurrentRewards ¶
func (k Keeper) SetValidatorCurrentRewards(ctx context.Context, val sdk.ValAddress, rewards types.ValidatorCurrentRewards) error
set current rewards for a validator
func (Keeper) SetValidatorHistoricalRewards ¶
func (k Keeper) SetValidatorHistoricalRewards(ctx context.Context, val sdk.ValAddress, period uint64, rewards types.ValidatorHistoricalRewards) error
set historical rewards for a particular period
func (Keeper) SetValidatorOutstandingRewards ¶
func (k Keeper) SetValidatorOutstandingRewards(ctx context.Context, val sdk.ValAddress, rewards types.ValidatorOutstandingRewards) error
set validator outstanding rewards
func (Keeper) SetValidatorSlashEvent ¶
func (k Keeper) SetValidatorSlashEvent(ctx context.Context, val sdk.ValAddress, height, period uint64, event types.ValidatorSlashEvent) error
set slash event for height
func (Keeper) SetWithdrawAddr ¶
func (k Keeper) SetWithdrawAddr(ctx context.Context, delegatorAddr, withdrawAddr sdk.AccAddress) error
SetWithdrawAddr sets a new address that will receive the rewards upon withdrawal
func (Keeper) WithdrawDelegationRewards ¶
func (k Keeper) WithdrawDelegationRewards(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, error)
withdraw rewards from a delegation
func (Keeper) WithdrawValidatorCommission ¶
func (k Keeper) WithdrawValidatorCommission(ctx context.Context, valAddr sdk.ValAddress) (sdk.Coins, error)
withdraw validator commission
type Querier ¶
type Querier struct {
Keeper
}
func NewQuerier ¶
func (Querier) CommunityPool ¶
func (k Querier) CommunityPool(ctx context.Context, req *types.QueryCommunityPoolRequest) (*types.QueryCommunityPoolResponse, error)
CommunityPool queries the community pool coins
func (Querier) DelegationRewards ¶
func (k Querier) DelegationRewards(ctx context.Context, req *types.QueryDelegationRewardsRequest) (*types.QueryDelegationRewardsResponse, error)
DelegationRewards the total rewards accrued by a delegation
func (Querier) DelegationTotalRewards ¶
func (k Querier) DelegationTotalRewards(ctx context.Context, req *types.QueryDelegationTotalRewardsRequest) (*types.QueryDelegationTotalRewardsResponse, error)
DelegationTotalRewards the total rewards accrued by a each validator
func (Querier) DelegatorValidators ¶
func (k Querier) DelegatorValidators(ctx context.Context, req *types.QueryDelegatorValidatorsRequest) (*types.QueryDelegatorValidatorsResponse, error)
DelegatorValidators queries the validators list of a delegator
func (Querier) DelegatorWithdrawAddress ¶
func (k Querier) DelegatorWithdrawAddress(ctx context.Context, req *types.QueryDelegatorWithdrawAddressRequest) (*types.QueryDelegatorWithdrawAddressResponse, error)
DelegatorWithdrawAddress queries Query/delegatorWithdrawAddress
func (Querier) Params ¶
func (k Querier) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries params of distribution module
func (Querier) ValidatorCommission ¶
func (k Querier) ValidatorCommission(ctx context.Context, req *types.QueryValidatorCommissionRequest) (*types.QueryValidatorCommissionResponse, error)
ValidatorCommission queries accumulated commission for a validator
func (Querier) ValidatorDistributionInfo ¶
func (k Querier) ValidatorDistributionInfo(ctx context.Context, req *types.QueryValidatorDistributionInfoRequest) (*types.QueryValidatorDistributionInfoResponse, error)
ValidatorDistributionInfo query validator's commission and self-delegation rewards
func (Querier) ValidatorOutstandingRewards ¶
func (k Querier) ValidatorOutstandingRewards(ctx context.Context, req *types.QueryValidatorOutstandingRewardsRequest) (*types.QueryValidatorOutstandingRewardsResponse, error)
ValidatorOutstandingRewards queries rewards of a validator address
func (Querier) ValidatorSlashes ¶
func (k Querier) ValidatorSlashes(ctx context.Context, req *types.QueryValidatorSlashesRequest) (*types.QueryValidatorSlashesResponse, error)
ValidatorSlashes queries slash events of a validator