keeper

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServer

func NewMsgServer(k *Keeper) types.MsgServer

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, keeper *Keeper)

RegisterInvariants registers all services module invariants

func ValidServicesInvariant

func ValidServicesInvariant(k *Keeper) sdk.Invariant

ValidServicesInvariant checks that all the services are valid

Types

type Keeper

type Keeper struct {
	Schema collections.Schema
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeService corestoretypes.KVStoreService,
	accountKeeper types.AccountKeeper,
	poolKeeper types.CommunityPoolKeeper,
	authority string,
) *Keeper

NewKeeper creates a new keeper

func (*Keeper) ActivateService

func (k *Keeper) ActivateService(ctx context.Context, serviceID uint32) error

ActivateService activates the service with the given ID

func (*Keeper) AfterServiceAccreditationModified

func (k *Keeper) AfterServiceAccreditationModified(ctx context.Context, serviceID uint32) error

AfterServiceAccreditationModified implements ServicesHooks

func (*Keeper) AfterServiceActivated

func (k *Keeper) AfterServiceActivated(ctx context.Context, serviceID uint32) error

AfterServiceActivated implements ServicesHooks

func (*Keeper) AfterServiceCreated

func (k *Keeper) AfterServiceCreated(ctx context.Context, serviceID uint32) error

AfterServiceCreated implements ServicesHooks

func (*Keeper) AfterServiceDeactivated

func (k *Keeper) AfterServiceDeactivated(ctx context.Context, serviceID uint32) error

AfterServiceDeactivated implements ServicesHooks

func (*Keeper) BeforeServiceDeleted

func (k *Keeper) BeforeServiceDeleted(ctx context.Context, serviceID uint32) error

BeforeServiceDeleted implements ServicesHooks

func (*Keeper) CreateService

func (k *Keeper) CreateService(ctx context.Context, service types.Service) error

CreateService creates a new Service and stores it in the KVStore

func (*Keeper) DeactivateService

func (k *Keeper) DeactivateService(ctx context.Context, serviceID uint32) error

DeactivateService deactivates the service with the given ID

func (*Keeper) DeleteService

func (k *Keeper) DeleteService(ctx context.Context, serviceID uint32) error

DeleteService deletes 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) GetAllServicesParams

func (k *Keeper) GetAllServicesParams(ctx context.Context) ([]types.ServiceParamsRecord, error)

GetAllServicesParams returns the parameters that have been configured for all services.

func (*Keeper) GetNextServiceID

func (k *Keeper) GetNextServiceID(ctx context.Context) (serviceID uint32, err error)

GetNextServiceID returns the next service ID to be used when registering a new Service

func (*Keeper) GetParams

func (k *Keeper) GetParams(ctx context.Context) (types.Params, error)

GetParams returns the module parameters

func (*Keeper) GetService

func (k *Keeper) GetService(ctx context.Context, serviceID uint32) (service types.Service, found bool, err error)

GetService returns an Service from the KVStore

func (*Keeper) GetServiceParams

func (k *Keeper) GetServiceParams(ctx context.Context, serviceID uint32) (types.ServiceParams, error)

GetServiceParams returns the params for the service with the given ID

func (*Keeper) GetServices

func (k *Keeper) GetServices(ctx context.Context) ([]types.Service, error)

GetServices returns the services stored in the KVStore

func (*Keeper) HasService

func (k *Keeper) HasService(ctx context.Context, serviceID uint32) (bool, error)

HasService checks if a Service with the given ID exists in the KVStore

func (*Keeper) InitGenesis

func (k *Keeper) InitGenesis(ctx sdk.Context, state *types.GenesisState) error

InitGenesis initializes the state from a GenesisState

func (*Keeper) IsServiceAddress

func (k *Keeper) IsServiceAddress(ctx context.Context, address string) (bool, error)

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

func (k *Keeper) IterateServices(ctx context.Context, cb func(service types.Service) (stop bool, err error)) error

IterateServices iterates over the services in the store and performs a callback function

func (*Keeper) Logger

func (k *Keeper) Logger(ctx context.Context) log.Logger

Logger returns a module-specific logger.

func (*Keeper) Params

Params implements the Query/Params gRPC method

func (*Keeper) SaveService

func (k *Keeper) SaveService(ctx context.Context, service types.Service) error

SaveService stores a Service in the KVStore

func (*Keeper) Service

Service implements the Query/Service gRPC method

func (*Keeper) ServiceParams

ServiceParams implements the Query/ServiceParams gRPC method

func (*Keeper) Services

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

func (k *Keeper) SetNextServiceID(ctx context.Context, serviceID uint32) error

SetNextServiceID sets the next service ID to be used when registering a new Service

func (*Keeper) SetParams

func (k *Keeper) SetParams(ctx context.Context, params types.Params) error

SetParams sets module parameters

func (*Keeper) SetServiceAccredited

func (k *Keeper) SetServiceAccredited(ctx context.Context, serviceID uint32, accredited bool) error

SetServiceAccredited sets the accreditation of the service with the given ID

func (*Keeper) SetServiceParams

func (k *Keeper) SetServiceParams(ctx context.Context, serviceID uint32, params types.ServiceParams) error

SetServiceParams sets the params for the service with the given ID

Jump to

Keyboard shortcuts

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