diff --git a/x/ibc/02-client/client/cli/query.go b/x/ibc/02-client/client/cli/query.go index a64405b62993..682758783292 100644 --- a/x/ibc/02-client/client/cli/query.go +++ b/x/ibc/02-client/client/cli/query.go @@ -102,7 +102,7 @@ func GetCmdQueryConsensusState(queryRoute string, cdc *codec.Codec) *cobra.Comma prove := viper.GetBool(flags.FlagProve) - csRes, err := utils.QueryConsensusStateProof(cliCtx, clientID, prove) + csRes, err := utils.QueryConsensusState(cliCtx, clientID, prove) if err != nil { return err } diff --git a/x/ibc/02-client/client/rest/query.go b/x/ibc/02-client/client/rest/query.go index d831aa396719..3b59aeb49f85 100644 --- a/x/ibc/02-client/client/rest/query.go +++ b/x/ibc/02-client/client/rest/query.go @@ -113,7 +113,7 @@ func queryConsensusStateHandlerFn(cliCtx context.CLIContext) http.HandlerFunc { return } - csRes, err := utils.QueryConsensusStateProof(cliCtx, clientID, prove) + csRes, err := utils.QueryConsensusState(cliCtx, clientID, prove) if err != nil { rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) return diff --git a/x/ibc/02-client/client/utils/utils.go b/x/ibc/02-client/client/utils/utils.go index 30f56e57a9db..848d489b2308 100644 --- a/x/ibc/02-client/client/utils/utils.go +++ b/x/ibc/02-client/client/utils/utils.go @@ -53,7 +53,7 @@ func QueryClientState( } var clientState types.State - if err := cliCtx.Codec.UnmarshalJSON(res.Value, &clientState); err != nil { + if err := cliCtx.Codec.UnmarshalBinaryLengthPrefixed(res.Value, &clientState); err != nil { return types.StateResponse{}, err } @@ -64,7 +64,7 @@ func QueryClientState( // QueryConsensusStateProof queries the store to get the consensus state and a // merkle proof. -func QueryConsensusStateProof( +func QueryConsensusState( cliCtx client.CLIContext, clientID string, prove bool) (types.ConsensusStateResponse, error) { var conStateRes types.ConsensusStateResponse @@ -80,7 +80,7 @@ func QueryConsensusStateProof( } var cs tendermint.ConsensusState - if err := cliCtx.Codec.UnmarshalJSON(res.Value, &cs); err != nil { + if err := cliCtx.Codec.UnmarshalBinaryLengthPrefixed(res.Value, &cs); err != nil { return conStateRes, err } @@ -104,7 +104,7 @@ func QueryCommitmentRoot( } var root commitment.Root - if err := cliCtx.Codec.UnmarshalJSON(res.Value, &root); err != nil { + if err := cliCtx.Codec.UnmarshalBinaryLengthPrefixed(res.Value, &root); err != nil { return types.RootResponse{}, err } @@ -129,7 +129,7 @@ func QueryCommitter( } var committer tendermint.Committer - if err := cliCtx.Codec.UnmarshalJSON(res.Value, &committer); err != nil { + if err := cliCtx.Codec.UnmarshalBinaryLengthPrefixed(res.Value, &committer); err != nil { return types.CommitterResponse{}, err }