Skip to content

Commit a0070b2

Browse files
chandiniv1DimitrisJimdamiannolan
authored
removed QueryLatestConsensusState (#5991)
* removed QueryLatestConsensusState * nit: rm stale imports. * chore: add changelog --------- Co-authored-by: DimitrisJim <[email protected]> Co-authored-by: Damian Nolan <[email protected]>
1 parent 04810d5 commit a0070b2

File tree

3 files changed

+3
-39
lines changed

3 files changed

+3
-39
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
4141
### API Breaking
4242

4343
* (core/02-client, light-clients) [\#5806](https://github.com/cosmos/ibc-go/pull/5806) Decouple light client routing from their encoding structure.
44+
* (core/04-channel) [\#5991](https://github.com/cosmos/ibc-go/pull/5991) The client CLI `QueryLatestConsensusState` has been removed.
4445

4546
### State Machine Breaking
4647

docs/docs/05-migrations/13-v8-to-v9.md

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ The functions `GetPortID()`, `GetChannelID()` of the `CounterpartyChannel` type
3434
The functions `GetClientID()`, `GetState()`, `GetCounterparty()`, `GetVersions()`, and `GetDelayPeriod` of the `Connection` type have been removed.
3535
The functions `GetClientID()`, `GetConnectionID()`, and `GetPrefix()` of the `CounterpartyConnection` type have been removed.
3636

37+
The utility function `QueryLatestConsensusState` of `04-channel` CLI has been removed.
38+
3739
### API deprecation notice
3840

3941
The testing package functions `coordinator.Setup`, `coordinator.SetupClients`, `coordinator.SetupConnections`, `coordinator.CreateConnections`, and `coordinator.CreateChannels` have been deprecated and will be removed in v10.

modules/core/04-channel/client/utils/utils.go

-39
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ import (
1414
"github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
1515
host "github.com/cosmos/ibc-go/v8/modules/core/24-host"
1616
ibcclient "github.com/cosmos/ibc-go/v8/modules/core/client"
17-
ibcerrors "github.com/cosmos/ibc-go/v8/modules/core/errors"
18-
"github.com/cosmos/ibc-go/v8/modules/core/exported"
19-
ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"
2017
)
2118

2219
// QueryChannel returns a channel end.
@@ -126,42 +123,6 @@ func QueryChannelConsensusState(
126123
return res, nil
127124
}
128125

129-
// QueryLatestConsensusState uses the channel Querier to return the
130-
// latest ConsensusState given the source port ID and source channel ID.
131-
// Deprecated: This function will be removed in a later release of ibc-go.
132-
// NOTE: This function only supports querying latest consensus state of 07-tendermint client state implementations.
133-
func QueryLatestConsensusState(
134-
clientCtx client.Context, portID, channelID string,
135-
) (exported.ConsensusState, clienttypes.Height, clienttypes.Height, error) {
136-
clientRes, err := QueryChannelClientState(clientCtx, portID, channelID, false)
137-
if err != nil {
138-
return nil, clienttypes.Height{}, clienttypes.Height{}, err
139-
}
140-
141-
var clientState exported.ClientState
142-
if err := clientCtx.InterfaceRegistry.UnpackAny(clientRes.IdentifiedClientState.ClientState, &clientState); err != nil {
143-
return nil, clienttypes.Height{}, clienttypes.Height{}, err
144-
}
145-
146-
tmClientState, ok := clientState.(*ibctm.ClientState)
147-
if !ok {
148-
return nil, clienttypes.Height{}, clienttypes.Height{}, errorsmod.Wrapf(ibcerrors.ErrInvalidType, "expected type: %T, got: %T",
149-
ibctm.ClientState{}, clientState)
150-
}
151-
152-
res, err := QueryChannelConsensusState(clientCtx, portID, channelID, tmClientState.LatestHeight, false)
153-
if err != nil {
154-
return nil, clienttypes.Height{}, clienttypes.Height{}, err
155-
}
156-
157-
var consensusState exported.ConsensusState
158-
if err := clientCtx.InterfaceRegistry.UnpackAny(res.ConsensusState, &consensusState); err != nil {
159-
return nil, clienttypes.Height{}, clienttypes.Height{}, err
160-
}
161-
162-
return consensusState, tmClientState.LatestHeight, res.ProofHeight, nil
163-
}
164-
165126
// QueryNextSequenceReceive returns the next sequence receive.
166127
// If prove is true, it performs an ABCI store query in order to retrieve the merkle proof. Otherwise,
167128
// it uses the gRPC query client.

0 commit comments

Comments
 (0)