keeper

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeploymentStateActivePrefixID       = byte(0x01)
	DeploymentStateClosedPrefixID       = byte(0x02)
	GroupStateOpenPrefixID              = byte(0x01)
	GroupStatePausedPrefixID            = byte(0x02)
	GroupStateInsufficientFundsPrefixID = byte(0x03)
	GroupStateClosedPrefixID            = byte(0x04)
)

Variables

View Source
var (
	DeploymentPrefix                  = []byte{0x11, 0x00}
	DeploymentStateActivePrefix       = []byte{DeploymentStateActivePrefixID}
	DeploymentStateClosedPrefix       = []byte{DeploymentStateClosedPrefixID}
	GroupPrefix                       = []byte{0x12, 0x00}
	GroupStateOpenPrefix              = []byte{GroupStateOpenPrefixID}
	GroupStatePausedPrefix            = []byte{GroupStatePausedPrefixID}
	GroupStateInsufficientFundsPrefix = []byte{GroupStateInsufficientFundsPrefixID}
	GroupStateClosedPrefix            = []byte{GroupStateClosedPrefixID}
)

Functions

func DeploymentKey

func DeploymentKey(statePrefix []byte, id v1.DeploymentID) ([]byte, error)

func DeploymentKeyLegacy

func DeploymentKeyLegacy(id v1.DeploymentID) []byte

func DeploymentStateToPrefix

func DeploymentStateToPrefix(state v1.Deployment_State) []byte

func GroupKey

func GroupKey(statePrefix []byte, id v1.GroupID) ([]byte, error)

GroupKey provides prefixed key for a Group's marshalled data.

func GroupKeyLegacy

func GroupKeyLegacy(id v1.GroupID) []byte

GroupKeyLegacy provides prefixed key for a Group's marshalled data.

func GroupStateToPrefix

func GroupStateToPrefix(state v1beta4.Group_State) []byte

func GroupsKey

func GroupsKey(statePrefix []byte, id v1.DeploymentID) ([]byte, error)

GroupsKey provides default store Key for Group data.

func GroupsKeyLegacy

func GroupsKeyLegacy(id v1.DeploymentID) []byte

GroupsKeyLegacy provides default store Key for Group data.

func MustDeploymentKey

func MustDeploymentKey(statePrefix []byte, id v1.DeploymentID) []byte

func MustGroupKey

func MustGroupKey(statePrefix []byte, id v1.GroupID) []byte

func MustGroupsKey

func MustGroupsKey(statePrefix []byte, id v1.DeploymentID) []byte

Types

type EscrowKeeper

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

type IKeeper

type IKeeper interface {
	StoreKey() storetypes.StoreKey
	Codec() codec.BinaryCodec
	GetDeployment(ctx sdk.Context, id v1.DeploymentID) (v1.Deployment, bool)
	GetGroup(ctx sdk.Context, id v1.GroupID) (types.Group, bool)
	GetGroups(ctx sdk.Context, id v1.DeploymentID) types.Groups
	Create(ctx sdk.Context, deployment v1.Deployment, groups []types.Group) error
	UpdateDeployment(ctx sdk.Context, deployment v1.Deployment) error
	CloseDeployment(ctx sdk.Context, deployment v1.Deployment) error
	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(v1.Deployment) bool)
	OnBidClosed(ctx sdk.Context, id v1.GroupID) error
	OnLeaseClosed(ctx sdk.Context, id v1.GroupID) (types.Group, error)
	GetParams(ctx sdk.Context) (params types.Params)
	SetParams(ctx sdk.Context, params types.Params) error
	GetAuthority() string
	NewQuerier() Querier
}

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, skey storetypes.StoreKey, ekeeper EscrowKeeper, authority string) 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 v1.Deployment) error

CloseDeployment close deployment

func (Keeper) Codec

func (k Keeper) Codec() codec.BinaryCodec

Codec returns keeper codec

func (Keeper) Create

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

Create creates a new deployment with given deployment and group specifications

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the x/mint module's authority.

func (Keeper) GetDeployment

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

GetDeployment returns deployment details with provided DeploymentID

func (Keeper) GetGroup

func (k Keeper) GetGroup(ctx sdk.Context, id v1.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 v1.DeploymentID) types.Groups

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

func (Keeper) GetParams

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

GetParams returns the current x/deployment module parameters.

func (Keeper) NewQuerier

func (k Keeper) NewQuerier() Querier

func (Keeper) OnBidClosed

func (k Keeper) OnBidClosed(ctx sdk.Context, id v1.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 v1.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, p types.Params) error

SetParams sets the x/deployment module parameters.

func (Keeper) StoreKey

func (k Keeper) StoreKey() storetypes.StoreKey

func (Keeper) UpdateDeployment

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

UpdateDeployment updates deployment details

func (Keeper) WithDeployments

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

WithDeployments iterates all deployments in deployment store

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

func (Querier) Params

Jump to

Keyboard shortcuts

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