Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClaimStakingRewardsIfNecessary ¶
func ClaimStakingRewardsIfNecessary( ctx sdk.Context, bankKeeper BankKeeper, distributionKeeper DistributionKeeper, stakingKeeper StakingKeeper, addr sdk.AccAddress, amount sdk.Coins, ) error
ClaimStakingRewardsIfNecessary checks if the given address has enough balance to cover the given amount. If not, it attempts to claim enough staking rewards to cover the amount.
func ClaimSufficientStakingRewards ¶
func ClaimSufficientStakingRewards( ctx sdk.Context, stakingKeeper StakingKeeper, distributionKeeper DistributionKeeper, addr sdk.AccAddress, amount sdk.Coin, ) error
ClaimSufficientStakingRewards checks if the account has enough staking rewards unclaimed to cover the given amount. If more than enough rewards are unclaimed, only those up to the given amount are claimed.
Types ¶
type BankKeeper ¶
type BankKeeper interface {
GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
}
BankKeeper defines the exposed interface for using functionality of the bank keeper in the context of the AnteHandler utils package.
type DistributionKeeper ¶
type DistributionKeeper interface {
WithdrawDelegationRewards(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, error)
}
DistributionKeeper defines the exposed interface for using functionality of the distribution keeper in the context of the AnteHandler utils package.
type StakingKeeper ¶
type StakingKeeper interface { BondDenom(ctx sdk.Context) string IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress, fn func(index int64, delegation stakingtypes.DelegationI) (stop bool)) }
StakingKeeper defines the exposed interface for using functionality of the staking keeper in the context of the AnteHandler utils package.