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: 20 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 operators module invariants

func ValidOperatorsInvariant

func ValidOperatorsInvariant(k *Keeper) sdk.Invariant

ValidOperatorsInvariant checks that all the operators 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

func (*Keeper) AfterOperatorInactivatingCompleted

func (k *Keeper) AfterOperatorInactivatingCompleted(ctx context.Context, operatorID uint32) error

AfterOperatorInactivatingCompleted implements OperatorsHooks

func (*Keeper) AfterOperatorInactivatingStarted

func (k *Keeper) AfterOperatorInactivatingStarted(ctx context.Context, operatorID uint32) error

AfterOperatorInactivatingStarted implements OperatorsHooks

func (*Keeper) AfterOperatorReactivated

func (k *Keeper) AfterOperatorReactivated(ctx context.Context, operatorID uint32) error

AfterOperatorReactivated implements OperatorsHooks

func (*Keeper) AfterOperatorRegistered

func (k *Keeper) AfterOperatorRegistered(ctx context.Context, operatorID uint32) error

AfterOperatorRegistered implements OperatorsHooks

func (*Keeper) BeforeOperatorDeleted

func (k *Keeper) BeforeOperatorDeleted(ctx context.Context, operatorID uint32) error

BeforeOperatorDeleted implements OperatorsHooks

func (*Keeper) CompleteOperatorInactivation

func (k *Keeper) CompleteOperatorInactivation(ctx context.Context, operator types.Operator) error

CompleteOperatorInactivation completes the inactivation process for the operator with the given ID

func (*Keeper) CreateOperator

func (k *Keeper) CreateOperator(ctx context.Context, operator types.Operator) error

CreateOperator creates a new Operator and stores it in the KVStore

func (*Keeper) DeleteOperator

func (k *Keeper) DeleteOperator(ctx context.Context, operator types.Operator) error

DeleteOperator deletes the operator with the given ID

func (*Keeper) DeleteOperatorParams

func (k *Keeper) DeleteOperatorParams(ctx context.Context, operatorID uint32) error

DeleteOperatorParams the operator params associated to the operator with the provided ID. If we don't have params associated to the provided operator ID no action will be performed.

func (*Keeper) ExportGenesis

func (k *Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis returns the GenesisState associated with the given context

func (*Keeper) GetAllOperatorParamsRecords

func (k *Keeper) GetAllOperatorParamsRecords(ctx context.Context) ([]types.OperatorParamsRecord, error)

GetAllOperatorParamsRecords returns all the operator params records

func (*Keeper) GetInactivatingOperators

func (k *Keeper) GetInactivatingOperators(ctx context.Context) ([]types.UnbondingOperator, error)

GetInactivatingOperators returns the inactivating operators stored in the KVStore

func (*Keeper) GetNextOperatorID

func (k *Keeper) GetNextOperatorID(ctx context.Context) (operatorID uint32, err error)

GetNextOperatorID returns the next operator ID to be used when registering a new Operator

func (*Keeper) GetOperator

func (k *Keeper) GetOperator(ctx context.Context, operatorID uint32) (operator types.Operator, found bool, err error)

GetOperator returns the operator with the given ID. If the operator does not exist, false is returned.

func (*Keeper) GetOperatorParams

func (k *Keeper) GetOperatorParams(ctx context.Context, operatorID uint32) (types.OperatorParams, error)

GetOperatorParams returns the operator params

func (*Keeper) GetOperators

func (k *Keeper) GetOperators(ctx context.Context) ([]types.Operator, error)

GetOperators returns the operators stored in the KVStore

func (*Keeper) GetParams

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

GetParams returns the module parameters

func (*Keeper) InitGenesis

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

InitGenesis initializes the state from a GenesisState

func (*Keeper) IsOperatorAddress

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

IsOperatorAddress returns true if the provided address is the address where the users' asset are kept when they restake toward an operator.

func (*Keeper) IterateInactivatingOperatorQueue

func (k *Keeper) IterateInactivatingOperatorQueue(ctx context.Context, endTime time.Time, fn func(operator types.Operator) (stop bool, err error)) error

IterateInactivatingOperatorQueue iterates over all the operators that are set to be inactivated by the given time and calls the given function.

func (*Keeper) IterateOperators

func (k *Keeper) IterateOperators(ctx context.Context, cb func(operator types.Operator) (stop bool, err error)) error

IterateOperators iterates over the operators 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) Operator

Operator implements the Query/Operator gRPC method

func (*Keeper) OperatorParams

func (*Keeper) Operators

Operators implements the Query/Operators gRPC method

func (*Keeper) Params

Params implements the Query/Params gRPC method

func (*Keeper) ReactivateInactiveOperator

func (k *Keeper) ReactivateInactiveOperator(ctx context.Context, operator types.Operator) error

ReactivateInactiveOperator reactivates an inactive operator

func (*Keeper) SaveOperator

func (k *Keeper) SaveOperator(ctx context.Context, operator types.Operator) error

SaveOperator stores the given operator in the KVStore

func (*Keeper) SaveOperatorParams

func (k *Keeper) SaveOperatorParams(ctx context.Context, operatorID uint32, params types.OperatorParams) error

SaveOperatorParams stores the given operator params

func (*Keeper) SetHooks

func (k *Keeper) SetHooks(rs types.OperatorsHooks) *Keeper

SetHooks allows to set the operators hooks

func (*Keeper) SetNextOperatorID

func (k *Keeper) SetNextOperatorID(ctx context.Context, operatorID uint32) error

SetNextOperatorID sets the next operator ID to be used when registering a new Operator

func (*Keeper) SetParams

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

SetParams sets module parameters

func (*Keeper) StartOperatorInactivation

func (k *Keeper) StartOperatorInactivation(ctx context.Context, operator types.Operator) error

StartOperatorInactivation starts the inactivation process for the operator with the given ID

Jump to

Keyboard shortcuts

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