keeper

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSpecIDBytes

func GetSpecIDBytes(id uint64) []byte

GetSpecIDBytes returns the byte representation of the ID

func GetSpecIDFromBytes

func GetSpecIDFromBytes(bz []byte) uint64

GetSpecIDFromBytes returns ID in uint64 format from a byte array

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey sdk.StoreKey,
	ps paramtypes.Subspace,
) *Keeper

func (Keeper) ExpandSpec

func (k Keeper) ExpandSpec(ctx sdk.Context, spec types.Spec) (types.Spec, error)

ExpandSpec takes a (raw) Spec and expands the "imports" field of the spec -if needed, recursively- to add to the current Spec those additional APIs from the imported Spec(s). It returns the expanded Spec.

func (Keeper) GeolocationCount added in v0.4.3

func (k Keeper) GeolocationCount(ctx sdk.Context) (res uint64)

GeolocationCount returns the GeolocationCount param

func (Keeper) GetAllChainIDs

func (k Keeper) GetAllChainIDs(ctx sdk.Context) (chainIDs []string)

func (Keeper) GetAllSpec

func (k Keeper) GetAllSpec(ctx sdk.Context) (list []types.Spec)

GetAllSpec returns all Spec

func (Keeper) GetExpectedInterfacesForSpec added in v0.4.3

func (k Keeper) GetExpectedInterfacesForSpec(ctx sdk.Context, chainID string) (expectedInterfaces map[string]bool)

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) types.Params

GetParams get all parameters as types.Params

func (Keeper) GetSpec

func (k Keeper) GetSpec(
	ctx sdk.Context,
	index string,
) (val types.Spec, found bool)

GetSpec returns a Spec from its index

func (Keeper) IsFinalizedBlock

func (k Keeper) IsFinalizedBlock(ctx sdk.Context, chainID string, requestedBlock int64, latestBlock int64) bool

func (Keeper) IsSpecFoundAndActive

func (k Keeper) IsSpecFoundAndActive(ctx sdk.Context, chainID string) (foundAndActive bool, found bool)

returns whether a spec name is a valid spec in the consensus first return value is found and active, second argument is found only

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

func (Keeper) MaxCU

func (k Keeper) MaxCU(ctx sdk.Context) (res uint64)

MaxCU returns the MaxCU param

func (Keeper) Params

func (Keeper) RemoveSpec

func (k Keeper) RemoveSpec(
	ctx sdk.Context,
	index string,
)

RemoveSpec removes a Spec from the store

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SetSpec

func (k Keeper) SetSpec(ctx sdk.Context, spec types.Spec)

SetSpec set a specific Spec in the store from its index

func (Keeper) SpecAllRaw

func (Keeper) ValidateSpec

func (k Keeper) ValidateSpec(ctx sdk.Context, spec types.Spec) (map[string]string, error)

Jump to

Keyboard shortcuts

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