diff --git a/modules/light-clients/09-localhost/types/client_state.go b/modules/light-clients/09-localhost/types/client_state.go index 1670d4f1e6b..d8f0af38f00 100644 --- a/modules/light-clients/09-localhost/types/client_state.go +++ b/modules/light-clients/09-localhost/types/client_state.go @@ -79,6 +79,27 @@ func (cs ClientState) ExportMetadata(_ sdk.KVStore) []exported.GenesisMetadata { // CheckHeaderAndUpdateState updates the localhost client. It only needs access to the context func (cs *ClientState) CheckHeaderAndUpdateState( + ctx sdk.Context, cdc codec.BinaryCodec, clientStore sdk.KVStore, header exported.Header, +) (exported.ClientState, exported.ConsensusState, error) { + return cs.UpdateState(ctx, cdc, clientStore, header) +} + +// VerifyHeader is a no-op. +func (cs *ClientState) VerifyHeader( + _ sdk.Context, _ codec.BinaryCodec, _ sdk.KVStore, _ exported.Header, +) (exported.ClientState, exported.ConsensusState, error) { + return cs, nil, nil +} + +// CheckForMisbehaviour returns false. +func (cs *ClientState) CheckForMisbehaviour( + _ sdk.Context, _ codec.BinaryCodec, _ sdk.KVStore, _ exported.Header, +) (bool, error) { + return false, nil +} + +// UpdateState updates the localhost client. It only needs access to the context +func (cs *ClientState) UpdateState( ctx sdk.Context, _ codec.BinaryCodec, _ sdk.KVStore, _ exported.Header, ) (exported.ClientState, exported.ConsensusState, error) { // use the chain ID from context since the localhost client is from the running chain (i.e self). @@ -88,6 +109,13 @@ func (cs *ClientState) CheckHeaderAndUpdateState( return cs, nil, nil } +// UpdateStateOnMisbehaviour returns an error (no misbehaviour case). +func (cs *ClientState) UpdateStateOnMisbehaviour( + _ sdk.Context, _ codec.BinaryCodec, _ sdk.KVStore, _ exported.Header, +) (*ClientState, error) { + return nil, sdkerrors.Wrapf(clienttypes.ErrUpdateClientFailed, "cannot update localhost client on misbehaviour") +} + // CheckMisbehaviourAndUpdateState implements ClientState // Since localhost is the client of the running chain, misbehaviour cannot be submitted to it // Thus, CheckMisbehaviourAndUpdateState returns an error for localhost