Documentation ¶
Index ¶
- func NewMsgServer(k *Keeper) types.MsgServer
- func RegisterInvariants(ir sdk.InvariantRegistry, keeper *Keeper)
- func ValidServicesInvariant(k *Keeper) sdk.Invariant
- type Keeper
- func (k *Keeper) ActivateService(ctx sdk.Context, serviceID uint32) error
- func (k *Keeper) AfterServiceActivated(ctx context.Context, serviceID uint32)
- func (k *Keeper) AfterServiceCreated(ctx context.Context, serviceID uint32)
- func (k *Keeper) AfterServiceDeactivated(ctx context.Context, serviceID uint32)
- func (k *Keeper) CreateService(ctx sdk.Context, service types.Service) error
- func (k *Keeper) DeactivateService(ctx sdk.Context, serviceID uint32) error
- func (k *Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k *Keeper) GetNextServiceID(ctx sdk.Context) (serviceID uint32, err error)
- func (k *Keeper) GetParams(ctx sdk.Context) (p types.Params)
- func (k *Keeper) GetService(ctx sdk.Context, serviceID uint32) (service types.Service, found bool)
- func (k *Keeper) GetServices(ctx sdk.Context) []types.Service
- func (k *Keeper) InitGenesis(ctx sdk.Context, state *types.GenesisState) error
- func (k *Keeper) IsServiceAddress(ctx sdk.Context, address string) (bool, error)
- func (k *Keeper) IterateServices(ctx sdk.Context, cb func(service types.Service) (stop bool))
- func (k *Keeper) Logger(ctx sdk.Context) log.Logger
- func (k *Keeper) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k *Keeper) SaveService(ctx sdk.Context, service types.Service) error
- func (k *Keeper) Service(ctx context.Context, request *types.QueryServiceRequest) (*types.QueryServiceResponse, error)
- func (k *Keeper) Services(ctx context.Context, request *types.QueryServicesRequest) (*types.QueryServicesResponse, error)
- func (k *Keeper) SetHooks(rs types.ServicesHooks) *Keeper
- func (k *Keeper) SetNextServiceID(ctx sdk.Context, serviceID uint32)
- func (k *Keeper) SetParams(ctx sdk.Context, params types.Params)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServer ¶
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, keeper *Keeper)
RegisterInvariants registers all services module invariants
func ValidServicesInvariant ¶
ValidServicesInvariant checks that all the services are valid
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey storetypes.StoreKey, storeService corestoretypes.KVStoreService, accountKeeper types.AccountKeeper, poolKeeper types.CommunityPoolKeeper, authority string, ) *Keeper
NewKeeper creates a new keeper
func (*Keeper) ActivateService ¶
ActivateService activates the service with the given ID
func (*Keeper) AfterServiceActivated ¶
AfterServiceActivated implements ServicesHooks
func (*Keeper) AfterServiceCreated ¶
AfterServiceCreated implements ServicesHooks
func (*Keeper) AfterServiceDeactivated ¶
AfterServiceDeactivated implements ServicesHooks
func (*Keeper) CreateService ¶
CreateService creates a new Service and stores it in the KVStore
func (*Keeper) DeactivateService ¶
DeactivateService deactivates the service with the given ID
func (*Keeper) ExportGenesis ¶
func (k *Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the GenesisState associated with the given context
func (*Keeper) GetNextServiceID ¶
GetNextServiceID returns the next service ID to be used when registering a new Service
func (*Keeper) GetService ¶
GetService returns an Service from the KVStore
func (*Keeper) GetServices ¶
GetServices returns the services stored in the KVStore
func (*Keeper) InitGenesis ¶
InitGenesis initializes the state from a GenesisState
func (*Keeper) IsServiceAddress ¶
IsServiceAddress returns true if the provided address is the address where the users' asset are kept when they restake toward a service.
func (*Keeper) IterateServices ¶
IterateServices iterates over the services in the store and performs a callback function
func (*Keeper) Params ¶
func (k *Keeper) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params implements the Query/Params gRPC method
func (*Keeper) SaveService ¶
SaveService stores a Service in the KVStore
func (*Keeper) Service ¶
func (k *Keeper) Service(ctx context.Context, request *types.QueryServiceRequest) (*types.QueryServiceResponse, error)
Service implements the Query/Service gRPC method
func (*Keeper) Services ¶
func (k *Keeper) Services(ctx context.Context, request *types.QueryServicesRequest) (*types.QueryServicesResponse, error)
Services implements the Query/Services gRPC method
func (*Keeper) SetHooks ¶
func (k *Keeper) SetHooks(rs types.ServicesHooks) *Keeper
SetHooks allows to set the reactions hooks
func (*Keeper) SetNextServiceID ¶
SetNextServiceID sets the next service ID to be used when registering a new Service