diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ad829f0065..8e7c5fa7795 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,7 +38,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes -* (modules/light-clients/06-solomachine) [\153](https://github.com/cosmos/ibc-go/pull/153) Fix solo machine proof height sequence mismatch bug. +* (02-client) [\#192](https://github.com/cosmos/ibc-go/pull/192) Fix IBC `query ibc client header` cli command. Support historical queries for query header/node-state commands. +* (modules/light-clients/06-solomachine) [\#153](https://github.com/cosmos/ibc-go/pull/153) Fix solo machine proof height sequence mismatch bug. * (modules/light-clients/06-solomachine) [\#122](https://github.com/cosmos/ibc-go/pull/122) Fix solo machine merkle prefix casting bug. * (modules/light-clients/06-solomachine) [\#120](https://github.com/cosmos/ibc-go/pull/120) Fix solo machine handshake verification bug. diff --git a/modules/core/02-client/client/utils/utils.go b/modules/core/02-client/client/utils/utils.go index b7614146113..dfbbefcb6c0 100644 --- a/modules/core/02-client/client/utils/utils.go +++ b/modules/core/02-client/client/utils/utils.go @@ -131,14 +131,19 @@ func QueryTendermintHeader(clientCtx client.Context) (ibctmtypes.Header, int64, return ibctmtypes.Header{}, 0, err } - height := info.Response.LastBlockHeight + var height int64 + if clientCtx.Height != 0 { + height = clientCtx.Height + } else { + height = info.Response.LastBlockHeight + } commit, err := node.Commit(context.Background(), &height) if err != nil { return ibctmtypes.Header{}, 0, err } - page := 0 + page := 1 count := 10_000 validators, err := node.Validators(context.Background(), &height, &page, &count) @@ -173,7 +178,12 @@ func QueryNodeConsensusState(clientCtx client.Context) (*ibctmtypes.ConsensusSta return &ibctmtypes.ConsensusState{}, 0, err } - height := info.Response.LastBlockHeight + var height int64 + if clientCtx.Height != 0 { + height = clientCtx.Height + } else { + height = info.Response.LastBlockHeight + } commit, err := node.Commit(context.Background(), &height) if err != nil {