Skip to content

Commit e86dbe8

Browse files
committed
removed QueryLatestConsensusState
1 parent 743f286 commit e86dbe8

File tree

1 file changed

+0
-33
lines changed
  • modules/core/04-channel/client/utils

1 file changed

+0
-33
lines changed

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

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -125,39 +125,6 @@ func QueryChannelConsensusState(
125125
return res, nil
126126
}
127127

128-
// QueryLatestConsensusState uses the channel Querier to return the
129-
// latest ConsensusState given the source port ID and source channel ID.
130-
func QueryLatestConsensusState(
131-
clientCtx client.Context, portID, channelID string,
132-
) (exported.ConsensusState, clienttypes.Height, clienttypes.Height, error) {
133-
clientRes, err := QueryChannelClientState(clientCtx, portID, channelID, false)
134-
if err != nil {
135-
return nil, clienttypes.Height{}, clienttypes.Height{}, err
136-
}
137-
138-
var clientState exported.ClientState
139-
if err := clientCtx.InterfaceRegistry.UnpackAny(clientRes.IdentifiedClientState.ClientState, &clientState); err != nil {
140-
return nil, clienttypes.Height{}, clienttypes.Height{}, err
141-
}
142-
143-
clientHeight, ok := clientState.GetLatestHeight().(clienttypes.Height)
144-
if !ok {
145-
return nil, clienttypes.Height{}, clienttypes.Height{}, errorsmod.Wrapf(ibcerrors.ErrInvalidHeight, "invalid height type. expected type: %T, got: %T",
146-
clienttypes.Height{}, clientHeight)
147-
}
148-
res, err := QueryChannelConsensusState(clientCtx, portID, channelID, clientHeight, false)
149-
if err != nil {
150-
return nil, clienttypes.Height{}, clienttypes.Height{}, err
151-
}
152-
153-
var consensusState exported.ConsensusState
154-
if err := clientCtx.InterfaceRegistry.UnpackAny(res.ConsensusState, &consensusState); err != nil {
155-
return nil, clienttypes.Height{}, clienttypes.Height{}, err
156-
}
157-
158-
return consensusState, clientHeight, res.ProofHeight, nil
159-
}
160-
161128
// QueryNextSequenceReceive returns the next sequence receive.
162129
// If prove is true, it performs an ABCI store query in order to retrieve the merkle proof. Otherwise,
163130
// it uses the gRPC query client.

0 commit comments

Comments
 (0)