keeper

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLastDaysOfTheMonth added in v0.2.4

func IsLastDaysOfTheMonth(now time.Time, days int) bool

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,
	key storetypes.StoreKey,
	ak types.AccountKeeper,
	bk types.BankKeeper,
	azk types.AuthzKeeper,
	authority string,

) *Keeper

func (Keeper) CheckDepositAuthorization

func (k Keeper) CheckDepositAuthorization(ctx sdk.Context, grantee sdk.AccAddress, granter sdk.AccAddress, msg sdk.Msg) error

func (Keeper) DepositDenomForSP

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

func (Keeper) Exit added in v0.2.3

func (k Keeper) Exit(ctx sdk.Context, sp *types.StorageProvider) error

func (Keeper) ForceUpdateMaintenanceRecords added in v0.2.4

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

func (Keeper) GetAllSpStoragePrice added in v0.0.7

func (k Keeper) GetAllSpStoragePrice(ctx sdk.Context) (list []types.SpStoragePrice)

GetAllSpStoragePrice returns all SpStoragePrice

func (Keeper) GetAllStorageProviders

func (k Keeper) GetAllStorageProviders(ctx sdk.Context) (sps []types.StorageProvider)

func (Keeper) GetAuthority added in v0.2.0

func (k Keeper) GetAuthority() string

func (Keeper) GetGlobalSpStorePriceByTime added in v0.2.4

func (k Keeper) GetGlobalSpStorePriceByTime(ctx sdk.Context, time int64) (val types.GlobalSpStorePrice, err error)

func (Keeper) GetNextSpID added in v0.2.3

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

func (Keeper) GetParams

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

GetParams returns the current sp module parameters.

func (Keeper) GetSpStoragePrice added in v0.0.7

func (k Keeper) GetSpStoragePrice(
	ctx sdk.Context,
	spId uint32,
) (val types.SpStoragePrice, found bool)

GetSpStoragePrice returns a SpStoragePrice from its index

func (Keeper) GetStorageProvider

func (k Keeper) GetStorageProvider(ctx sdk.Context, id uint32) (sp *types.StorageProvider, found bool)

func (Keeper) GetStorageProviderByApprovalAddr added in v0.0.7

func (k Keeper) GetStorageProviderByApprovalAddr(ctx sdk.Context, approvalAddr sdk.AccAddress) (sp *types.StorageProvider, found bool)

func (Keeper) GetStorageProviderByBlsKey added in v0.2.3

func (k Keeper) GetStorageProviderByBlsKey(ctx sdk.Context, blsPk []byte) (sp *types.StorageProvider, found bool)

func (Keeper) GetStorageProviderByFundingAddr added in v0.0.7

func (k Keeper) GetStorageProviderByFundingAddr(ctx sdk.Context, fundAddr sdk.AccAddress) (sp *types.StorageProvider, found bool)

func (Keeper) GetStorageProviderByGcAddr added in v0.1.2

func (k Keeper) GetStorageProviderByGcAddr(ctx sdk.Context, gcAddr sdk.AccAddress) (sp *types.StorageProvider, found bool)

func (Keeper) GetStorageProviderByOperatorAddr added in v0.2.3

func (k Keeper) GetStorageProviderByOperatorAddr(ctx sdk.Context, opAddr sdk.AccAddress) (sp *types.StorageProvider, found bool)

func (Keeper) GetStorageProviderBySealAddr added in v0.0.7

func (k Keeper) GetStorageProviderBySealAddr(ctx sdk.Context, sealAddr sdk.AccAddress) (sp *types.StorageProvider, found bool)

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

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

func (Keeper) MustGetStorageProvider added in v0.2.3

func (k Keeper) MustGetStorageProvider(ctx sdk.Context, id uint32) *types.StorageProvider

func (Keeper) Params

func (Keeper) QueryGlobalSpStorePriceByTime added in v0.2.4

func (Keeper) QuerySpStoragePrice added in v0.2.4

func (Keeper) SecondarySpStorePriceRatio added in v0.0.10

func (k Keeper) SecondarySpStorePriceRatio(ctx sdk.Context) (res sdk.Dec)

func (Keeper) SetGlobalSpStorePrice added in v0.2.4

func (k Keeper) SetGlobalSpStorePrice(ctx sdk.Context, globalSpStorePrice types.GlobalSpStorePrice)

func (Keeper) SetParams

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

SetParams sets the params of sp module

func (Keeper) SetSpStoragePrice added in v0.0.7

func (k Keeper) SetSpStoragePrice(ctx sdk.Context, spStoragePrice types.SpStoragePrice)

SetSpStoragePrice set a specific SpStoragePrice in the store from its index

func (Keeper) SetStorageProvider

func (k Keeper) SetStorageProvider(ctx sdk.Context, sp *types.StorageProvider)

func (Keeper) SetStorageProviderByApprovalAddr added in v0.0.7

func (k Keeper) SetStorageProviderByApprovalAddr(ctx sdk.Context, sp *types.StorageProvider)

func (Keeper) SetStorageProviderByBlsKey added in v0.2.3

func (k Keeper) SetStorageProviderByBlsKey(ctx sdk.Context, sp *types.StorageProvider)

func (Keeper) SetStorageProviderByFundingAddr added in v0.0.7

func (k Keeper) SetStorageProviderByFundingAddr(ctx sdk.Context, sp *types.StorageProvider)

func (Keeper) SetStorageProviderByGcAddr added in v0.1.2

func (k Keeper) SetStorageProviderByGcAddr(ctx sdk.Context, sp *types.StorageProvider)

func (Keeper) SetStorageProviderByOperatorAddr added in v0.2.3

func (k Keeper) SetStorageProviderByOperatorAddr(ctx sdk.Context, sp *types.StorageProvider)

func (Keeper) SetStorageProviderBySealAddr added in v0.0.7

func (k Keeper) SetStorageProviderBySealAddr(ctx sdk.Context, sp *types.StorageProvider)

func (Keeper) Slash

func (k Keeper) Slash(ctx sdk.Context, spID uint32, rewardInfos []types.RewardInfo) error

func (Keeper) StorageProvider added in v0.0.7

func (Keeper) UpdateGlobalSpStorePrice added in v0.2.4

func (k Keeper) UpdateGlobalSpStorePrice(ctx sdk.Context) error

UpdateGlobalSpStorePrice calculate the global prices by the median price of all sp store price

func (Keeper) UpdateToInMaintenance added in v0.2.4

func (k Keeper) UpdateToInMaintenance(ctx sdk.Context, sp *types.StorageProvider, requestDuration int64) error

func (Keeper) UpdateToInService added in v0.2.4

func (k Keeper) UpdateToInService(ctx sdk.Context, sp *types.StorageProvider)

Jump to

Keyboard shortcuts

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