Documentation
¶
Index ¶
- Constants
- Variables
- func DeploymentKey(statePrefix []byte, id v1.DeploymentID) ([]byte, error)
- func DeploymentKeyLegacy(id v1.DeploymentID) []byte
- func DeploymentStateToPrefix(state v1.Deployment_State) []byte
- func GroupKey(statePrefix []byte, id v1.GroupID) ([]byte, error)
- func GroupKeyLegacy(id v1.GroupID) []byte
- func GroupStateToPrefix(state v1beta.Group_State) []byte
- func GroupsKeyLegacy(id v1.DeploymentID) []byte
- func MustDeploymentKey(statePrefix []byte, id v1.DeploymentID) []byte
- func MustGroupKey(statePrefix []byte, id v1.GroupID) []byte
- type DeploymentIndexes
- type GroupIndexes
- type IKeeper
- type Keeper
- func (k Keeper) AddPendingDenomMigration(ctx sdk.Context, did v1.DeploymentID) error
- func (k Keeper) CloseDeployment(ctx sdk.Context, deployment v1.Deployment) error
- func (k Keeper) Codec() codec.BinaryCodec
- func (k Keeper) Create(ctx sdk.Context, deployment v1.Deployment, groups []types.Group) error
- func (k Keeper) Deployments() ...
- func (k Keeper) EndBlocker(ctx context.Context) error
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetDeployment(ctx sdk.Context, id v1.DeploymentID) (v1.Deployment, bool)
- func (k Keeper) GetGroup(ctx sdk.Context, id v1.GroupID) (types.Group, bool)
- func (k Keeper) GetGroups(ctx sdk.Context, id v1.DeploymentID) (types.Groups, error)
- func (k Keeper) GetParams(ctx sdk.Context) (p types.Params)
- func (k Keeper) Groups() *collections.IndexedMap[keys.GroupPrimaryKey, types.Group, GroupIndexes]
- func (k Keeper) IterateDeploymentFiltered(ctx sdk.Context, state v1.Deployment_State, fn func(v1.Deployment) bool) error
- func (k Keeper) NewQuerier() Querier
- func (k Keeper) OnBidClosed(ctx sdk.Context, id v1.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 v1.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) SaveGroup(ctx sdk.Context, group types.Group) error
- func (k Keeper) SetParams(ctx sdk.Context, p types.Params) error
- func (k Keeper) StoreKey() storetypes.StoreKey
- func (k Keeper) UpdateDeployment(ctx sdk.Context, deployment v1.Deployment) error
- func (k Keeper) WithDeployments(ctx sdk.Context, fn func(v1.Deployment) bool) error
- 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)
- func (k Querier) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, 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 ¶
func DeploymentKeyLegacy ¶
func DeploymentKeyLegacy(id v1.DeploymentID) []byte
func DeploymentStateToPrefix ¶
func DeploymentStateToPrefix(state v1.Deployment_State) []byte
func GroupKeyLegacy ¶
func GroupKeyLegacy(id v1.GroupID) []byte
GroupKeyLegacy provides prefixed key for a Group's marshalled data.
func GroupStateToPrefix ¶
func GroupStateToPrefix(state v1beta.Group_State) []byte
func GroupsKeyLegacy ¶
func GroupsKeyLegacy(id v1.DeploymentID) []byte
GroupsKeyLegacy provides default store Key for Group data.
func MustDeploymentKey ¶
func MustGroupKey ¶
Types ¶
type DeploymentIndexes ¶
type DeploymentIndexes struct {
// State indexes deployments by their state (Active, Closed)
State *indexes.Multi[int32, keys.DeploymentPrimaryKey, v1.Deployment]
}
DeploymentIndexes defines the secondary indexes for the deployment IndexedMap
func NewDeploymentIndexes ¶
func NewDeploymentIndexes(sb *collections.SchemaBuilder) DeploymentIndexes
NewDeploymentIndexes creates all secondary indexes for the deployment IndexedMap
func (DeploymentIndexes) IndexesList ¶
func (d DeploymentIndexes) IndexesList() []collections.Index[keys.DeploymentPrimaryKey, v1.Deployment]
type GroupIndexes ¶
type GroupIndexes struct {
// State indexes groups by their state (Open, Paused, InsufficientFunds, Closed)
State *indexes.Multi[int32, keys.GroupPrimaryKey, types.Group]
// Deployment indexes groups by their parent deployment (owner, dseq) for GetGroups queries
Deployment *indexes.Multi[keys.DeploymentPrimaryKey, keys.GroupPrimaryKey, types.Group]
}
GroupIndexes defines the secondary indexes for the group IndexedMap
func NewGroupIndexes ¶
func NewGroupIndexes(sb *collections.SchemaBuilder) GroupIndexes
NewGroupIndexes creates all secondary indexes for the group IndexedMap
func (GroupIndexes) IndexesList ¶
func (g GroupIndexes) IndexesList() []collections.Index[keys.GroupPrimaryKey, types.Group]
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, error)
SaveGroup(ctx sdk.Context, group types.Group) error
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) error
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
EndBlocker(context.Context) error
AddPendingDenomMigration(ctx sdk.Context, did v1.DeploymentID) error
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, skey *storetypes.KVStoreKey, ekeeper dimports.EscrowKeeper, oracleKeeper dimports.OracleKeeper, marketKeeper dimports.MarketKeeper, authzKeeper dimports.AuthzKeeper, bankKeeper dimports.BankKeeper, 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) AddPendingDenomMigration ¶
AddPendingDenomMigration marks a deployment for deferred denom migration.
func (Keeper) CloseDeployment ¶
CloseDeployment close deployment
func (Keeper) Create ¶
Create creates a new deployment with given deployment and group specifications
func (Keeper) Deployments ¶
func (k Keeper) Deployments() *collections.IndexedMap[keys.DeploymentPrimaryKey, v1.Deployment, DeploymentIndexes]
Deployments returns the deployment IndexedMap for direct access (used by genesis and migration)
func (Keeper) GetAuthority ¶
GetAuthority returns the x/deployment module's authority.
func (Keeper) GetDeployment ¶
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) Groups ¶
func (k Keeper) Groups() *collections.IndexedMap[keys.GroupPrimaryKey, types.Group, GroupIndexes]
Groups returns the group IndexedMap for direct access (used by genesis and migration)
func (Keeper) IterateDeploymentFiltered ¶
func (k Keeper) IterateDeploymentFiltered(ctx sdk.Context, state v1.Deployment_State, fn func(v1.Deployment) bool) error
IterateDeploymentFiltered iterates all deployments in 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 pause API for a Group
func (Keeper) OnStartGroup ¶
OnStartGroup provides start API for a Group
func (Keeper) UpdateDeployment ¶
UpdateDeployment updates deployment details
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
func (Querier) Params ¶
func (k Querier) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)