keeper

package
v0.23.5 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 20 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,
	memKey storetypes.StoreKey,
	ps paramtypes.Subspace,

	bankKeeper types.BankKeeper, accountKeeper types.AccountKeeper, specKeeper types.SpecKeeper,
) *Keeper

func (*Keeper) AddFixationRegistry

func (k *Keeper) AddFixationRegistry(fixationKey string, getParamFunction func(sdk.Context) any)

func (Keeper) AppendStakeEntryCurrent

func (k Keeper) AppendStakeEntryCurrent(ctx sdk.Context, chainID string, stakeEntry types.StakeEntry)

func (Keeper) AppendUnstakeEntry

func (k Keeper) AppendUnstakeEntry(ctx sdk.Context, stakeEntry types.StakeEntry, unstakeHoldBlocks uint64) error

func (Keeper) BeginBlock

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

func (Keeper) BlockInEpoch

func (k Keeper) BlockInEpoch(ctx sdk.Context, block uint64) (res uint64, err error)

func (Keeper) BlocksToSave

func (k Keeper) BlocksToSave(ctx sdk.Context, block uint64) (res uint64, erro error)

func (Keeper) BlocksToSaveRaw

func (k Keeper) BlocksToSaveRaw(ctx sdk.Context) (res uint64)

func (Keeper) CleanAllOlderFixatedParams

func (k Keeper) CleanAllOlderFixatedParams(ctx sdk.Context, startIdx uint64)

func (Keeper) CleanOlderFixatedParams

func (k Keeper) CleanOlderFixatedParams(ctx sdk.Context, fixationKey string, startIdx uint64)

func (Keeper) EpochBlocks

func (k Keeper) EpochBlocks(ctx sdk.Context, block uint64) (res uint64, err error)

EpochBlocks returns the EpochBlocks fixated param

func (Keeper) EpochBlocksRaw

func (k Keeper) EpochBlocksRaw(ctx sdk.Context) (res uint64)

EpochBlocks returns the EpochBlocks param

func (Keeper) EpochStart

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

Function that calls all the functions that are supposed to run in epoch start

func (Keeper) EpochsToSave

func (k Keeper) EpochsToSave(ctx sdk.Context, block uint64) (res uint64, err error)

EpochsToSave returns the EpochsToSave fixated param

func (Keeper) EpochsToSaveRaw

func (k Keeper) EpochsToSaveRaw(ctx sdk.Context) (res uint64)

EpochsToSaveRaw returns the EpochsToSave param

func (Keeper) FixateParams

func (k Keeper) FixateParams(ctx sdk.Context, block uint64)

func (Keeper) GetAllFixatedParams

func (k Keeper) GetAllFixatedParams(ctx sdk.Context) (list []types.FixatedParams)

GetAllFixatedParams returns all fixatedParams

func (Keeper) GetAllStakeStorage

func (k Keeper) GetAllStakeStorage(ctx sdk.Context) (list []types.StakeStorage)

GetAllStakeStorage returns all stakeStorage

func (Keeper) GetDeletedEpochs

func (k Keeper) GetDeletedEpochs(ctx sdk.Context) []uint64

func (Keeper) GetEarliestEpochStart

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

func (Keeper) GetEpochDetails

func (k Keeper) GetEpochDetails(ctx sdk.Context) (val types.EpochDetails, found bool)

GetEpochDetails returns epochDetails

func (Keeper) GetEpochStakeEntries

func (k Keeper) GetEpochStakeEntries(ctx sdk.Context, block uint64, chainID string) (entries []types.StakeEntry, found bool, epochHash []byte)

func (Keeper) GetEpochStart

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

func (Keeper) GetEpochStartForBlock

func (k Keeper) GetEpochStartForBlock(ctx sdk.Context, block uint64) (epochStart, blockInEpoch uint64, err error)

GetEpochStartForBlock gets a session start supports one param change

func (Keeper) GetFixatedParams

func (k Keeper) GetFixatedParams(
	ctx sdk.Context,
	index string,
) (val types.FixatedParams, found bool)

GetFixatedParams returns a fixatedParams from its index

func (Keeper) GetFixatedParamsForBlock

