keeper

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 17 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 {
	// 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

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

ActivateService activates the service with the given ID

func (*Keeper) AfterServiceActivated

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

AfterServiceActivated implements ServicesHooks

func (*Keeper) AfterServiceCreated

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

AfterServiceCreated implements ServicesHooks

func (*Keeper) AfterServiceDeactivated

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

AfterServiceDeactivated implements ServicesHooks

func (*Keeper) CreateService

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

CreateService creates a new Service and stores it in the KVStore

func (*Keeper) DeactivateService

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

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

func (k *Keeper) GetNextServiceID(ctx sdk.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 sdk.Context) (p types.Params)

GetParams returns the module parameters

func (*Keeper) GetService

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

GetService returns an Service from the KVStore

func (*Keeper) GetServices

func (k *Keeper) GetServices(ctx sdk.Context) []types.Service

GetServices returns the services stored 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 sdk.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 sdk.Context, cb func(service types.Service) (stop bool))

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

func (*Keeper) Logger

func (k *Keeper) Logger(ctx sdk.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 sdk.Context, service types.Service) error

SaveService stores a Service in the KVStore

func (*Keeper) Service

Service implements the Query/Service 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 sdk.Context, serviceID uint32)

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

func (*Keeper) SetParams

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

SetParams sets module parameters

Jump to

Keyboard shortcuts

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