keeper

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: AGPL-3.0 Imports: 21 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) StorageProviderExitable

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

func (Keeper) SwapOutAsPrimarySP

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

func (Keeper) SwapOutAsSecondarySP

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

Jump to

Keyboard shortcuts

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