func (k Keeper) GetFixatedParamsForBlock(ctx sdk.Context, fixationKey string, block uint64) (fixated types.FixatedParams, err error)

func (*Keeper) GetFixationRegistries

func (k *Keeper) GetFixationRegistries() map[string]func(sdk.Context) any

func (Keeper) GetNextEpoch

func (k Keeper) GetNextEpoch(ctx sdk.Context, block uint64) (nextEpoch uint64, erro error)

func (Keeper) GetParamForBlock

func (k Keeper) GetParamForBlock(ctx sdk.Context, fixationKey string, block uint64, param any) error

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) GetPreviousEpochStartForBlock

func (k Keeper) GetPreviousEpochStartForBlock(ctx sdk.Context, block uint64) (previousEpochStart uint64, erro error)

func (Keeper) GetStakeEntryByAddressCurrent

func (k Keeper) GetStakeEntryByAddressCurrent(ctx sdk.Context, chainID string, address sdk.AccAddress) (value types.StakeEntry, found bool, index uint64)

func (Keeper) GetStakeEntryByAddressFromStorage

func (k Keeper) GetStakeEntryByAddressFromStorage(ctx sdk.Context, stakeStorage types.StakeStorage, address sdk.AccAddress) (value types.StakeEntry, found bool, index uint64)

func (Keeper) GetStakeEntryForAllProvidersEpoch

func (k Keeper) GetStakeEntryForAllProvidersEpoch(ctx sdk.Context, chainID string, epoch uint64) (entrys *[]types.StakeEntry, err error)

func (Keeper) GetStakeEntryForProviderEpoch

func (k Keeper) GetStakeEntryForProviderEpoch(ctx sdk.Context, chainID string, selectedProvider sdk.AccAddress, epoch uint64) (entry *types.StakeEntry, err error)

func (Keeper) GetStakeStorage

func (k Keeper) GetStakeStorage(
	ctx sdk.Context,
	index string,
) (val types.StakeStorage, found bool)

GetStakeStorage returns a stakeStorage from its index

func (Keeper) GetStakeStorageCurrent

func (k Keeper) GetStakeStorageCurrent(ctx sdk.Context, chainID string) (types.StakeStorage, bool)

used to get the latest

func (Keeper) GetStakeStorageUnstake

func (k Keeper) GetStakeStorageUnstake(ctx sdk.Context) (types.StakeStorage, bool)

used to get the unstaking entries

func (Keeper) IsEpochStart

func (k Keeper) IsEpochStart(ctx sdk.Context) (res bool)

return if this block is an epoch start

func (Keeper) LatestFixatedParams

func (k Keeper) LatestFixatedParams(ctx sdk.Context, fixationKey string) (fixation types.FixatedParams, found bool)

func (Keeper) LatestParamChange

func (k Keeper) LatestParamChange(ctx sdk.Context) (res uint64)

func (Keeper) Logger

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

func (Keeper) ModifyStakeEntryCurrent

func (k Keeper) ModifyStakeEntryCurrent(ctx sdk.Context, chainID string, stakeEntry types.StakeEntry, removeIndex uint64)

func (Keeper) ModifyUnstakeEntry

func (k Keeper) ModifyUnstakeEntry(ctx sdk.Context, stakeEntry types.StakeEntry, removeIndex uint64)

func (Keeper) Params

func (Keeper) PopUnstakeEntries

func (k Keeper) PopUnstakeEntries(ctx sdk.Context, block uint64) (value []types.StakeEntry)

Returns the unstaking Entry if its stakeAppliedBlock is lower than the provided block

func (Keeper) PushFixatedParams

func (k Keeper) PushFixatedParams(ctx sdk.Context, block, limit uint64)

func (Keeper) RemoveEpochDetails

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

RemoveEpochDetails removes epochDetails from the store

func (Keeper) RemoveFixatedParams

func (k Keeper) RemoveFixatedParams(
	ctx sdk.Context,
	index string,
)

RemoveFixatedParams removes a fixatedParams from the store

func (Keeper) RemoveOldEpochData

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

func (Keeper) RemoveStakeEntryCurrent

