keeper

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: AGPL-3.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,
	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) 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) 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) GetSecondarySpStorePriceByTime added in v0.0.7

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

func (Keeper) GetSpStoragePrice added in v0.0.7

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

GetSpStoragePrice returns a SpStoragePrice from its index

func (Keeper) GetSpStoragePriceByTime added in v0.0.7

func (k Keeper) GetSpStoragePriceByTime(
	ctx sdk.Context,
	spId uint32,
	timestamp int64,
) (val types.SpStoragePrice, err error)

GetSpStoragePriceByTime find the latest price before the given time

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) QueryGetSpStoragePriceByTime added in v0.0.7

func (Keeper) SecondarySpStorePriceRatio added in v0.0.10

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

func (Keeper) SetParams

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

SetParams sets the params of sp module

func (Keeper) SetSecondarySpStorePrice added in v0.0.7

func (k Keeper) SetSecondarySpStorePrice(ctx sdk.Context, secondarySpStorePrice types.SecondarySpStorePrice)

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) UpdateSecondarySpStorePrice added in v0.0.7

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

UpdateSecondarySpStorePrice calculate the price of secondary store by the average price of all sp store price

Jump to

Keyboard shortcuts

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