keeper

package
v0.23.6 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const MONTHS_IN_YEAR = 12

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.

func NextMonth added in v0.14.1

func NextMonth(date time.Time) time.Time

NextMonth returns the date of the same day next month (assumes UTC), adjusting for end-of-months differences if needed.

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,
	epochstorageKeeper types.EpochstorageKeeper,
	projectsKeeper types.ProjectsKeeper,
	plansKeeper types.PlansKeeper,
) *Keeper

func (Keeper) AddProjectToSubscription

func (k Keeper) AddProjectToSubscription(ctx sdk.Context, consumer string, projectData projectstypes.ProjectData) error

func (Keeper) BeginBlock added in v0.12.0

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

func (Keeper) ChargeComputeUnitsToSubscription

func (k Keeper) ChargeComputeUnitsToSubscription(ctx sdk.Context, consumer string, block, cuAmount uint64) error

func (Keeper) CreateSubscription

func (k Keeper) CreateSubscription(
	ctx sdk.Context,
	creator string,
	consumer string,
	planIndex string,
	duration uint64,
) error

CreateSubscription creates a subscription for a consumer

func (Keeper) Current

func (Keeper) DelProjectFromSubscription

func (k Keeper) DelProjectFromSubscription(ctx sdk.Context, consumer, name string) error

func (Keeper) ExportSubscriptions

func (k Keeper) ExportSubscriptions(ctx sdk.Context) commontypes.GenesisState

ExportSubscriptions exports subscriptions data (for genesis)

func (Keeper) ExportSubscriptionsTimers

func (k Keeper) ExportSubscriptionsTimers(ctx sdk.Context) []commontypes.RawMessage

ExportSubscriptionsTimers exports subscriptions timers data (for genesis)

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) GetPlanFromSubscription

func (k Keeper) GetPlanFromSubscription(ctx sdk.Context, consumer string) (planstypes.Plan, error)

func (Keeper) GetSubscription

func (k Keeper) GetSubscription(ctx sdk.Context, consumer string) (val types.Subscription, found bool)

GetSubscription returns the subscription of a given consumer

func (Keeper) InitSubscriptions

func (k Keeper) InitSubscriptions(ctx sdk.Context, gs commontypes.GenesisState)

InitSubscriptions imports subscriptions data (from genesis)

func (Keeper) InitSubscriptionsTimers

func (k Keeper) InitSubscriptionsTimers(ctx sdk.Context, data []commontypes.RawMessage)

InitSubscriptions imports subscriptions timers data (from genesis)

func (Keeper) List

func (Keeper) Logger

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

func (Keeper) Params

func (Keeper) SetParams

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

SetParams set the params

type Migrator

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

func NewMigrator

func NewMigrator(keeper Keeper) Migrator

func (Migrator) Migrate2to3

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

Migrate2to3 implements store migration from v2 to v3:

  • Convert subscription store to fixation store and use timers

func (Migrator) Migrate3to4

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

Migrate3to4 implements store migration from v3 to v4: -- trigger fixation migration (v4->v5), initialize IsLatest field

func (Migrator) Migrate4to5

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

Migrate4to5 implements store migration from v4 to v5: -- rename the DurationTotal field to DurationBought -- introduce two new fields: DurationTotal (with new meaning) and cluster -- assign the subscription's cluster

Jump to

Keyboard shortcuts

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