keeper

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 21 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,
	stakingKeeper types.StakingKeeper,
) *Keeper

func (Keeper) AllowlistReset

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

func (Keeper) AllowlistedExpeditedMsgs

func (k Keeper) AllowlistedExpeditedMsgs(ctx sdk.Context) (res []string)

AllowlistedExpeditedMsgs returns the AllowlistedExpeditedMsgs param

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

func (k Keeper) GetContributorReward(ctx sdk.Context, chainId string) (contributors []sdk.AccAddress, percentage math.LegacyDec)

returns the reward per contributor

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

func (k Keeper) GetMinStake(ctx sdk.Context, chainID string) sdk.Coin

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, latestBlock int64) bool

func (Keeper) IsSpecFoundAndActive

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

IsSpecFoundAndActive returns whether a spec name is a valid spec in the consensus. It returns whether the spec is active (and found), whether it was found, and the provider's type (e.g. 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

func (Migrator) Migrate3to4 added in v1.1.0

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

Jump to

Keyboard shortcuts

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