keeper

package
v4.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.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,
	memKey storetypes.StoreKey,
	ps paramtypes.Subspace,

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

func (*Keeper) AddFixationRegistry

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

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) GetAllMetadata

func (k Keeper) GetAllMetadata(ctx sdk.Context) ([]types.ProviderMetadata, error)

func (Keeper) GetAllStakeEntriesCurrent

func (k Keeper) GetAllStakeEntriesCurrent(ctx sdk.Context) []types.StakeEntry

GetAllStakeEntriesCurrent gets all the current stake entries

func (Keeper) GetAllStakeEntriesCurrentForChainId

func (k Keeper) GetAllStakeEntriesCurrentForChainId(ctx sdk.Context, chainID string) []types.StakeEntry

GetAllStakeEntriesCurrentForChainId gets all the current stake entries for a specific chain

func (Keeper) GetAllStakeEntriesForEpoch

func (k Keeper) GetAllStakeEntriesForEpoch(ctx sdk.Context, epoch uint64) []types.StakeEntry

GetAllStakeEntriesForEpoch gets all the stake entries of a specific epoch

func (Keeper) GetAllStakeEntriesForEpochChainId

func (k Keeper) GetAllStakeEntriesForEpochChainId(ctx sdk.Context, epoch uint64, chainID string) []types.StakeEntry

GetAllStakeEntriesForEpochChainId gets all the stake entries of a specific epoch and a specific chain

func (Keeper) GetAllStakeEntriesForGenesis

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

GetAllStakeEntries gets all the stake entries of a specific epoch

func (Keeper) GetCurrentNextEpoch

func (k Keeper) GetCurrentNextEpoch(ctx sdk.Context) (nextEpoch uint64)

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) GetEpochHash

func (k Keeper) GetEpochHash(ctx sdk.Context, epoch uint64) []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) GetMetadata

func (k Keeper) GetMetadata(ctx sdk.Context, provider string) (types.ProviderMetadata, error)

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) GetStakeEntry

func (k Keeper) GetStakeEntry(ctx sdk.Context, epoch uint64, chainID string, provider string) (types.StakeEntry, bool)

GetStakeEntry gets a specific stake entry from the stake entries KV store Since the stake entries KV store's key includes the provider's stake (which is not known), we iterate over all the providers with the same epoch and chainID and compare the requested address to find the provider

func (Keeper) GetStakeEntryCurrent

func (k Keeper) GetStakeEntryCurrent(ctx sdk.Context, chainID string, provider string) (val types.StakeEntry, found bool)

GetStakeEntryCurrent returns a specific current stake entry (with both vault/provider)

func (Keeper) GetStakeEntryCurrentForChainIdByVault

func (k Keeper) GetStakeEntryCurrentForChainIdByVault(ctx sdk.Context, chainID string, vault string) (val types.StakeEntry, found bool)

GetStakeEntryCurrentForChainIdByVault gets all the current stake entry for a specific chain by vault address

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) Params

func (Keeper) PushFixatedParams

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

func (Keeper) RemoveAllStakeEntriesForEpoch

func (k Keeper) RemoveAllStakeEntriesForEpoch(ctx sdk.Context, epoch uint64)

RemoveAllStakeEntriesForEpoch removes all the stake entries of a specific epoch

func (Keeper) RemoveEpochDetails

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

RemoveEpochDetails removes epochDetails from the store

func (Keeper) RemoveEpochHash

func (k Keeper) RemoveEpochHash(ctx sdk.Context, epoch uint64)

func (Keeper) RemoveFixatedParams

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

RemoveFixatedParams removes a fixatedParams from the store

func (Keeper) RemoveMetadata

func (k Keeper) RemoveMetadata(ctx sdk.Context, provider string) error

func (Keeper) RemoveOldEpochData

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

func (Keeper) RemoveStakeEntryCurrent

func (k Keeper) RemoveStakeEntryCurrent(ctx sdk.Context, chainID string, provider string)

RemoveStakeEntryCurrent deletes a current stake entry from the store

func (Keeper) SetAllMetadata

func (k Keeper) SetAllMetadata(ctx sdk.Context, metadata []types.ProviderMetadata)

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) SetEpochHash

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

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) SetMetadata

func (k Keeper) SetMetadata(ctx sdk.Context, metadata types.ProviderMetadata)

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SetStakeEntry

func (k Keeper) SetStakeEntry(ctx sdk.Context, epoch uint64, stakeEntry types.StakeEntry)

Set stake entry

func (Keeper) SetStakeEntryCurrent

func (k Keeper) SetStakeEntryCurrent(ctx sdk.Context, stakeEntry types.StakeEntry)

SetStakeEntryCurrent sets a current stake entry in the store

func (Keeper) SetStakeEntryForMigrator

func (k Keeper) SetStakeEntryForMigrator(ctx sdk.Context, epoch uint64, stakeEntry types.StakeEntry, idx uint64)

Set stake entry

func (Keeper) StoreCurrentStakeEntries

func (k Keeper) StoreCurrentStakeEntries(ctx sdk.Context, epoch uint64)

StoreCurrentStakeEntries store the current stake entries in the epoch-prefixed stake entries store

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) Migrate7to8

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

Migrate7to8 transfers all the stake entries from the old stake storage to the new stake entries store StakeStorage is set to the stake entries store StakeStorageCurrent is set to the stake entries current store StakeStorageUnstake is deleted

func (Migrator) SetEpochHashForMigrator

func (m Migrator) SetEpochHashForMigrator(ctx sdk.Context, epoch uint64, hash []byte)

Jump to

Keyboard shortcuts

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