keeper

package
v12.0.0-rc6 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keeper

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

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey) Keeper

func (*Keeper) DeleteActivePlan

func (k *Keeper) DeleteActivePlan(ctx sdk.Context, id uint64)

DeleteActivePlan removes an active plan from the module's KVStore.

func (*Keeper) DeleteInactivePlan

func (k *Keeper) DeleteInactivePlan(ctx sdk.Context, id uint64)

DeleteInactivePlan removes an inactive plan from the module's KVStore.

func (*Keeper) DeletePlanForNodeByProvider

func (k *Keeper) DeletePlanForNodeByProvider(ctx sdk.Context, nodeAddr base.NodeAddress, provAddr base.ProvAddress, id uint64)

DeletePlanForNodeByProvider removes a plan for a node by provider from the module's KVStore based on the node and provider addresses and plan ID.

func (*Keeper) DeletePlanForProvider

func (k *Keeper) DeletePlanForProvider(ctx sdk.Context, addr base.ProvAddress, id uint64)

DeletePlanForProvider removes the association between a plan ID and a provider address.

func (*Keeper) ExportGenesis

func (k *Keeper) ExportGenesis(ctx sdk.Context) *v3.GenesisState

func (*Keeper) GetActivePlan

func (k *Keeper) GetActivePlan(ctx sdk.Context, id uint64) (plan v3.Plan, found bool)

GetActivePlan retrieves an active plan from the module's KVStore.

func (*Keeper) GetCount

func (k *Keeper) GetCount(ctx sdk.Context) uint64

GetCount retrieves the count of plans from the module's KVStore.

func (*Keeper) GetInactivePlan

func (k *Keeper) GetInactivePlan(ctx sdk.Context, id uint64) (plan v3.Plan, found bool)

GetInactivePlan retrieves an inactive plan from the module's KVStore.

func (*Keeper) GetPlan

func (k *Keeper) GetPlan(ctx sdk.Context, id uint64) (plan v3.Plan, found bool)

GetPlan retrieves a plan from either the active or inactive state.

func (*Keeper) GetPlans

func (k *Keeper) GetPlans(ctx sdk.Context) (items []v3.Plan)

GetPlans retrieves all plans (both active and inactive) from the module's KVStore.

func (*Keeper) GetPlansForProvider

func (k *Keeper) GetPlansForProvider(ctx sdk.Context, addr base.ProvAddress) (items []v3.Plan)

GetPlansForProvider retrieves all plans associated with a specific provider address.

func (*Keeper) HandleMsgCreatePlan

func (k *Keeper) HandleMsgCreatePlan(ctx sdk.Context, msg *v3.MsgCreatePlanRequest) (*v3.MsgCreatePlanResponse, error)

func (*Keeper) HandleMsgLinkNode

func (k *Keeper) HandleMsgLinkNode(ctx sdk.Context, msg *v3.MsgLinkNodeRequest) (*v3.MsgLinkNodeResponse, error)

func (*Keeper) HandleMsgStartSession

func (k *Keeper) HandleMsgStartSession(ctx sdk.Context, msg *v3.MsgStartSessionRequest) (*v3.MsgStartSessionResponse, error)

func (*Keeper) HandleMsgUnlinkNode

func (k *Keeper) HandleMsgUnlinkNode(ctx sdk.Context, msg *v3.MsgUnlinkNodeRequest) (*v3.MsgUnlinkNodeResponse, error)

func (*Keeper) HandleMsgUpdatePlanStatus

func (k *Keeper) HandleMsgUpdatePlanStatus(ctx sdk.Context, msg *v3.MsgUpdatePlanStatusRequest) (*v3.MsgUpdatePlanStatusResponse, error)

func (*Keeper) HandleQueryPlan

func (k *Keeper) HandleQueryPlan(ctx sdk.Context, req *v3.QueryPlanRequest) (*v3.QueryPlanResponse, error)

func (*Keeper) HandleQueryPlans

func (k *Keeper) HandleQueryPlans(ctx sdk.Context, req *v3.QueryPlansRequest) (res *v3.QueryPlansResponse, err error)

func (*Keeper) HandleQueryPlansForProvider

func (k *Keeper) HandleQueryPlansForProvider(ctx sdk.Context, req *v3.QueryPlansForProviderRequest) (res *v3.QueryPlansForProviderResponse, err error)

func (*Keeper) HasActivePlan

func (k *Keeper) HasActivePlan(ctx sdk.Context, id uint64) bool

HasActivePlan checks if an active plan exists in the module's KVStore.

