Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Keeper ¶
type Keeper struct { dstrkeeper.Keeper // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeService store.KVStoreService, ak dstrtypes.AccountKeeper, bk dstrtypes.BankKeeper, sk dstrtypes.StakingKeeper, feeCollectorName, authority string, ) Keeper
NewKeeper creates a new distribution Keeper instance, embedding or wrapping a real distribution keeper.
Typically, we don't need to do this but since the original distribution keeper doesn't expose private fields that we need access to, we "hijack" them by re-creating a constructor to capture those private fields before passing them onto the real constructor.
func (Keeper) WithdrawDelegationRewards ¶
func (k Keeper) WithdrawDelegationRewards(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, error)
WithdrawDelegationRewards override the original function to "extend" functionality, by prohibiting withdrawal of rewards if the delegation account is a vesting account.
Specifically, we prohibit withdrawal of rewards if the delegation account is has ANY tokens left that are still escrowed/vesting.
Note, this is just an example of how a chain can prohibit withdrawal of rewards for vesting accounts. A more sophisticated implementation could allow for withdrawal up to a certain threshold or perhaps based on a function of total vested so far. Regardless, the example shows how any such mechanism can be implemented.