func (k Keeper) GetAllVestings(ctx sdk.Context) (vestings []types.Vesting) {
	appendVesting := func(vesting types.Vesting) (stop bool) {
		vestings = append(vestings, vesting)
		return false
	}
	k.IterateVestings(ctx, appendVesting)
	return
}
GetAllVestings returns all vestings in the supplyKeeper.
package keeper
import (
	"fmt"
	"github.com/tendermint/tendermint/libs/log"
	"github.com/Dipper-Labs/Dipper-Protocol/app/v0/supply/exported"
	"github.com/Dipper-Labs/Dipper-Protocol/app/v0/supply/internal/types"
	"github.com/Dipper-Labs/Dipper-Protocol/codec"
	sdk "github.com/Dipper-Labs/Dipper-Protocol/types"
)
type Keeper struct {
	cdc       *codec.Codec
	storeKey  sdk.StoreKey
	ak        types.AccountKeeper
	bk        types.BankKeeper
	permAddrs map[string]types.PermissionsForAddress
}
func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, ak types.AccountKeeper, bk types.BankKeeper, maccPerms map[string][]string) Keeper {
	permAddrs := make(map[string]types.PermissionsForAddress)
	for name, perms := range maccPerms {
		permAddrs[name] = types.NewPermissionsForAddress(name, perms)
	}
	return Keeper{
		cdc:       cdc,
		storeKey:  key,
		ak:        ak,
		bk:        bk,
		permAddrs: permAddrs,
	}
}
func (k Keeper) Logger(ctx sdk.Context) log.Logger {
	return ctx.Logger().With("module", fmt.Sprintf("modules/%s", types.ModuleName))
}
func (k Keeper) GetSupply(ctx sdk.Context) (supply exported.SupplyI) {
	store := ctx.KVStore(k.storeKey)
	b := store.Get(SupplyKey)
	if b == nil {
		panic("stored supply should not have been nil")
	}
	k.cdc.MustUnmarshalBinaryLengthPrefixed(b, &supply)
	return
}
func (k Keeper) SetSupply(ctx sdk.Context, supply exported.SupplyI) {
	store := ctx.KVStore(k.storeKey)
	b := k.cdc.MustMarshalBinaryLengthPrefixed(supply)
	store.Set(SupplyKey, b)
}
func (k Keeper) ValidatePermissions(macc exported.ModuleAccountI) error {
	permAddr := k.permAddrs[macc.GetName()]
	for _, perm := range macc.GetPermissions() {
		if !permAddr.HasPermission(perm) {
			return fmt.Errorf("invalid module permission %s", perm)
		}
	}
	return nil
}
func (k Keeper) GetVesting(ctx sdk.Context, addr sdk.AccAddress) (exist bool, vesting types.Vesting) {
	store := ctx.KVStore(k.storeKey)
	bz := store.Get(VestingStoreKey(addr))
	if bz == nil {
		return false, vesting
	}
	err := k.cdc.UnmarshalBinaryBare(bz, &vesting)
	if err != nil {
		panic(err)
	}
	return true, vesting
}
func (k Keeper) SetVesting(ctx sdk.Context, vesting types.Vesting) {
	store := ctx.KVStore(k.storeKey)
	bz, err := k.cdc.MarshalBinaryBare(vesting)
	if err != nil {
		panic(err)
	}
	store.Set(VestingStoreKey(vesting.Address), bz)
}