Skip to content

Commit

Permalink
chore: use header service in localhost client (#7757)
Browse files Browse the repository at this point in the history
  • Loading branch information
damiannolan authored Dec 20, 2024
1 parent 23a4a96 commit 0bea84d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions modules/light-clients/09-localhost/light_client_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
errorsmod "cosmossdk.io/errors"

"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"

clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types"
commitmenttypes "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types"
Expand Down Expand Up @@ -167,9 +166,8 @@ func (LightClientModule) LatestHeight(ctx context.Context, _ string) exported.He

// TimestampAtHeight returns the current block time retrieved from the application context. The localhost client does not store consensus states and thus
// cannot provide a timestamp for the provided height.
func (LightClientModule) TimestampAtHeight(ctx context.Context, _ string, _ exported.Height) (uint64, error) {
sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917
return uint64(sdkCtx.BlockTime().UnixNano()), nil
func (l LightClientModule) TimestampAtHeight(ctx context.Context, _ string, _ exported.Height) (uint64, error) {
return uint64(l.HeaderService.HeaderInfo(ctx).Time.UnixNano()), nil
}

// RecoverClient returns an error. The localhost cannot be modified by proposals.
Expand Down

0 comments on commit 0bea84d

Please sign in to comment.