keeper

package
v0.20.5 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: Apache-2.0 Imports: 19 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 storetypes.StoreKey,
	ps paramtypes.Subspace,
) *Keeper

func (Keeper) BeginBlock

func (k Keeper) BeginBlock(ctx sdk.Context)

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) GetExpandedSpec

func (k Keeper) GetExpandedSpec(ctx sdk.Context, index string) (types.Spec, error)

func (Keeper) GetExpectedServicesForExpandedSpec

func (k Keeper) GetExpectedServicesForExpandedSpec(expandedSpec types.Spec, mandatory bool) map[epochstoragetypes.EndpointService]struct{}

func (Keeper) GetExpectedServicesForSpec

func (k Keeper) GetExpectedServicesForSpec(ctx sdk.Context, chainID string, mandatory bool) (expectedServices map[epochstoragetypes.EndpointService]struct{}, err error)

returns map[apiInterface][]addons

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, providersType types.Spec_ProvidersTypes)

returns whether a spec name is a valid spec in the consensus first return value is found and active, second argument is found only, third argument is the provider's type (dynamic/static)

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) RefreshSpec

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

RefreshSpec checks which one Spec inherits from another (just recently updated) Spec, and if so updates the the BlockLastUpdated of the former.

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)

type Migrator

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

func NewMigrator

func NewMigrator(keeper Keeper) Migrator

func (Migrator) Migrate2to3

func (m Migrator) Migrate2to3(ctx sdk.Context) error

Jump to

Keyboard shortcuts

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