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 ¶
func NewExtendedKeeper(cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace paramtypes.Subspace, sk types.StakingKeeper, uk types.UpgradeKeeper) ExtendedKeeper
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 ¶
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