keeper

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: AGPL-3.0 Imports: 24 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,
	tStoreKey storetypes.StoreKey,
	authority string,
	spKeeper types.SpKeeper,
	accountKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper,
	paymentKeeper types.PaymentKeeper,
) *Keeper

func (Keeper) BatchSetGVGStatisticsWithinSP

func (k Keeper) BatchSetGVGStatisticsWithinSP(ctx sdk.Context, gvgsStatisticsWithinSP []*types.GVGStatisticsWithinSP)

func (Keeper) CompleteSwapIn added in v1.3.0

func (k Keeper) CompleteSwapIn(ctx sdk.Context, gvgFamilyID uint32, gvgID uint32, successorSP *sptypes.StorageProvider) error

func (Keeper) CompleteSwapOut

func (k Keeper) CompleteSwapOut(ctx sdk.Context, gvgFamilyID uint32, gvgIDs []uint32, successorSP *sptypes.StorageProvider) error

func (Keeper) DeleteGVG

func (k Keeper) DeleteGVG(ctx sdk.Context, primarySp *sptypes.StorageProvider, gvgID uint32) error

func (Keeper) DeleteSpecificGVGFamilyStatisticsFromSP added in v1.6.0

func (k Keeper) DeleteSpecificGVGFamilyStatisticsFromSP(ctx sdk.Context, spID uint32, familyID uint32)

func (Keeper) DeleteSwapInInfo added in v1.3.0

func (k Keeper) DeleteSwapInInfo(ctx sdk.Context, gvgFamilyID, gvgID uint32, successorSPID uint32) error

func (Keeper) DeleteSwapOutInfo

func (k Keeper) DeleteSwapOutInfo(ctx sdk.Context, gvgFamilyID uint32, gvgIDs []uint32, spID uint32) error

func (Keeper) DepositDenomForGVG

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

func (Keeper) DeriveVirtualPaymentAccount

func (k Keeper) DeriveVirtualPaymentAccount(groupType string, id uint32) sdk.AccAddress

func (Keeper) GVGStakingPerBytes

func (k Keeper) GVGStakingPerBytes(ctx sdk.Context) (res math.Int)

func (Keeper) GVGStatistics added in v1.3.0

func (Keeper) GenNextGVGFamilyID

func (k Keeper) GenNextGVGFamilyID(ctx sdk.Context) uint32

func (Keeper) GenNextGVGID

func (k Keeper) GenNextGVGID(ctx sdk.Context) uint32

func (Keeper) GetAndCheckGVGFamilyAvailableForNewBucket

func (k Keeper) GetAndCheckGVGFamilyAvailableForNewBucket(ctx sdk.Context, familyID uint32) (*types.GlobalVirtualGroupFamily, error)

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

func (Keeper) GetAvailableStakingTokens

func (k Keeper) GetAvailableStakingTokens(ctx sdk.Context, gvg *types.GlobalVirtualGroup) math.Int

func (Keeper) GetGVG

func (k Keeper) GetGVG(ctx sdk.Context, gvgID uint32) (*types.GlobalVirtualGroup, bool)

func (Keeper) GetGVGFamily

func (k Keeper) GetGVGFamily(ctx sdk.Context, familyID uint32) (*types.GlobalVirtualGroupFamily, bool)

func (Keeper) GetGVGFamilyStatisticsWithinSP added in v1.6.0

func (k Keeper) GetGVGFamilyStatisticsWithinSP(ctx sdk.Context, spID uint32) (*types.GVGFamilyStatisticsWithinSP, bool)

func (Keeper) GetGVGStatisticsWithinSP

func (k Keeper) GetGVGStatisticsWithinSP(ctx sdk.Context, spID uint32) (*types.GVGStatisticsWithinSP, bool)

func (Keeper) GetGlobalVirtualFamilyTotalStakingAndStoredSize

func (k Keeper) GetGlobalVirtualFamilyTotalStakingAndStoredSize(ctx sdk.Context, gvgFamily *types.GlobalVirtualGroupFamily) (uint64, uint64, error)

func (Keeper) GetGlobalVirtualGroupIfAvailable

func (k Keeper) GetGlobalVirtualGroupIfAvailable(ctx sdk.Context, gvgID uint32, expectedStoreSize uint64) (*types.GlobalVirtualGroup, error)

func (Keeper) GetOrCreateEmptyGVGFamily

func (k Keeper) GetOrCreateEmptyGVGFamily(ctx sdk.Context, familyID uint32, primarySPID uint32) (*types.GlobalVirtualGroupFamily, error)

func (Keeper) GetOrCreateGVGFamilyStatisticsWithinSP added in v1.6.0

func (k Keeper) GetOrCreateGVGFamilyStatisticsWithinSP(ctx sdk.Context, spID uint32) *types.GVGFamilyStatisticsWithinSP

func (Keeper) GetOrCreateGVGStatisticsWithinSP

func (k Keeper) GetOrCreateGVGStatisticsWithinSP(ctx sdk.Context, spID uint32) *types.GVGStatisticsWithinSP

func (Keeper) GetParams

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

GetParams returns the current sp module parameters.

func (Keeper) GetStoreSizeOfFamily

