keeper

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const NONNEGATIVE_AMOUNTS_INVARIANT = "nonnegative vesting pool amounts"
View Source
const VestingAddress = "vestingAddr: "

Variables

This section is empty.

Functions

func CalculateWithdrawable

func CalculateWithdrawable(current time.Time, vestingPool types.VestingPool) math.Int

func ModuleAccountInvariant added in v1.1.0

func ModuleAccountInvariant(k Keeper) sdk.Invariant

ModuleAccountInvariant checks that sum on locked in vesting pools equals to module account balance

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

func NonNegativeVestingPoolAmountsInvariant added in v1.1.0

func NonNegativeVestingPoolAmountsInvariant(k Keeper) sdk.Invariant

NonNegativeCoinStateInvariant checks that any locked coins amount in vesting pools is non negative

func RegisterInvariants added in v1.1.0

func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)

RegisterInvariants register cfedistribution invariants

func VestingPoolConsistentDataInvariant added in v1.1.0

func VestingPoolConsistentDataInvariant(k Keeper) sdk.Invariant

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey storetypes.StoreKey,
	bank types.BankKeeper,
	staking types.StakingKeeper,
	account types.AccountKeeper,
	distribution types.DistributionKeeper,
	gov types.GovKeeper,
	authority string,
) *Keeper

func (Keeper) AddVestingPoolReservation added in v1.3.0

func (k Keeper) AddVestingPoolReservation(ctx sdk.Context, owner string, vestingPoolName string, reservationId uint64, amout math.Int) error

func (Keeper) AppendVestingAccountTrace added in v1.2.0

func (k Keeper) AppendVestingAccountTrace(
	ctx sdk.Context,
	vestingAccountTrace types.VestingAccountTrace,
) uint64

AppendVestingAccountTrace appends a vestingAccount in the store with a new id and update the count

func (Keeper) CreateVestingAccount

func (k Keeper) CreateVestingAccount(ctx sdk.Context, fromAddress string, toAddress string,
	amount sdk.Coins, startTime int64, endTime int64) error

func (Keeper) CreateVestingPool

func (k Keeper) CreateVestingPool(ctx sdk.Context, addr string, name string, amount math.Int, duration time.Duration, vestingType string) error

func (Keeper) DeleteAccountVestingPools added in v1.1.0

func (k Keeper) DeleteAccountVestingPools(ctx sdk.Context, accountAddress string) (accountVestingPools types.AccountVestingPools)

func (Keeper) Denom

func (k Keeper) Denom(ctx sdk.Context) (res string)

Denom returns the denom param

func (Keeper) EmitNewVestingPeriodFromVestingPool added in v1.3.0

func (k Keeper) EmitNewVestingPeriodFromVestingPool(ctx sdk.Context, owner string, toAddress string, vestingPoolName string, amount math.Int, periodId uint64, restartVesting bool)

func (Keeper) GenesisVestingsSummary added in v1.2.0

func (Keeper) GetAccountVestingPool added in v1.3.0

func (k Keeper) GetAccountVestingPool(ctx sdk.Context, accountAddress string, name string) (accountVestingPools types.AccountVestingPools, vestingPool *types.VestingPool, found bool)

func (Keeper) GetAccountVestingPools added in v1.1.0

func (k Keeper) GetAccountVestingPools(ctx sdk.Context, accountAddress string) (accountVestingPools types.AccountVestingPools, found bool)

func (Keeper) GetAllAccountVestingPools added in v1.1.0

func (k Keeper) GetAllAccountVestingPools(ctx sdk.Context) (list types.AccountVestingPoolsList)

func (Keeper) GetAllVestingAccountTrace added in v1.2.0

func (k Keeper) GetAllVestingAccountTrace(ctx sdk.Context) (list []types.VestingAccountTrace)

GetAllVestingAccountTrace returns all vestingAccount

func (Keeper) GetAllVestingTypes added in v1.1.0

func (k Keeper) GetAllVestingTypes(ctx sdk.Context) (vestingTypes types.VestingTypes)

GetAllVestingTypes returns all VestingTypes

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (p types.Params)

GetParams returns the current x/mint module parameters.

func (Keeper) GetVestingAccountTrace added in v1.2.0

func (k Keeper) GetVestingAccountTrace(ctx sdk.Context, address string) (val types.VestingAccountTrace, found bool)

GetVestingAccountById returns a vestingAccount from its id

func (Keeper) GetVestingAccountTraceById added in v1.2.0

func (k Keeper) GetVestingAccountTraceById(ctx sdk.Context, id uint64) (val types.VestingAccountTrace, found bool)

GetVestingAccountTraceById returns a vestingAccount from its id

func (Keeper) GetVestingAccountTraceCount added in v1.2.0

func (k Keeper) GetVestingAccountTraceCount(ctx sdk.Context) uint64

GetVestingAccountTraceCount get the total number of vestingAccount

func (Keeper) Logger

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

func (Keeper) MustGetVestingPoolReservation added in v1.3.0

func (k Keeper) MustGetVestingPoolReservation(ctx sdk.Context, owner string, vestingPoolName string, reservationId uint64) (*types.VestingPoolReservation, error)

