keeper

package
v0.1.1 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: 22 Imported by: 62

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

Types

type Keeper

type Keeper struct {
	Schema    collections.Schema
	Evidences collections.Map[[]byte, exported.Evidence]
	// contains filtered or unexported fields
}

Keeper defines the evidence module's keeper. The keeper is responsible for managing persistence, state transitions and query handling for the evidence module.

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec, storeService store.KVStoreService, stakingKeeper types.StakingKeeper,
	slashingKeeper types.SlashingKeeper, ac address.Codec, ci comet.BlockInfoService,
) *Keeper

NewKeeper creates a new Keeper object.

func (Keeper) BeginBlocker

func (k Keeper) BeginBlocker(ctx context.Context) error

BeginBlocker iterates through and handles any newly discovered evidence of misbehavior submitted by CometBFT. Currently, only equivocation is handled.

func (Keeper) GetEvidenceHandler

func (k Keeper) GetEvidenceHandler(evidenceRoute string) (types.Handler, error)

GetEvidenceHandler returns a registered Handler for a given Evidence type. If no handler exists, an error is returned.

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (*Keeper) SetRouter

func (k *Keeper) SetRouter(rtr types.Router)

SetRouter sets the Evidence Handler router for the x/evidence module. Note, we allow the ability to set the router after the Keeper is constructed as a given Handler may need access the Keeper before being constructed. The router may only be set once and will be sealed if it's not already sealed.

func (Keeper) SubmitEvidence

func (k Keeper) SubmitEvidence(ctx context.Context, evidence exported.Evidence) error

SubmitEvidence attempts to match evidence against the keepers router and execute the corresponding registered Evidence Handler. An error is returned if no registered Handler exists or if the Handler fails. Otherwise, the evidence is persisted.

type Querier

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

func NewQuerier

func NewQuerier(keeper *Keeper) Querier

func (Querier) AllEvidence

AllEvidence implements the Query/AllEvidence gRPC method

func (Querier) Evidence

Evidence implements the Query/Evidence gRPC method

Jump to

Keyboard shortcuts

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