Fix ibc client (#8341)

* fix-ibc-client

* add changelog
This commit is contained in:
Segue 2021-01-18 19:45:06 +08:00 committed by GitHub
parent afda62174f
commit 411b04d3aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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
}