func (k Keeper) RemoveStakeEntryCurrent(ctx sdk.Context, chainID string, idx uint64) error

func (Keeper) RemoveStakeStorage

func (k Keeper) RemoveStakeStorage(
	ctx sdk.Context,
	index string,
)

RemoveStakeStorage removes a stakeStorage from the store

func (Keeper) RemoveStakeStorageByBlockAndChain

func (k Keeper) RemoveStakeStorageByBlockAndChain(ctx sdk.Context, block uint64, chainID string)

func (Keeper) SetEarliestEpochStart

func (k Keeper) SetEarliestEpochStart(ctx sdk.Context, block uint64, deletedEpochs []uint64)

func (Keeper) SetEpochDetails

func (k Keeper) SetEpochDetails(ctx sdk.Context, epochDetails types.EpochDetails)

SetEpochDetails set epochDetails in the store

func (Keeper) SetEpochDetailsStart

func (k Keeper) SetEpochDetailsStart(ctx sdk.Context, block uint64)

func (Keeper) SetFixatedParams

func (k Keeper) SetFixatedParams(ctx sdk.Context, fixatedParams types.FixatedParams)

SetFixatedParams set a specific fixatedParams in the store from its index

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SetStakeStorage

func (k Keeper) SetStakeStorage(ctx sdk.Context, stakeStorage types.StakeStorage)

SetStakeStorage set a specific stakeStorage in the store from its index

func (Keeper) SetStakeStorageCurrent

func (k Keeper) SetStakeStorageCurrent(ctx sdk.Context, chainID string, stakeStorage types.StakeStorage)

func (Keeper) SetStakeStorageUnstake

func (k Keeper) SetStakeStorageUnstake(ctx sdk.Context, stakeStorage types.StakeStorage)

func (Keeper) SetUnstakeHoldBlocksStaticRaw

func (k Keeper) SetUnstakeHoldBlocksStaticRaw(ctx sdk.Context, unstakeHoldBlocksStatic uint64)

UnstakeHoldBlocksRaw sets the UnstakeHoldBlocks param

func (Keeper) StakeStorageKey

func (k Keeper) StakeStorageKey(block uint64, chainID string) string

func (Keeper) StoreCurrentEpochStakeStorage

func (k Keeper) StoreCurrentEpochStakeStorage(ctx sdk.Context, block uint64)

takes the current stake storage and puts it in epoch storage

func (Keeper) UnstakeEntryByAddress

func (k Keeper) UnstakeEntryByAddress(ctx sdk.Context, address sdk.AccAddress) (value types.StakeEntry, found bool, index uint64)

func (Keeper) UnstakeHoldBlocks

func (k Keeper) UnstakeHoldBlocks(ctx sdk.Context, block uint64) (res uint64)

func (Keeper) UnstakeHoldBlocksRaw

func (k Keeper) UnstakeHoldBlocksRaw(ctx sdk.Context) (res uint64)

UnstakeHoldBlocksRaw returns the UnstakeHoldBlocks param

func (Keeper) UnstakeHoldBlocksStatic

func (k Keeper) UnstakeHoldBlocksStatic(ctx sdk.Context, block uint64) (res uint64)

func (Keeper) UnstakeHoldBlocksStaticRaw

func (k Keeper) UnstakeHoldBlocksStaticRaw(ctx sdk.Context) (res uint64)

UnstakeHoldBlocksRaw returns the UnstakeHoldBlocks param

func (*Keeper) UpdateEarliestEpochstart

func (k *Keeper) UpdateEarliestEpochstart(ctx sdk.Context)

type Migrator

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

func NewMigrator

func NewMigrator(keeper Keeper) Migrator

func (Migrator) Migrate2to3

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

Migrate2to3 implements store migration from v2 to v3: - refund all clients stake - migrate providers to a new key

func (Migrator) Migrate3to4

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

Migrate3to4 implements store migration from v3 to v4: set geolocation to int32

func (Migrator) Migrate4to5

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

Migrate4to5 implements store migration from v4 to v5: - initialize DelegateTotal, DelegateLimit, DelegateCommission

Jump to

Keyboard shortcuts

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