extended_client_keeper

package
v0.6.0-rc0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientHooks

type ClientHooks interface {
	AfterHeaderWithValidCommit(ctx sdk.Context, txHash []byte, header *HeaderInfo, isOnFork bool)
}

ClientHooks defines the hook interface for client

type ExtendedKeeper

type ExtendedKeeper struct {
	clientkeeper.Keeper
	// contains filtered or unexported fields
}

ExtendedKeeper is same as the original clientkeeper.Keeper, except that

  • it provides hooks for notifying other modules on received headers
  • it applies different verification rules on received headers (notably, intercepting headers rather than freezing clients upon errors that indicate dishonest majority)

func NewExtendedKeeper

NewExtendedKeeper creates a new NewExtendedKeeper instance

func (ExtendedKeeper) AfterHeaderWithValidCommit

func (ek ExtendedKeeper) AfterHeaderWithValidCommit(ctx sdk.Context, txHash []byte, header *HeaderInfo, isOnFork bool)

func (*ExtendedKeeper) SetHooks

func (ek *ExtendedKeeper) SetHooks(ch ClientHooks) *ExtendedKeeper

SetHooks sets the hooks for ExtendedKeeper

func (ExtendedKeeper) UpdateClient

func (k ExtendedKeeper) UpdateClient(ctx sdk.Context, clientID string, clientMsg exported.ClientMessage) error

UpdateClient updates the consensus state and the state root from a provided header. The implementation is the same as the original IBC-Go implementation, except from: 1. Not freezing the client when finding a misbehaviour for header message 2. Calling a AfterHeaderWithValidCommit callback when receiving valid header messages (either misbehaving or not)

type HeaderInfo

type HeaderInfo struct {
	Hash     []byte
	ChaindId string
	Height   uint64
}

func GetHeaderInfo

func GetHeaderInfo(ctx sdk.Context, m exported.ClientMessage) *HeaderInfo

GetHeaderInfo returns the information necessary for header timestamping or nil if provided message is not a header

type MultiClientHooks

type MultiClientHooks []ClientHooks

func NewMultiClientHooks

func NewMultiClientHooks(hooks ...ClientHooks) MultiClientHooks

func (MultiClientHooks) AfterHeaderWithValidCommit

func (h MultiClientHooks) AfterHeaderWithValidCommit(ctx sdk.Context, txHash []byte, header *HeaderInfo, isOnFork bool)

invoke hooks in each keeper that hooks onto ExtendedKeeper

Jump to

Keyboard shortcuts

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