func (Keeper) MustGetVestingType added in v1.3.0

func (k Keeper) MustGetVestingType(ctx sdk.Context, name string) (vestingType *types.VestingType, err error)

get the vesting type by name

func (Keeper) MustGetVestingTypeForVestingPool added in v1.3.0

func (k Keeper) MustGetVestingTypeForVestingPool(ctx sdk.Context, address string,
	vestingPoolName string) (*types.VestingType, error)

get the vesting type by name

func (Keeper) Params

func (Keeper) RemoveVestingAccountTrace added in v1.2.0

func (k Keeper) RemoveVestingAccountTrace(ctx sdk.Context, address string)

RemoveVestingAccountTrace removes a vestingAccount from the store

func (Keeper) RemoveVestingPoolReservation added in v1.3.0

func (k Keeper) RemoveVestingPoolReservation(ctx sdk.Context, owner string, vestingPoolName string, reservationId uint64, amout math.Int) error

func (Keeper) RemoveVestingType added in v1.2.0

func (k Keeper) RemoveVestingType(ctx sdk.Context, name string)

get the vesting type by name

func (Keeper) SendReservedToNewVestingAccount added in v1.3.0

func (k Keeper) SendReservedToNewVestingAccount(ctx sdk.Context, owner string, toAddr string, vestingPoolName string, amount math.Int, reservationId uint64,
	free sdk.Dec, lockupPeriod time.Duration, vestingPeriod time.Duration) error

The SendReservedToNewVestingAccount function sends reserved tokens from the vesting pool to a new vesting account. The function validates whether the lockupPeriod and vestingPeriod are greater than or equal to the vesting periods specified in the vesting type. Additionally, the free (sdk.Dec) is validated, and if it exceeds the value specified in the vesting type, instead of returning an error, it is set to the free value specified in the vesting type.

func (Keeper) SendToNewVestingAccount

func (k Keeper) SendToNewVestingAccount(ctx sdk.Context, owner string, toAddr string, vestingPoolName string, amount math.Int, restartVesting bool) error

func (Keeper) SendToPeriodicContinuousVestingAccountFromModule added in v1.3.0

func (k Keeper) SendToPeriodicContinuousVestingAccountFromModule(ctx sdk.Context, moduleName string, userAddress string, amount sdk.Coins,
	free sdk.Dec, startTime int64, endTime int64) (periodId uint64, periodExists bool, err error)

func (Keeper) SetAccountVestingPools added in v1.1.0

func (k Keeper) SetAccountVestingPools(ctx sdk.Context, accountVestingPools types.AccountVestingPools)

func (Keeper) SetAccountVestingPoolsAndVestingAccountTrace added in v1.3.0

func (k Keeper) SetAccountVestingPoolsAndVestingAccountTrace(ctx sdk.Context, toAddr string, periodId uint64, periodExists bool, vestingPool *types.VestingPool)

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, p types.Params) error

SetParams sets the x/mint module parameters.

func (Keeper) SetVestingAccountTrace added in v1.2.0

func (k Keeper) SetVestingAccountTrace(ctx sdk.Context, vestingAccountTrace types.VestingAccountTrace)

SetVestingAccountTrace set a specific vestingAccount in the store

func (Keeper) SetVestingAccountTraceCount added in v1.2.0

func (k Keeper) SetVestingAccountTraceCount(ctx sdk.Context, count uint64)

SetVestingAccountTraceCount set the total number of vestingAccount

func (Keeper) SetVestingType added in v1.1.0

func (k Keeper) SetVestingType(ctx sdk.Context, vestingType types.VestingType)

set the vesting type

func (Keeper) SetVestingTypes

func (k Keeper) SetVestingTypes(ctx sdk.Context, vestingTypes types.VestingTypes)

set the vesting types

func (Keeper) UnlockUnbondedContinuousVestingAccountCoins added in v1.2.0

func (k Keeper) UnlockUnbondedContinuousVestingAccountCoins(ctx sdk.Context, ownerAddress sdk.AccAddress, amountToUnlock sdk.Coins) (*vestingtypes.ContinuousVestingAccount, error)

func (Keeper) VestingsSummary added in v1.1.0

func (Keeper) WithdrawAllAvailable

func (k Keeper) WithdrawAllAvailable(ctx sdk.Context, owner string) (withdrawn sdk.Coin, returnedError error)

type Migrator added in v1.1.0

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

Migrator is a struct for handling in-place store migrations.

func NewMigrator added in v1.1.0

func NewMigrator(keeper Keeper, legacySubspace subspace.Subspace) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate1to2 added in v1.1.0

func (m Migrator) Migrate1to2(ctx sdk.Context) error

Migrate2to3 migrates from version 1 to 2.

func (Migrator) Migrate2to3 added in v1.2.0

func (m Migrator) Migrate2to3(ctx sdk.Context) error

Migrate2to3 migrates from version 2 to 3.

type Summary added in v1.2.0

type Summary struct {
	VestingAllAmount        math.Int
	VestingInPoolsAmount    math.Int
	VestingInAccountsAmount math.Int
	DelegatedVestingAmount  math.Int
}

Jump to

Keyboard shortcuts

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