Skip to content

Commit

Permalink
Revert "chore: use header service in localhost client (#7757)"
Browse files Browse the repository at this point in the history
This reverts commit 0bea84d.
  • Loading branch information
gjermundgaraba committed Feb 7, 2025
1 parent e396a45 commit 3bec1e5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/light-clients/09-localhost/light_client_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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 @@ -166,8 +167,9 @@ 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 (l LightClientModule) TimestampAtHeight(ctx context.Context, _ string, _ exported.Height) (uint64, error) {
return uint64(l.HeaderService.HeaderInfo(ctx).Time.UnixNano()), nil
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
}

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

0 comments on commit 3bec1e5

Please sign in to comment.