keeper

package
v0.0.0-...-abdbe5d Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CoordinatorAddrNotFoundInvariant

func CoordinatorAddrNotFoundInvariant(k Keeper) sdk.Invariant

CoordinatorAddrNotFoundInvariant invariant that checks if the `CoordinateByAddress` is associated with a coordinator

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

func NewQueryServerImpl

func NewQueryServerImpl(k Keeper) types.QueryServer

NewQueryServerImpl returns an implementation of the QueryServer interface for the provided Keeper.

func RegisterInvariants

func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)

RegisterInvariants registers all module invariants

Types

type Keeper

type Keeper struct {
	Schema                     collections.Schema
	Params                     collections.Item[types.Params]
	CoordinatorSeq             collections.Sequence
	Coordinator                collections.Map[uint64, types.Coordinator]
	CoordinatorByAddress       collections.Map[sdk.AccAddress, types.CoordinatorByAddress]
	Validator                  collections.Map[string, types.Validator]
	ValidatorByOperatorAddress collections.Map[string, types.ValidatorByOperatorAddress]
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	addressCodec address.Codec,
	storeService store.KVStoreService,
	logger log.Logger,
	authority string,
) Keeper

func (Keeper) AddressCodec

func (k Keeper) AddressCodec() address.Codec

AddressCodec returns the address codec.

func (Keeper) AppendCoordinator

func (k Keeper) AppendCoordinator(ctx context.Context, coordinator types.Coordinator) (uint64, error)

AppendCoordinator appends a coordinator in the store with a new coordinator id and update the count

func (Keeper) CoordinatorByAddresses

func (k Keeper) CoordinatorByAddresses(ctx context.Context) ([]types.CoordinatorByAddress, error)

CoordinatorByAddresses returns all CoordinatorByAddress.

func (Keeper) CoordinatorIDFromAddress

func (k Keeper) CoordinatorIDFromAddress(ctx context.Context, address sdk.AccAddress) (uint64, error)

func (Keeper) Coordinators

func (k Keeper) Coordinators(ctx context.Context) ([]types.Coordinator, error)

Coordinators returns all Coordinator.

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the module's authority.

func (Keeper) GetCoordinator

func (k Keeper) GetCoordinator(ctx context.Context, coordinatorID uint64) (types.Coordinator, error)

func (Keeper) GetCoordinatorByAddress

func (k Keeper) GetCoordinatorByAddress(ctx context.Context, address sdk.AccAddress) (types.CoordinatorByAddress, error)

GetCoordinatorByAddress returns the CoordinatorByAddress associated to an address returns ErrCoordAddressNotFound if not found in the store if the corresponding Coordinator is not found or is inactive, returns ErrCritical

func (Keeper) GetValidator

func (k Keeper) GetValidator(ctx context.Context, address string) (types.Validator, error)

func (Keeper) GetValidatorByOperatorAddress

func (k Keeper) GetValidatorByOperatorAddress(ctx context.Context, operatorAddress string) (types.ValidatorByOperatorAddress, error)

func (Keeper) ListValidator

func (k Keeper) ListValidator(ctx context.Context) ([]types.Validator, error)

ListValidator returns all Validator.

func (Keeper) Logger

func (k Keeper) Logger() log.Logger

Logger returns a module-specific logger.

Jump to

Keyboard shortcuts

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