Documentation
¶
Index ¶
- Constants
- Variables
- func DeploymentKey(statePrefix []byte, id types.DeploymentID) ([]byte, error)
- func DeploymentKeyLegacy(id types.DeploymentID) []byte
- func DeploymentStateToPrefix(state types.Deployment_State) []byte
- func GroupKey(statePrefix []byte, id types.GroupID) ([]byte, error)
- func GroupKeyLegacy(id types.GroupID) []byte
- func GroupStateToPrefix(state types.Group_State) []byte
- func GroupsKey(statePrefix []byte, id types.DeploymentID) ([]byte, error)
- func GroupsKeyLegacy(id types.DeploymentID) []byte
- func MustDeploymentKey(statePrefix []byte, id types.DeploymentID) []byte
- func MustGroupKey(statePrefix []byte, id types.GroupID) []byte
- func MustGroupsKey(statePrefix []byte, id types.DeploymentID) []byte
- type EscrowKeeper
- type IKeeper
- type Keeper
- func (k Keeper) CloseDeployment(ctx sdk.Context, deployment types.Deployment)
- func (k Keeper) Codec() codec.BinaryCodec
- func (k Keeper) Create(ctx sdk.Context, deployment types.Deployment, groups []types.Group) error
- func (k Keeper) GetDeployment(ctx sdk.Context, id types.DeploymentID) (types.Deployment, bool)
- func (k Keeper) GetGroup(ctx sdk.Context, id types.GroupID) (types.Group, bool)
- func (k Keeper) GetGroups(ctx sdk.Context, id types.DeploymentID) []types.Group
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) NewQuerier() Querier
- func (k Keeper) OnBidClosed(ctx sdk.Context, id types.GroupID) error
- func (k Keeper) OnCloseGroup(ctx sdk.Context, group types.Group, state types.Group_State) error
- func (k Keeper) OnLeaseClosed(ctx sdk.Context, id types.GroupID) (types.Group, error)
- func (k Keeper) OnPauseGroup(ctx sdk.Context, group types.Group) error
- func (k Keeper) OnStartGroup(ctx sdk.Context, group types.Group) error
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) StoreKey() sdk.StoreKey
- func (k Keeper) UpdateDeployment(ctx sdk.Context, deployment types.Deployment) error
- func (k Keeper) WithDeployments(ctx sdk.Context, fn func(types.Deployment) bool)
- type Querier
- func (k Querier) Deployment(c context.Context, req *types.QueryDeploymentRequest) (*types.QueryDeploymentResponse, error)
- func (k Querier) Deployments(c context.Context, req *types.QueryDeploymentsRequest) (*types.QueryDeploymentsResponse, error)
- func (k Querier) Group(c context.Context, req *types.QueryGroupRequest) (*types.QueryGroupResponse, error)
Constants ¶
Variables ¶
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 ¶ added in v0.38.0
func DeploymentKey(statePrefix []byte, id types.DeploymentID) ([]byte, error)
func DeploymentKeyLegacy ¶ added in v0.38.0
func DeploymentKeyLegacy(id types.DeploymentID) []byte
func DeploymentStateToPrefix ¶ added in v0.38.0
func DeploymentStateToPrefix(state types.Deployment_State) []byte
func GroupKeyLegacy ¶ added in v0.38.0
GroupKeyLegacy provides prefixed key for a Group's marshalled data.
func GroupStateToPrefix ¶ added in v0.38.0
func GroupStateToPrefix(state types.Group_State) []byte
func GroupsKey ¶ added in v0.38.0
func GroupsKey(statePrefix []byte, id types.DeploymentID) ([]byte, error)
GroupsKey provides default store Key for Group data.
func GroupsKeyLegacy ¶ added in v0.38.0
func GroupsKeyLegacy(id types.DeploymentID) []byte
GroupsKeyLegacy provides default store Key for Group data.
func MustDeploymentKey ¶ added in v0.38.0
func MustDeploymentKey(statePrefix []byte, id types.DeploymentID) []byte
func MustGroupsKey ¶ added in v0.38.0
func MustGroupsKey(statePrefix []byte, id types.DeploymentID) []byte
Types ¶
type EscrowKeeper ¶
type IKeeper ¶
type IKeeper interface {
StoreKey() sdk.StoreKey
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
}
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)
CloseDeployment updates deployment details
func (Keeper) Create ¶
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) GetGroups ¶
GetGroups returns all groups of a deployment with given DeploymentID from deployment store
func (Keeper) NewQuerier ¶
func (Keeper) OnBidClosed ¶
OnBidClosed sets the group to state paused.
func (Keeper) OnCloseGroup ¶
OnCloseGroup provides shutdown API for a Group
func (Keeper) OnLeaseClosed ¶
OnLeaseClosed keeps the group at state open
func (Keeper) OnPauseGroup ¶
OnPauseGroup provides shutdown API for a Group
func (Keeper) OnStartGroup ¶
OnStartGroup provides shutdown API for a Group
func (Keeper) UpdateDeployment ¶
UpdateDeployment updates deployment details
func (Keeper) WithDeployments ¶
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 ¶
func (k Querier) Deployment(c context.Context, req *types.QueryDeploymentRequest) (*types.QueryDeploymentResponse, error)
Deployment returns deployment details based on DeploymentID
func (Querier) Deployments ¶
func (k Querier) Deployments(c context.Context, req *types.QueryDeploymentsRequest) (*types.QueryDeploymentsResponse, error)
Deployments returns deployments based on filters
func (Querier) Group ¶
func (k Querier) Group(c context.Context, req *types.QueryGroupRequest) (*types.QueryGroupResponse, error)
Group returns group details based on GroupID