keeper

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: May 19, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDeploymentAlreadyExists = errors.New("keeper: deployment already exists")
	ErrDeploymentNotFound      = errors.New("keeper: deployment not found")
)

Functions

This section is empty.

Types

type Keeper

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

Keeper of the deployment store

func NewKeeper

func NewKeeper(cdc *codec.Codec, skey sdk.StoreKey) Keeper

NewKeeper creates and returns an instance for deployment keeper

func SetupTestInput

SetupTestInput will setup test inputs and return context and keeper

func (Keeper) Codec

func (k Keeper) Codec() *codec.Codec

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

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

OnDeploymentClosed updates group state to group closed

func (Keeper) OnLeaseClosed

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

OnLeaseClosed updates group state to group opened

func (Keeper) OnLeaseCreated

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

OnLeaseCreated updates group state to group matched

func (Keeper) OnLeaseInsufficientFunds

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

OnLeaseInsufficientFunds updates group state to group insufficient funds

func (Keeper) OnOrderCreated

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

OnOrderCreated updates group state to group ordered

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

Jump to

Keyboard shortcuts

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