From e86dbe88c6824967795bc2c47b51dba4a1b4b471 Mon Sep 17 00:00:00 2001 From: chandiniv1 Date: Thu, 14 Mar 2024 15:01:37 +0530 Subject: [PATCH 1/4] removed QueryLatestConsensusState --- modules/core/04-channel/client/utils/utils.go | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/modules/core/04-channel/client/utils/utils.go b/modules/core/04-channel/client/utils/utils.go index c5118aa0011..c9a505a36d1 100644 --- a/modules/core/04-channel/client/utils/utils.go +++ b/modules/core/04-channel/client/utils/utils.go @@ -125,39 +125,6 @@ func QueryChannelConsensusState( return res, nil } -// QueryLatestConsensusState uses the channel Querier to return the -// latest ConsensusState given the source port ID and source channel ID. -func QueryLatestConsensusState( - clientCtx client.Context, portID, channelID string, -) (exported.ConsensusState, clienttypes.Height, clienttypes.Height, error) { - clientRes, err := QueryChannelClientState(clientCtx, portID, channelID, false) - if err != nil { - return nil, clienttypes.Height{}, clienttypes.Height{}, err - } - - var clientState exported.ClientState - if err := clientCtx.InterfaceRegistry.UnpackAny(clientRes.IdentifiedClientState.ClientState, &clientState); err != nil { - return nil, clienttypes.Height{}, clienttypes.Height{}, err - } - - clientHeight, ok := clientState.GetLatestHeight().(clienttypes.Height) - if !ok { - return nil, clienttypes.Height{}, clienttypes.Height{}, errorsmod.Wrapf(ibcerrors.ErrInvalidHeight, "invalid height type. expected type: %T, got: %T", - clienttypes.Height{}, clientHeight) - } - res, err := QueryChannelConsensusState(clientCtx, portID, channelID, clientHeight, false) - if err != nil { - return nil, clienttypes.Height{}, clienttypes.Height{}, err - } - - var consensusState exported.ConsensusState - if err := clientCtx.InterfaceRegistry.UnpackAny(res.ConsensusState, &consensusState); err != nil { - return nil, clienttypes.Height{}, clienttypes.Height{}, err - } - - return consensusState, clientHeight, res.ProofHeight, nil -} - // QueryNextSequenceReceive returns the next sequence receive. // If prove is true, it performs an ABCI store query in order to retrieve the merkle proof. Otherwise, // it uses the gRPC query client. From 18522109218a116aeb96511f265b6d4af1fadba8 Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Thu, 14 Mar 2024 11:49:28 +0200 Subject: [PATCH 2/4] nit: rm stale imports. --- modules/core/04-channel/client/utils/utils.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/core/04-channel/client/utils/utils.go b/modules/core/04-channel/client/utils/utils.go index c9a505a36d1..b41ed53afbf 100644 --- a/modules/core/04-channel/client/utils/utils.go +++ b/modules/core/04-channel/client/utils/utils.go @@ -14,8 +14,6 @@ import ( "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" host "github.com/cosmos/ibc-go/v8/modules/core/24-host" ibcclient "github.com/cosmos/ibc-go/v8/modules/core/client" - ibcerrors "github.com/cosmos/ibc-go/v8/modules/core/errors" - "github.com/cosmos/ibc-go/v8/modules/core/exported" ) // QueryChannel returns a channel end. From f45860f6eb542d7f0f1d736405078418fe23a366 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Thu, 14 Mar 2024 22:57:41 +0100 Subject: [PATCH 3/4] chore: add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7bee513a0c..74b300c522b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking * (core/02-client, light-clients) [\#5806](https://github.com/cosmos/ibc-go/pull/5806) Decouple light client routing from their encoding structure. +* (core/04-channel) [\#5991](https://github.com/cosmos/ibc-go/pull/5991) The client CLI `QueryLatestConsensusState` has been removed. ### State Machine Breaking From 81f73483806556c6d3da695794f09ec40e0267a2 Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez Date: Fri, 15 Mar 2024 09:57:54 +0100 Subject: [PATCH 4/4] add note in v9 migration docs --- docs/docs/05-migrations/13-v8-to-v9.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/docs/05-migrations/13-v8-to-v9.md b/docs/docs/05-migrations/13-v8-to-v9.md index 7038ec6e265..489b88d4f47 100644 --- a/docs/docs/05-migrations/13-v8-to-v9.md +++ b/docs/docs/05-migrations/13-v8-to-v9.md @@ -34,6 +34,8 @@ The functions `GetPortID()`, `GetChannelID()` of the `CounterpartyChannel` type The functions `GetClientID()`, `GetState()`, `GetCounterparty()`, `GetVersions()`, and `GetDelayPeriod` of the `Connection` type have been removed. The functions `GetClientID()`, `GetConnectionID()`, and `GetPrefix()` of the `CounterpartyConnection` type have been removed. +The utility function `QueryLatestConsensusState` of `04-channel` CLI has been removed. + ### API deprecation notice The testing package functions `coordinator.Setup`, `coordinator.SetupClients`, `coordinator.SetupConnections`, `coordinator.CreateConnections`, and `coordinator.CreateChannels` have been deprecated and will be removed in v10.