keeper

package
v0.23.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 16 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EscrowKeeper

type EscrowKeeper interface {
	GetAccount(ctx sdk.Context, id etypes.AccountID) (etypes.Account, error)
}

type IKeeper

type IKeeper interface {
	Codec() codec.BinaryCodec
	GetDeployment(ctx sdk.Context, id types.DeploymentID) (types.Deployment, bool)
	GetGroup(ctx sdk.Context, id types.GroupID) (types.Group, bool)
	GetGroups(ctx sdk.Context, id types.DeploymentID) []types.Group
	Create(ctx sdk.Context, deployment types.Deployment, groups []types.Group) error
	UpdateDeployment(ctx sdk.Context, deployment types.Deployment) error
	CloseDeployment(ctx sdk.Context, deployment types.Deployment)
	OnCloseGroup(ctx sdk.Context, group types.Group, state types.Group_State) error
	OnPauseGroup(ctx sdk.Context, group types.Group) error
	OnStartGroup(ctx sdk.Context, group types.Group) error
	WithDeployments(ctx sdk.Context, fn func(types.Deployment) bool)
	OnBidClosed(ctx sdk.Context, id types.GroupID) error
	OnLeaseClosed(ctx sdk.Context, id types.GroupID) (types.Group, error)
	GetParams(ctx sdk.Context) (params types.Params)
	SetParams(ctx sdk.Context, params types.Params)

	NewQuerier() Querier
	// contains filtered or unexported methods
}

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, skey sdk.StoreKey, pspace paramtypes.Subspace, ekeeper EscrowKeeper) IKeeper

NewKeeper creates and returns an instance for deployment keeper

type Keeper

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

Keeper of the deployment store

func (Keeper) CloseDeployment

func (k Keeper) CloseDeployment(ctx sdk.Context, deployment types.Deployment)

UpdateDeployment updates deployment details

func (Keeper) Codec

func (k Keeper) Codec() codec.BinaryCodec

Codec returns keeper codec

func (Keeper) Create

func (k Keeper) Create(ctx sdk.Context, deployment types.Deployment, groups []types.Group) error

Create creates a new deployment with given deployment and group specifications

func (Keeper) GetDeployment

func (k Keeper) GetDeployment(ctx sdk.Context, id types.DeploymentID) (types.Deployment, bool)

GetDeployment returns deployment details with provided DeploymentID

func (Keeper) GetGroup

func (k Keeper) GetGroup(ctx sdk.Context, id types.GroupID) (types.Group, bool)

GetGroup returns group details with given GroupID from deployment store

func (Keeper) GetGroups

func (k Keeper) GetGroups(ctx sdk.Context, id types.DeploymentID) []types.Group

GetGroups returns all groups of a deployment with given DeploymentID from deployment store

func (Keeper) GetParams

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

GetParams returns the total set of deployment parameters.

func (Keeper) NewQuerier

func (k Keeper) NewQuerier() Querier

func (Keeper) OnBidClosed

func (k Keeper) OnBidClosed(ctx sdk.Context, id types.GroupID) error

OnBidClosed sets the group to state paused.

func (Keeper) OnCloseGroup

func (k Keeper) OnCloseGroup(ctx sdk.Context, group types.Group, state types.Group_State) error

OnCloseGroup provides shutdown API for a Group

func (Keeper) OnLeaseClosed

func (k Keeper) OnLeaseClosed(ctx sdk.Context, id types.GroupID) (types.Group, error)

OnLeaseClosed keeps the group at state open

func (Keeper) OnPauseGroup

func (k Keeper) OnPauseGroup(ctx sdk.Context, group types.Group) error

OnPauseGroup provides shutdown API for a Group

func (Keeper) OnStartGroup

func (k Keeper) OnStartGroup(ctx sdk.Context, group types.Group) error

OnStartGroup provides shutdown API for a Group

func (Keeper) SetParams

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

SetParams sets the deployment parameters to the paramspace.

func (Keeper) UpdateDeployment

func (k Keeper) UpdateDeployment(ctx sdk.Context, deployment types.Deployment) error

UpdateDeployment updates deployment details

func (Keeper) WithDeployments

func (k Keeper) WithDeployments(ctx sdk.Context, fn func(types.Deployment) bool)

WithDeployments iterates all deployments in deployment store

type Migrator

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

Migrator is a struct for handling in-place store migrations.

func NewMigrator

func NewMigrator(k IKeeper) Migrator

NewMigrator returns a new Migrator.

type Querier

type Querier struct {
	Keeper
}

Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper

func (Querier) Deployment

Deployment returns deployment details based on DeploymentID

func (Querier) Deployments

Deployments returns deployments based on filters

func (Querier) Group

Group returns group details based on GroupID

Jump to

Keyboard shortcuts

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