func (k Keeper) GetStoreSizeOfFamily(ctx sdk.Context, gvgFamily *types.GlobalVirtualGroupFamily) uint64

GetStoreSizeOfFamily Rather than calculating the stored size of a Global Virtual Group Family (GVGF) in real-time, it is preferable to calculate it once during the creation of a Global Virtual Group (GVG). This approach is favored because GVG creation is infrequent and occurs with low frequency.

func (Keeper) GetSwapInInfo added in v1.3.0

func (k Keeper) GetSwapInInfo(ctx sdk.Context, globalVirtualGroupFamilyId, globalVirtualGroupId uint32) (*types.SwapInInfo, bool)

func (Keeper) GetTotalStakingStoreSize

func (k Keeper) GetTotalStakingStoreSize(ctx sdk.Context, gvg *types.GlobalVirtualGroup) uint64

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)

func (Keeper) Logger

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

func (Keeper) MaxGlobalVirtualGroupNumPerFamily

func (k Keeper) MaxGlobalVirtualGroupNumPerFamily(ctx sdk.Context) (res uint32)

func (Keeper) MaxStoreSizePerFamily

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

func (Keeper) MigrateGlobalVirtualGroupFamiliesForSP added in v1.6.0

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

func (Keeper) MustGetGVGFamilyStatisticsWithinSP added in v1.6.0

func (k Keeper) MustGetGVGFamilyStatisticsWithinSP(ctx sdk.Context, spID uint32) *types.GVGFamilyStatisticsWithinSP

func (Keeper) MustGetGVGStatisticsWithinSP

func (k Keeper) MustGetGVGStatisticsWithinSP(ctx sdk.Context, spID uint32) *types.GVGStatisticsWithinSP

func (Keeper) Params

func (Keeper) SetGVG

func (k Keeper) SetGVG(ctx sdk.Context, gvg *types.GlobalVirtualGroup)

func (Keeper) SetGVGAndEmitUpdateEvent

func (k Keeper) SetGVGAndEmitUpdateEvent(ctx sdk.Context, gvg *types.GlobalVirtualGroup) error

func (Keeper) SetGVGFamily

func (k Keeper) SetGVGFamily(ctx sdk.Context, gvgFamily *types.GlobalVirtualGroupFamily)

func (Keeper) SetGVGFamilyAndEmitUpdateEvent

func (k Keeper) SetGVGFamilyAndEmitUpdateEvent(ctx sdk.Context, gvgFamily *types.GlobalVirtualGroupFamily) error

func (Keeper) SetGVGFamilyStatisticsWithinSP added in v1.6.0

func (k Keeper) SetGVGFamilyStatisticsWithinSP(ctx sdk.Context, vgfStatisticsWithinSP *types.GVGFamilyStatisticsWithinSP)

func (Keeper) SetGVGStatisticsWithSP

func (k Keeper) SetGVGStatisticsWithSP(ctx sdk.Context, gvgsStatisticsWithinSP *types.GVGStatisticsWithinSP)

func (Keeper) SetParams

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

SetParams sets the params of sp module

func (*Keeper) SetStorageKeeper added in v1.1.0

func (k *Keeper) SetStorageKeeper(storageKeeper types.StorageKeeper)

func (Keeper) SetSwapOutInfo

func (k Keeper) SetSwapOutInfo(ctx sdk.Context, gvgFamilyID uint32, gvgIDs []uint32, spID uint32, successorSPID uint32) error

func (Keeper) SettleAndDistributeGVG

func (k Keeper) SettleAndDistributeGVG(ctx sdk.Context, gvg *types.GlobalVirtualGroup) error

func (Keeper) SettleAndDistributeGVGFamily

func (k Keeper) SettleAndDistributeGVGFamily(ctx sdk.Context, sp *sptypes.StorageProvider, family *types.GlobalVirtualGroupFamily) error

func (Keeper) SpConcurrentExitNum added in v1.3.0

func (k Keeper) SpConcurrentExitNum(ctx sdk.Context) (res uint32)

func (Keeper) StorageProviderExitable

func (k Keeper) StorageProviderExitable(ctx sdk.Context, spID uint32) error

func (Keeper) SwapAsPrimarySP added in v1.3.0

func (k Keeper) SwapAsPrimarySP(ctx sdk.Context, primarySP, successorSP *sptypes.StorageProvider, familyID uint32, swapIn bool) error

func (Keeper) SwapIn added in v1.3.0

func (k Keeper) SwapIn(ctx sdk.Context, gvgFamilyID uint32, gvgID uint32, successorSPID uint32, targetSP *sptypes.StorageProvider, expirationTime int64) error

func (Keeper) SwapInInfo added in v1.3.0

func (Keeper) SwapInValidityPeriod added in v1.3.0

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

func (Keeper) SwapOutAsSecondarySP

func (k Keeper) SwapOutAsSecondarySP(ctx sdk.Context, secondarySP, successorSP *sptypes.StorageProvider, gvgID uint32) error

type Migrator added in v1.3.0

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

func NewMigrator added in v1.3.0

func NewMigrator(keeper Keeper) Migrator

func (Migrator) MigrateV1toV2 added in v1.3.0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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