Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed QueryLatestConsensusState #5991

Merged
33 changes: 0 additions & 33 deletions modules/core/04-channel/client/utils/utils.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package utils

Check failure on line 1 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / lint

: # github.com/cosmos/ibc-go/v8/modules/core/04-channel/client/utils

import (
"context"
Expand All @@ -14,8 +14,8 @@
"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"

Check failure on line 17 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / lint

"github.com/cosmos/ibc-go/v8/modules/core/errors" imported as ibcerrors and not used

Check failure on line 17 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / lint

"github.com/cosmos/ibc-go/v8/modules/core/errors" imported as ibcerrors and not used

Check failure on line 17 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (01)

"github.com/cosmos/ibc-go/v8/modules/core/errors" imported as ibcerrors and not used

Check failure on line 17 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (01)

"github.com/cosmos/ibc-go/v8/modules/core/errors" imported as ibcerrors and not used

Check failure on line 17 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (00)

"github.com/cosmos/ibc-go/v8/modules/core/errors" imported as ibcerrors and not used

Check failure on line 17 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (03)

"github.com/cosmos/ibc-go/v8/modules/core/errors" imported as ibcerrors and not used

Check failure on line 17 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (03)

"github.com/cosmos/ibc-go/v8/modules/core/errors" imported as ibcerrors and not used

Check failure on line 17 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (02)

"github.com/cosmos/ibc-go/v8/modules/core/errors" imported as ibcerrors and not used

Check failure on line 17 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (02)

"github.com/cosmos/ibc-go/v8/modules/core/errors" imported as ibcerrors and not used

Check failure on line 17 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (02)

"github.com/cosmos/ibc-go/v8/modules/core/errors" imported as ibcerrors and not used

Check failure on line 17 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (02)

"github.com/cosmos/ibc-go/v8/modules/core/errors" imported as ibcerrors and not used

Check failure on line 17 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (02)

"github.com/cosmos/ibc-go/v8/modules/core/errors" imported as ibcerrors and not used

Check failure on line 17 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / build (arm64)

"github.com/cosmos/ibc-go/v8/modules/core/errors" imported as ibcerrors and not used

Check failure on line 17 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / build (amd64)

"github.com/cosmos/ibc-go/v8/modules/core/errors" imported as ibcerrors and not used
"github.com/cosmos/ibc-go/v8/modules/core/exported"

Check failure on line 18 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / lint

"github.com/cosmos/ibc-go/v8/modules/core/exported" imported and not used (typecheck)

Check failure on line 18 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / lint

"github.com/cosmos/ibc-go/v8/modules/core/exported" imported and not used) (typecheck)

Check failure on line 18 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (01)

"github.com/cosmos/ibc-go/v8/modules/core/exported" imported and not used

Check failure on line 18 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (01)

"github.com/cosmos/ibc-go/v8/modules/core/exported" imported and not used

Check failure on line 18 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (00)

"github.com/cosmos/ibc-go/v8/modules/core/exported" imported and not used

Check failure on line 18 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (03)

"github.com/cosmos/ibc-go/v8/modules/core/exported" imported and not used

Check failure on line 18 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (03)

"github.com/cosmos/ibc-go/v8/modules/core/exported" imported and not used

Check failure on line 18 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (02)

"github.com/cosmos/ibc-go/v8/modules/core/exported" imported and not used

Check failure on line 18 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (02)

"github.com/cosmos/ibc-go/v8/modules/core/exported" imported and not used

Check failure on line 18 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (02)

"github.com/cosmos/ibc-go/v8/modules/core/exported" imported and not used

Check failure on line 18 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (02)

"github.com/cosmos/ibc-go/v8/modules/core/exported" imported and not used

Check failure on line 18 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / tests (02)

"github.com/cosmos/ibc-go/v8/modules/core/exported" imported and not used

Check failure on line 18 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / build (arm64)

"github.com/cosmos/ibc-go/v8/modules/core/exported" imported and not used

Check failure on line 18 in modules/core/04-channel/client/utils/utils.go

View workflow job for this annotation

GitHub Actions / build (amd64)

"github.com/cosmos/ibc-go/v8/modules/core/exported" imported and not used
)

// QueryChannel returns a channel end.
Expand Down Expand Up @@ -125,39 +125,6 @@
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.
Expand Down
Loading