func (*Keeper) HasInactivePlan

func (k *Keeper) HasInactivePlan(ctx sdk.Context, id uint64) bool

HasInactivePlan checks if an inactive plan exists in the module's KVStore.

func (*Keeper) HasPlan

func (k *Keeper) HasPlan(ctx sdk.Context, id uint64) bool

HasPlan checks if a plan exists in either active or inactive state.

func (*Keeper) HasPlanForNodeByProvider

func (k *Keeper) HasPlanForNodeByProvider(ctx sdk.Context, nodeAddr base.NodeAddress, provAddr base.ProvAddress, id uint64) bool

HasPlanForNodeByProvider checks if a plan for a node by provider exists in the module's KVStore based on the node and provider addresses and plan ID.

func (*Keeper) InitGenesis

func (k *Keeper) InitGenesis(ctx sdk.Context, state *v3.GenesisState)

func (*Keeper) IteratePlansForNode

func (k *Keeper) IteratePlansForNode(ctx sdk.Context, addr base.NodeAddress, fn func(index int, item v3.Plan) (stop bool))

IteratePlansForNode iterates over all plans for a specific node and calls the provided function for each plan. The iteration stops when the provided function returns 'true'.

func (*Keeper) IteratePlansForNodeByProvider

func (k *Keeper) IteratePlansForNodeByProvider(ctx sdk.Context, nodeAddr base.NodeAddress, provAddr base.ProvAddress, fn func(index int, item v3.Plan) (stop bool))

IteratePlansForNodeByProvider iterates over all plans for a specific node and provider and calls the provided function for each plan. The iteration stops when the provided function returns 'true'.

func (*Keeper) IteratePlansForProvider

func (k *Keeper) IteratePlansForProvider(ctx sdk.Context, addr base.ProvAddress, fn func(index int, item v3.Plan) (stop bool))

func (*Keeper) LeaseInactivePreHook

func (k *Keeper) LeaseInactivePreHook(ctx sdk.Context, id uint64) error

func (*Keeper) Logger

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

func (*Keeper) PlanUnlinkNodePreHook

func (k *Keeper) PlanUnlinkNodePreHook(ctx sdk.Context, id uint64, addr base.NodeAddress) error

func (*Keeper) ProviderInactivePreHook

func (k *Keeper) ProviderInactivePreHook(ctx sdk.Context, addr base.ProvAddress) error

func (*Keeper) SetActivePlan

func (k *Keeper) SetActivePlan(ctx sdk.Context, plan v3.Plan)

SetActivePlan stores an active plan in the module's KVStore.

func (*Keeper) SetCount

func (k *Keeper) SetCount(ctx sdk.Context, count uint64)

SetCount stores the count of plans in the module's KVStore.

func (*Keeper) SetInactivePlan

func (k *Keeper) SetInactivePlan(ctx sdk.Context, plan v3.Plan)

SetInactivePlan stores an inactive plan in the module's KVStore.

func (*Keeper) SetPlan

func (k *Keeper) SetPlan(ctx sdk.Context, plan v3.Plan)

SetPlan stores a plan in the KVStore based on its status (Active or Inactive).

func (*Keeper) SetPlanForNodeByProvider

func (k *Keeper) SetPlanForNodeByProvider(ctx sdk.Context, nodeAddr base.NodeAddress, provAddr base.ProvAddress, id uint64)

SetPlanForNodeByProvider stores a plan for a node by provider in the module's KVStore.

func (*Keeper) SetPlanForProvider

func (k *Keeper) SetPlanForProvider(ctx sdk.Context, addr base.ProvAddress, id uint64)

SetPlanForProvider associates a plan ID with a provider address.

func (*Keeper) Store

func (k *Keeper) Store(ctx sdk.Context) sdk.KVStore

func (*Keeper) WithLeaseKeeper

func (k *Keeper) WithLeaseKeeper(keeper expected.LeaseKeeper)

func (*Keeper) WithNodeKeeper

func (k *Keeper) WithNodeKeeper(keeper expected.NodeKeeper)

func (*Keeper) WithProviderKeeper

func (k *Keeper) WithProviderKeeper(keeper expected.ProviderKeeper)

func (*Keeper) WithSessionKeeper

func (k *Keeper) WithSessionKeeper(keeper expected.SessionKeeper)

func (*Keeper) WithSubscriptionKeeper

func (k *Keeper) WithSubscriptionKeeper(keeper expected.SubscriptionKeeper)

Jump to

Keyboard shortcuts

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