diff --git a/CHANGELOG.md b/CHANGELOG.md index aa8f7658ec25..bec47aa9bdf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes * (x/auth) [\#8287](https://github.com/cosmos/cosmos-sdk/pull/8287) Fix `tx sign --signature-only` to return correct sequence value in signature. + * (x/ibc) [\#8341](https://github.com/cosmos/cosmos-sdk/pull/8341) Fix query latest consensus state. ## [v0.40.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.40.0) - 2021-01-08 diff --git a/x/ibc/core/04-channel/client/utils/utils.go b/x/ibc/core/04-channel/client/utils/utils.go index c10dc05c7fd3..167e05d048e9 100644 --- a/x/ibc/core/04-channel/client/utils/utils.go +++ b/x/ibc/core/04-channel/client/utils/utils.go @@ -133,8 +133,9 @@ func QueryLatestConsensusState( if err != nil { return nil, clienttypes.Height{}, clienttypes.Height{}, err } - clientState, err := clienttypes.UnpackClientState(clientRes.IdentifiedClientState.ClientState) - if err != nil { + + var clientState exported.ClientState + if err := clientCtx.InterfaceRegistry.UnpackAny(clientRes.IdentifiedClientState.ClientState, &clientState); err != nil { return nil, clienttypes.Height{}, clienttypes.Height{}, err } @@ -148,8 +149,8 @@ func QueryLatestConsensusState( return nil, clienttypes.Height{}, clienttypes.Height{}, err } - consensusState, err := clienttypes.UnpackConsensusState(res.ConsensusState) - if err != nil { + var consensusState exported.ConsensusState + if err := clientCtx.InterfaceRegistry.UnpackAny(res.ConsensusState, &consensusState); err != nil { return nil, clienttypes.Height{}, clienttypes.Height{}, err }