From 18b217ccabe9dcb189718fcb8599979b395144d5 Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Fri, 6 Dec 2024 05:58:56 +0200 Subject: [PATCH] chore: drop func to provide proof --- modules/core/04-channel/v2/client/cli/abci.go | 29 ------------------- .../core/04-channel/v2/client/cli/query.go | 16 +--------- 2 files changed, 1 insertion(+), 44 deletions(-) diff --git a/modules/core/04-channel/v2/client/cli/abci.go b/modules/core/04-channel/v2/client/cli/abci.go index 0b368c38b53..d341e35b4e2 100644 --- a/modules/core/04-channel/v2/client/cli/abci.go +++ b/modules/core/04-channel/v2/client/cli/abci.go @@ -1,46 +1,17 @@ package cli import ( - "context" "encoding/binary" errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/client" - clientutils "github.com/cosmos/ibc-go/v9/modules/core/02-client/client/utils" - clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" hostv2 "github.com/cosmos/ibc-go/v9/modules/core/24-host/v2" ibcclient "github.com/cosmos/ibc-go/v9/modules/core/client" ) -func queryChannelClientStateABCI(clientCtx client.Context, channelID string) (*types.QueryChannelClientStateResponse, error) { - queryClient := types.NewQueryClient(clientCtx) - req := &types.QueryChannelClientStateRequest{ - ChannelId: channelID, - } - - res, err := queryClient.ChannelClientState(context.Background(), req) - if err != nil { - return nil, err - } - - clientStateRes, err := clientutils.QueryClientStateABCI(clientCtx, res.IdentifiedClientState.ClientId) - if err != nil { - return nil, err - } - - // use client state returned from ABCI query in case query height differs - identifiedClientState := clienttypes.IdentifiedClientState{ - ClientId: res.IdentifiedClientState.ClientId, - ClientState: clientStateRes.ClientState, - } - res = types.NewQueryChannelClientStateResponse(identifiedClientState, clientStateRes.Proof, clientStateRes.ProofHeight) - - return res, nil -} - func queryNextSequenceSendABCI(clientCtx client.Context, channelID string) (*types.QueryNextSequenceSendResponse, error) { key := hostv2.NextSequenceSendKey(channelID) value, proofBz, proofHeight, err := ibcclient.QueryTendermintProof(clientCtx, key) diff --git a/modules/core/04-channel/v2/client/cli/query.go b/modules/core/04-channel/v2/client/cli/query.go index fd66f4529f1..04f9f91e5c7 100644 --- a/modules/core/04-channel/v2/client/cli/query.go +++ b/modules/core/04-channel/v2/client/cli/query.go @@ -64,21 +64,8 @@ func getCmdQueryChannelClientState() *cobra.Command { } channelID := args[0] - prove, err := cmd.Flags().GetBool(flags.FlagProve) - if err != nil { - return err - } - - if prove { - res, err := queryChannelClientStateABCI(clientCtx, channelID) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - } - queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.ChannelClientState(cmd.Context(), types.NewQueryChannelClientStateRequest(channelID)) if err != nil { return err @@ -88,7 +75,6 @@ func getCmdQueryChannelClientState() *cobra.Command { }, } - cmd.Flags().Bool(flags.FlagProve, true, "show proofs for the query results") flags.AddQueryFlagsToCmd(cmd) return cmd