Skip to content

Commit 0bea84d

Browse files
authored
chore: use header service in localhost client (#7757)
1 parent 23a4a96 commit 0bea84d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

modules/light-clients/09-localhost/light_client_module.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
errorsmod "cosmossdk.io/errors"
99

1010
"github.com/cosmos/cosmos-sdk/codec"
11-
sdk "github.com/cosmos/cosmos-sdk/types"
1211

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

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

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

0 commit comments

Comments
 (0)