keeper

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2023 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey storetypes.StoreKey,
	bankKeeper types.BankKeeper,
	blockTimeKeeper types.BlockTimeKeeper,
	authorities []string,
) *Keeper

func (Keeper) DeleteVestEntry

func (k Keeper) DeleteVestEntry(
	ctx sdk.Context,
	vesterAccount string,
) (
	err error,
)

func (Keeper) GetAllVestEntries

func (k Keeper) GetAllVestEntries(ctx sdk.Context) (
	list []types.VestEntry,
)

func (Keeper) GetVestEntry

func (k Keeper) GetVestEntry(ctx sdk.Context, vesterAccount string) (
	val types.VestEntry,
	err error,
)

func (Keeper) HasAuthority

func (k Keeper) HasAuthority(authority string) bool

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

func (Keeper) ProcessVesting

func (k Keeper) ProcessVesting(ctx sdk.Context)

Process vesting for all vest entries. Intended to be called in BeginBlocker. For each vest entry: 1. Return if `block_time <= vest_entry.start_time` (vesting has not started yet) 2. Return if `prev_block_time >= vest_entry.end_time` (vesting has ended) 3. Transfer the following amount of tokens from vester account to treasury account:

	  min(
		(block_time - last_vest_time) / (end_time - last_vest_time),
	 	1
	  ) * vester_account_balance

  where `last_vest_time = max(start_time, prev_block_time)`

func (Keeper) SetVestEntry

func (k Keeper) SetVestEntry(
	ctx sdk.Context,
	entry types.VestEntry,
) (
	err error,
)

func (Keeper) VestEntry

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL