From 0ba8de707ea223a7192f8497dff2cacad52643d3 Mon Sep 17 00:00:00 2001 From: Aditya Sripal <14364734+AdityaSripal@users.noreply.github.com> Date: Thu, 16 Jan 2025 10:32:53 +0100 Subject: [PATCH] DELETE channel from v2 --- .../transfer/v2/keeper/msg_server_test.go | 2 +- modules/core/04-channel/v2/client/cli/cli.go | 8 +- .../core/04-channel/v2/client/cli/query.go | 62 - modules/core/04-channel/v2/client/cli/tx.go | 93 - modules/core/04-channel/v2/keeper/events.go | 35 - .../core/04-channel/v2/keeper/export_test.go | 12 - .../core/04-channel/v2/keeper/grpc_query.go | 76 - modules/core/04-channel/v2/keeper/keeper.go | 102 +- .../core/04-channel/v2/keeper/keeper_test.go | 122 -- .../core/04-channel/v2/keeper/msg_server.go | 46 - .../04-channel/v2/keeper/msg_server_test.go | 83 - modules/core/04-channel/v2/keeper/packet.go | 8 +- .../core/04-channel/v2/keeper/packet_test.go | 8 +- modules/core/04-channel/v2/types/channel.go | 51 - .../core/04-channel/v2/types/channel.pb.go | 658 ------ .../core/04-channel/v2/types/channel_test.go | 58 - modules/core/04-channel/v2/types/codec.go | 2 - modules/core/04-channel/v2/types/errors.go | 25 +- modules/core/04-channel/v2/types/genesis.go | 48 +- .../core/04-channel/v2/types/genesis.pb.go | 160 +- .../core/04-channel/v2/types/genesis_test.go | 28 - modules/core/04-channel/v2/types/keys.go | 10 - modules/core/04-channel/v2/types/msgs.go | 59 - modules/core/04-channel/v2/types/msgs_test.go | 112 -- modules/core/04-channel/v2/types/query.go | 42 - modules/core/04-channel/v2/types/query.pb.go | 1786 ++--------------- .../core/04-channel/v2/types/query.pb.gw.go | 321 --- modules/core/04-channel/v2/types/tx.pb.go | 1171 ++--------- proto/ibc/core/channel/v2/channel.proto | 37 - proto/ibc/core/channel/v2/genesis.proto | 12 +- proto/ibc/core/channel/v2/query.proto | 72 - proto/ibc/core/channel/v2/tx.proto | 47 - testing/endpoint_v2.go | 19 - testing/path.go | 15 - 34 files changed, 335 insertions(+), 5055 deletions(-) delete mode 100644 modules/core/04-channel/v2/client/cli/tx.go delete mode 100644 modules/core/04-channel/v2/types/channel.go delete mode 100644 modules/core/04-channel/v2/types/channel.pb.go delete mode 100644 modules/core/04-channel/v2/types/channel_test.go delete mode 100644 proto/ibc/core/channel/v2/channel.proto diff --git a/modules/apps/transfer/v2/keeper/msg_server_test.go b/modules/apps/transfer/v2/keeper/msg_server_test.go index 80150121695..4a234871811 100644 --- a/modules/apps/transfer/v2/keeper/msg_server_test.go +++ b/modules/apps/transfer/v2/keeper/msg_server_test.go @@ -278,7 +278,7 @@ func (suite *KeeperTestSuite) TestMsgRecvPacketTransfer() { func() { packet.SourceClient = ibctesting.InvalidID }, - channeltypes.ErrInvalidChannelIdentifier, + clienttypes.ErrInvalidCounterparty, }, { "failure: receive is disabled", diff --git a/modules/core/04-channel/v2/client/cli/cli.go b/modules/core/04-channel/v2/client/cli/cli.go index 5fdde6a87dc..3dd8d3c451b 100644 --- a/modules/core/04-channel/v2/client/cli/cli.go +++ b/modules/core/04-channel/v2/client/cli/cli.go @@ -19,8 +19,6 @@ func GetQueryCmd() *cobra.Command { } queryCmd.AddCommand( - getCmdQueryChannel(), - getCmdQueryChannelClientState(), getCmdQueryNextSequenceSend(), getCmdQueryPacketCommitment(), getCmdQueryPacketCommitments(), @@ -43,10 +41,8 @@ func NewTxCmd() *cobra.Command { RunE: client.ValidateCmd, } - txCmd.AddCommand( - newCreateChannelTxCmd(), - newRegisterCounterpartyTxCmd(), - ) + // TODO: Add v2 packet commands + txCmd.AddCommand() return txCmd } diff --git a/modules/core/04-channel/v2/client/cli/query.go b/modules/core/04-channel/v2/client/cli/query.go index dcfe9b64751..0f7949d3504 100644 --- a/modules/core/04-channel/v2/client/cli/query.go +++ b/modules/core/04-channel/v2/client/cli/query.go @@ -18,68 +18,6 @@ const ( flagSequences = "sequences" ) -// getCmdQueryChannel defines the command to query the channel information (creator and channel) for the given channel ID. -func getCmdQueryChannel() *cobra.Command { - cmd := &cobra.Command{ - Use: "channel [channel-id]", - Short: "Query the information of a channel.", - Long: "Query the channel information for the provided channel ID.", - Example: fmt.Sprintf("%s query %s %s channel [channel-id]", version.AppName, exported.ModuleName, types.SubModuleName), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - channelID := args[0] - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.Channel(cmd.Context(), types.NewQueryChannelRequest(channelID)) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -// getCmdQueryChannelClientState defines the command to query the channel client state for the given channel ID. -func getCmdQueryChannelClientState() *cobra.Command { - cmd := &cobra.Command{ - Use: "client-state [channel-id]", - Short: "Query the client state associated with a channel.", - Long: "Query the client state associated with a channel for the provided channel ID.", - Example: fmt.Sprintf("%s query %s %s client-state [channel-id]", version.AppName, exported.ModuleName, types.SubModuleName), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - channelID := args[0] - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.ChannelClientState(cmd.Context(), types.NewQueryChannelClientStateRequest(channelID)) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - // getCmdQueryNextSequenceSend defines the command to query a next send sequence for a given client func getCmdQueryNextSequenceSend() *cobra.Command { cmd := &cobra.Command{ diff --git a/modules/core/04-channel/v2/client/cli/tx.go b/modules/core/04-channel/v2/client/cli/tx.go deleted file mode 100644 index 6849a1476a9..00000000000 --- a/modules/core/04-channel/v2/client/cli/tx.go +++ /dev/null @@ -1,93 +0,0 @@ -package cli - -import ( - "encoding/hex" - "fmt" - "strings" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/cosmos/cosmos-sdk/version" - - "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" - commitmenttypesv2 "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types/v2" - "github.com/cosmos/ibc-go/v9/modules/core/exported" -) - -// newCreateChannelTxCmd defines the command to create an IBC channel/v2. -func newCreateChannelTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "create-channel [client-identifier] [merkle-path-prefix]", - Args: cobra.ExactArgs(2), - Short: "create an IBC channel/v2", - Long: `Creates an IBC channel/v2 using the client identifier representing the counterparty chain and the hex-encoded merkle path prefix under which the counterparty stores packet flow information.`, - Example: fmt.Sprintf("%s tx %s %s create-channel 07-tendermint-0 696263,657572656b61", version.AppName, exported.ModuleName, types.SubModuleName), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - clientID := args[0] - merklePathPrefix, err := parseMerklePathPrefix(args[2]) - if err != nil { - return err - } - - msg := types.NewMsgCreateChannel(clientID, merklePathPrefix, clientCtx.GetFromAddress().String()) - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - return cmd -} - -// newRegisterCounterpartyCmd defines the command to provide the counterparty channel identifier to an IBC channel. -func newRegisterCounterpartyTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "register-counterparty [channel-identifier] [counterparty-channel-identifier]", - Args: cobra.ExactArgs(2), - Short: "Register the counterparty channel identifier for an IBC channel", - Long: `Register the counterparty channel identifier for an IBC channel specified by its channel ID.`, - Example: fmt.Sprintf("%s tx %s %s register-counterparty channel-0 channel-1", version.AppName, exported.ModuleName, types.SubModuleName), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - channelID := args[0] - counterpartyChannelID := args[1] - - msg := types.MsgRegisterCounterparty{ - ChannelId: channelID, - CounterpartyChannelId: counterpartyChannelID, - Signer: clientCtx.GetFromAddress().String(), - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - return cmd -} - -// parseMerklePathPrefix parses a comma-separated list of hex-encoded strings into a MerklePath. -func parseMerklePathPrefix(merklePathPrefixString string) (commitmenttypesv2.MerklePath, error) { - var keyPath [][]byte - hexPrefixes := strings.Split(merklePathPrefixString, ",") - for _, hexPrefix := range hexPrefixes { - prefix, err := hex.DecodeString(hexPrefix) - if err != nil { - return commitmenttypesv2.MerklePath{}, fmt.Errorf("invalid hex merkle path prefix: %w", err) - } - keyPath = append(keyPath, prefix) - } - - return commitmenttypesv2.MerklePath{KeyPath: keyPath}, nil -} diff --git a/modules/core/04-channel/v2/keeper/events.go b/modules/core/04-channel/v2/keeper/events.go index 32eee429456..33b3f3bc275 100644 --- a/modules/core/04-channel/v2/keeper/events.go +++ b/modules/core/04-channel/v2/keeper/events.go @@ -142,38 +142,3 @@ func emitTimeoutPacketEvents(ctx context.Context, packet types.Packet) { ), }) } - -// emitCreateChannelEvent emits a channel create event. -func (*Keeper) emitCreateChannelEvent(ctx context.Context, channelID, clientID string) { - sdkCtx := sdk.UnwrapSDKContext(ctx) - - sdkCtx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeCreateChannel, - sdk.NewAttribute(types.AttributeKeyChannelID, channelID), - sdk.NewAttribute(types.AttributeKeyClientID, clientID), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) -} - -// emitRegisterCounterpartyEvent emits a register counterparty event. -func (*Keeper) emitRegisterCounterpartyEvent(ctx context.Context, channelID string, channel types.Channel) { - sdkCtx := sdk.UnwrapSDKContext(ctx) - - sdkCtx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeRegisterCounterparty, - sdk.NewAttribute(types.AttributeKeyChannelID, channelID), - sdk.NewAttribute(types.AttributeKeyClientID, channel.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyChannelID, channel.CounterpartyChannelId), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) -} diff --git a/modules/core/04-channel/v2/keeper/export_test.go b/modules/core/04-channel/v2/keeper/export_test.go index 002bc6d8d41..aae6048ed2a 100644 --- a/modules/core/04-channel/v2/keeper/export_test.go +++ b/modules/core/04-channel/v2/keeper/export_test.go @@ -7,17 +7,10 @@ package keeper import ( "context" - storetypes "cosmossdk.io/store/types" - "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" "github.com/cosmos/ibc-go/v9/modules/core/exported" ) -// ChannelStore is a wrapper around channelStore to allow its usage during testing. -func (k Keeper) ChannelStore(ctx context.Context) storetypes.KVStore { - return k.channelStore(ctx) -} - func (k *Keeper) SendPacketTest( ctx context.Context, sourceChannel string, @@ -75,8 +68,3 @@ func (k *Keeper) TimeoutPacketTest( proofHeight, ) } - -// AliasV1Channel is a wrapper around aliasV1Channel to allow its usage in tests. -func (k *Keeper) AliasV1Channel(ctx context.Context, portID, channelID string) (types.Channel, bool) { - return k.aliasV1Channel(ctx, portID, channelID) -} diff --git a/modules/core/04-channel/v2/keeper/grpc_query.go b/modules/core/04-channel/v2/keeper/grpc_query.go index 41dbbbca4ca..0eea059e9ca 100644 --- a/modules/core/04-channel/v2/keeper/grpc_query.go +++ b/modules/core/04-channel/v2/keeper/grpc_query.go @@ -34,82 +34,6 @@ func NewQueryServer(k *Keeper) types.QueryServer { } } -// Channel implements the Query/Channel gRPC method -func (q *queryServer) Channel(ctx context.Context, req *types.QueryChannelRequest) (*types.QueryChannelResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - - if err := host.ChannelIdentifierValidator(req.ChannelId); err != nil { - return nil, status.Error(codes.InvalidArgument, err.Error()) - } - - channel, found := q.GetChannel(ctx, req.ChannelId) - if !found { - return nil, status.Error(codes.NotFound, errorsmod.Wrapf(types.ErrChannelNotFound, "channel-id: %s", req.ChannelId).Error()) - } - - return types.NewQueryChannelResponse(channel), nil -} - -// ChannelClientState implements the Query/ChannelClientState gRPC method -func (q *queryServer) ChannelClientState(ctx context.Context, req *types.QueryChannelClientStateRequest) (*types.QueryChannelClientStateResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - - if err := host.ChannelIdentifierValidator(req.ChannelId); err != nil { - return nil, status.Error(codes.InvalidArgument, err.Error()) - } - - channel, found := q.GetChannel(ctx, req.ChannelId) - if !found { - return nil, status.Error(codes.NotFound, errorsmod.Wrapf(types.ErrChannelNotFound, "channel-id: %s", req.ChannelId).Error()) - } - - clientState, found := q.ClientKeeper.GetClientState(ctx, channel.ClientId) - if !found { - return nil, status.Error(codes.NotFound, errorsmod.Wrapf(clienttypes.ErrClientNotFound, "client-id: %s", channel.ClientId).Error()) - } - - identifiedClientState := clienttypes.NewIdentifiedClientState(channel.ClientId, clientState) - res := types.NewQueryChannelClientStateResponse(identifiedClientState, nil, clienttypes.GetSelfHeight(ctx)) - - return res, nil -} - -// ChannelConsensusState implements the Query/ChannelConsensusState gRPC method -func (q *queryServer) ChannelConsensusState(ctx context.Context, req *types.QueryChannelConsensusStateRequest) (*types.QueryChannelConsensusStateResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - - if err := host.ChannelIdentifierValidator(req.ChannelId); err != nil { - return nil, status.Error(codes.InvalidArgument, err.Error()) - } - - channel, found := q.GetChannel(ctx, req.ChannelId) - if !found { - return nil, status.Error(codes.NotFound, errorsmod.Wrapf(types.ErrChannelNotFound, "channel-id: %s", req.ChannelId).Error()) - } - - consHeight := clienttypes.NewHeight(req.RevisionNumber, req.RevisionHeight) - consensusState, found := q.ClientKeeper.GetClientConsensusState(ctx, channel.ClientId, consHeight) - if !found { - return nil, status.Error( - codes.NotFound, - errorsmod.Wrapf(clienttypes.ErrConsensusStateNotFound, "client-id: %s", channel.ClientId).Error(), - ) - } - - anyConsensusState, err := clienttypes.PackConsensusState(consensusState) - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return types.NewQueryChannelConsensusStateResponse(channel.ClientId, anyConsensusState, nil, clienttypes.GetSelfHeight(ctx)), nil -} - // NextSequenceSend implements the Query/NextSequenceSend gRPC method func (q *queryServer) NextSequenceSend(ctx context.Context, req *types.QueryNextSequenceSendRequest) (*types.QueryNextSequenceSendResponse, error) { if req == nil { diff --git a/modules/core/04-channel/v2/keeper/keeper.go b/modules/core/04-channel/v2/keeper/keeper.go index 54a04b575d4..e114ef57477 100644 --- a/modules/core/04-channel/v2/keeper/keeper.go +++ b/modules/core/04-channel/v2/keeper/keeper.go @@ -2,15 +2,11 @@ package keeper import ( "context" - "fmt" "cosmossdk.io/core/appmodule" "cosmossdk.io/log" - "cosmossdk.io/store/prefix" - storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" @@ -18,7 +14,6 @@ import ( channelkeeperv1 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/keeper" channeltypesv1 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" - commitmentv2types "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types/v2" hostv2 "github.com/cosmos/ibc-go/v9/modules/core/24-host/v2" "github.com/cosmos/ibc-go/v9/modules/core/api" "github.com/cosmos/ibc-go/v9/modules/core/exported" @@ -62,63 +57,6 @@ func (Keeper) Logger(ctx context.Context) log.Logger { return sdkCtx.Logger().With("module", "x/"+exported.ModuleName+"/"+types.SubModuleName) } -// channelStore returns the KV store under which channels are stored. -func (k Keeper) channelStore(ctx context.Context) storetypes.KVStore { - channelPrefix := []byte(fmt.Sprintf("%s/", types.ChannelPrefix)) - return prefix.NewStore(runtime.KVStoreAdapter(k.KVStoreService.OpenKVStore(ctx)), channelPrefix) -} - -// creatorStore returns the KV store under which creators are stored. -func (k Keeper) creatorStore(ctx context.Context) storetypes.KVStore { - creatorPrefix := []byte(fmt.Sprintf("%s/", types.CreatorPrefix)) - return prefix.NewStore(runtime.KVStoreAdapter(k.KVStoreService.OpenKVStore(ctx)), creatorPrefix) -} - -// SetChannel sets the Channel for a given channel identifier. -func (k *Keeper) SetChannel(ctx context.Context, clientID string, channel types.Channel) { - bz := k.cdc.MustMarshal(&channel) - k.channelStore(ctx).Set([]byte(clientID), bz) -} - -// GetChannel gets the Channel for a given channel identifier. -func (k *Keeper) GetChannel(ctx context.Context, clientID string) (types.Channel, bool) { - store := k.channelStore(ctx) - bz := store.Get([]byte(clientID)) - if len(bz) == 0 { - return types.Channel{}, false - } - - var channel types.Channel - k.cdc.MustUnmarshal(bz, &channel) - return channel, true -} - -// HasChannel returns true if a Channel exists for a given channel identifier, otherwise false. -func (k *Keeper) HasChannel(ctx context.Context, clientID string) bool { - store := k.channelStore(ctx) - return store.Has([]byte(clientID)) -} - -// GetCreator returns the creator of the channel. -func (k *Keeper) GetCreator(ctx context.Context, clientID string) (string, bool) { - bz := k.creatorStore(ctx).Get([]byte(clientID)) - if len(bz) == 0 { - return "", false - } - - return string(bz), true -} - -// SetCreator sets the creator of the channel. -func (k *Keeper) SetCreator(ctx context.Context, clientID, creator string) { - k.creatorStore(ctx).Set([]byte(clientID), []byte(creator)) -} - -// DeleteCreator deletes the creator associated with the channel. -func (k *Keeper) DeleteCreator(ctx context.Context, clientID string) { - k.creatorStore(ctx).Delete([]byte(clientID)) -} - // GetPacketReceipt returns the packet receipt from the packet receipt path based on the clientID and sequence. func (k *Keeper) GetPacketReceipt(ctx context.Context, clientID string, sequence uint64) ([]byte, bool) { store := k.KVStoreService.OpenKVStore(ctx) @@ -227,32 +165,6 @@ func (k *Keeper) SetNextSequenceSend(ctx context.Context, clientID string, seque } } -// aliasV1Channel returns a version 2 channel for the given port and channel ID -// by converting the channel into a version 2 channel. -func (k *Keeper) aliasV1Channel(ctx context.Context, portID, clientID string) (types.Channel, bool) { - channel, ok := k.channelKeeperV1.GetChannel(ctx, portID, clientID) - if !ok { - return types.Channel{}, false - } - // Do not allow channel to be converted into a version 2 channel - // if the channel is not OPEN or if it is not UNORDERED - if channel.State != channeltypesv1.OPEN || channel.Ordering != channeltypesv1.UNORDERED { - return types.Channel{}, false - } - connection, ok := k.connectionKeeper.GetConnection(ctx, channel.ConnectionHops[0]) - if !ok { - return types.Channel{}, false - } - merklePathPrefix := commitmentv2types.NewMerklePath(connection.Counterparty.Prefix.KeyPrefix, []byte("")) - - channelv2 := types.Channel{ - CounterpartyChannelId: channel.Counterparty.ChannelId, - ClientId: connection.ClientId, - MerklePathPrefix: merklePathPrefix, - } - return channelv2, true -} - // resolveV2Identifiers returns the client identifier and the counterpartyInfo for the client given the packetId // Note: For fresh eureka channels, the client identifier and packet identifier are the same. // For aliased channels, the packet identifier will be the original channel ID and the counterpartyInfo will be constructed from the channel @@ -264,7 +176,7 @@ func (k *Keeper) resolveV2Identifiers(ctx context.Context, portId string, packet connection, ok := k.connectionKeeper.GetConnection(ctx, channel.ConnectionHops[0]) if !ok { // should never happen since the connection should exist if the channel exists - return "", clienttypes.CounterpartyInfo{}, types.ErrInvalidChannel + return "", clienttypes.CounterpartyInfo{}, channeltypesv1.ErrChannelNotFound } // convert v1 merkle prefix into the v2 path format merklePrefix := [][]byte{connection.Counterparty.Prefix.KeyPrefix, []byte("")} @@ -279,15 +191,3 @@ func (k *Keeper) resolveV2Identifiers(ctx context.Context, portId string, packet } return packetId, counterpartyInfo, nil } - -// convertV1Channel attempts to retrieve a v1 channel from the channel keeper if it exists, then converts it -// to a v2 counterparty and stores it in the v2 channel keeper for future use -func (k *Keeper) convertV1Channel(ctx context.Context, port, id string) (types.Channel, bool) { - if channel, ok := k.aliasV1Channel(ctx, port, id); ok { - // we can key on just the channel here since channel ids are globally unique - k.SetChannel(ctx, id, channel) - return channel, true - } - - return types.Channel{}, false -} diff --git a/modules/core/04-channel/v2/keeper/keeper_test.go b/modules/core/04-channel/v2/keeper/keeper_test.go index 3521e3c789f..5da9af68bda 100644 --- a/modules/core/04-channel/v2/keeper/keeper_test.go +++ b/modules/core/04-channel/v2/keeper/keeper_test.go @@ -5,10 +5,6 @@ import ( testifysuite "github.com/stretchr/testify/suite" - "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" - channeltypes2 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" - commitmenttypes "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types" - commitmentv2types "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types/v2" ibctesting "github.com/cosmos/ibc-go/v9/testing" ) @@ -33,121 +29,3 @@ func (suite *KeeperTestSuite) SetupTest() { suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(2)) suite.chainC = suite.coordinator.GetChain(ibctesting.GetChainID(3)) } - -func (suite *KeeperTestSuite) TestAliasV1Channel() { - var path *ibctesting.Path - - testCases := []struct { - name string - malleate func() - expPass bool - }{ - { - "success", - func() {}, - true, - }, - { - "failure: channel not found", - func() { - path.EndpointA.ChannelID = "" - }, - false, - }, - { - "failure: channel not OPEN", - func() { - path.EndpointA.UpdateChannel(func(channel *types.Channel) { channel.State = types.TRYOPEN }) - }, - false, - }, - { - "failure: channel is ORDERED", - func() { - path.EndpointA.UpdateChannel(func(channel *types.Channel) { channel.Ordering = types.ORDERED }) - }, - false, - }, - { - "failure: connection not found", - func() { - path.EndpointA.UpdateChannel(func(channel *types.Channel) { channel.ConnectionHops = []string{ibctesting.InvalidID} }) - }, - false, - }, - } - - for _, tc := range testCases { - tc := tc - - suite.Run(tc.name, func() { - suite.SetupTest() // reset - - // create a previously existing path on chainA to change the identifiers - // between the path between chainA and chainB - path1 := ibctesting.NewPath(suite.chainA, suite.chainC) - path1.Setup() - - path = ibctesting.NewPath(suite.chainA, suite.chainB) - path.Setup() - - tc.malleate() - - channel, found := suite.chainA.GetSimApp().IBCKeeper.ChannelKeeperV2.AliasV1Channel(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID) - - if tc.expPass { - suite.Require().True(found) - - merklePath := commitmentv2types.NewMerklePath([]byte("ibc"), []byte("")) - expChannel := channeltypes2.NewChannel(path.EndpointA.ClientID, path.EndpointB.ChannelID, merklePath) - suite.Require().Equal(channel, expChannel) - } else { - suite.Require().False(found) - suite.Require().Equal(channel, channeltypes2.Channel{}) - } - }) - } -} - -func (suite *KeeperTestSuite) TestSetChannel() { - merklePathPrefix := commitmenttypes.NewMerklePath([]byte("ibc"), []byte("")) - channel := channeltypes2.Channel{ - ClientId: ibctesting.FirstClientID, - MerklePathPrefix: merklePathPrefix, - } - suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.SetChannel(suite.chainA.GetContext(), ibctesting.FirstChannelID, channel) - - retrievedChannel, found := suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.GetChannel(suite.chainA.GetContext(), ibctesting.FirstChannelID) - suite.Require().True(found, "GetChannel does not return channel") - suite.Require().Equal(channel, retrievedChannel, "Channel retrieved not equal") - - // No channel stored under other channel identifier. - retrievedChannel, found = suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.GetChannel(suite.chainA.GetContext(), ibctesting.SecondChannelID) - suite.Require().False(found, "GetChannel unexpectedly returned a channel") - suite.Require().Equal(channeltypes2.Channel{}, retrievedChannel, "Channel retrieved not empty") -} - -func (suite *KeeperTestSuite) TestSetCreator() { - expectedCreator := "test-creator" - - // Set the creator for the client - suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.SetCreator(suite.chainA.GetContext(), ibctesting.FirstChannelID, expectedCreator) - - // Retrieve the creator from the store - retrievedCreator, found := suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.GetCreator(suite.chainA.GetContext(), ibctesting.FirstChannelID) - - // Verify that the retrieved creator matches the expected creator - suite.Require().True(found, "GetCreator did not return stored creator") - suite.Require().Equal(expectedCreator, retrievedCreator, "Creator is not retrieved correctly") - - // Verify that the creator is deleted from the store - suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.DeleteCreator(suite.chainA.GetContext(), ibctesting.FirstChannelID) - retrievedCreator, found = suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.GetCreator(suite.chainA.GetContext(), ibctesting.FirstChannelID) - suite.Require().False(found, "GetCreator unexpectedly returned a creator") - suite.Require().Empty(retrievedCreator, "Creator is not empty") - - // Verify non stored creator is not found - retrievedCreator, found = suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.GetCreator(suite.chainA.GetContext(), ibctesting.SecondChannelID) - suite.Require().False(found, "GetCreator unexpectedly returned a creator") - suite.Require().Empty(retrievedCreator, "Creator is not empty") -} diff --git a/modules/core/04-channel/v2/keeper/msg_server.go b/modules/core/04-channel/v2/keeper/msg_server.go index 1459b0b8fbb..aaadfc8fc80 100644 --- a/modules/core/04-channel/v2/keeper/msg_server.go +++ b/modules/core/04-channel/v2/keeper/msg_server.go @@ -9,58 +9,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" - ibcerrors "github.com/cosmos/ibc-go/v9/modules/core/errors" internalerrors "github.com/cosmos/ibc-go/v9/modules/core/internal/errors" "github.com/cosmos/ibc-go/v9/modules/core/internal/v2/telemetry" ) var _ types.MsgServer = &Keeper{} -// CreateChannel defines a rpc handler method for MsgCreateChannel. -func (k *Keeper) CreateChannel(goCtx context.Context, msg *types.MsgCreateChannel) (*types.MsgCreateChannelResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - channelID := k.channelKeeperV1.GenerateChannelIdentifier(ctx) - - // Initialize channel with empty counterparty channel identifier. - channel := types.NewChannel(msg.ClientId, "", msg.MerklePathPrefix) - k.SetChannel(ctx, channelID, channel) - k.SetCreator(ctx, channelID, msg.Signer) - k.SetNextSequenceSend(ctx, channelID, 1) - - k.emitCreateChannelEvent(goCtx, channelID, msg.ClientId) - - return &types.MsgCreateChannelResponse{ChannelId: channelID}, nil -} - -// RegisterCounterparty defines a rpc handler method for MsgRegisterCounterparty. -func (k *Keeper) RegisterCounterparty(goCtx context.Context, msg *types.MsgRegisterCounterparty) (*types.MsgRegisterCounterpartyResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - channel, ok := k.GetChannel(ctx, msg.ChannelId) - if !ok { - return nil, errorsmod.Wrapf(types.ErrChannelNotFound, "channel must exist for channel id %s", msg.ChannelId) - } - - creator, found := k.GetCreator(ctx, msg.ChannelId) - if !found { - return nil, errorsmod.Wrap(ibcerrors.ErrUnauthorized, "channel creator must be set") - } - - if creator != msg.Signer { - return nil, errorsmod.Wrapf(ibcerrors.ErrUnauthorized, "channel creator (%s) must match signer (%s)", creator, msg.Signer) - } - - channel.CounterpartyChannelId = msg.CounterpartyChannelId - k.SetChannel(ctx, msg.ChannelId, channel) - // Delete client creator from state as it is not needed after this point. - k.DeleteCreator(ctx, msg.ChannelId) - - k.emitRegisterCounterpartyEvent(goCtx, msg.ChannelId, channel) - - return &types.MsgRegisterCounterpartyResponse{}, nil -} - // SendPacket implements the PacketMsgServer SendPacket method. func (k *Keeper) SendPacket(ctx context.Context, msg *types.MsgSendPacket) (*types.MsgSendPacketResponse, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) diff --git a/modules/core/04-channel/v2/keeper/msg_server_test.go b/modules/core/04-channel/v2/keeper/msg_server_test.go index 7164d583f6d..83583fa7932 100644 --- a/modules/core/04-channel/v2/keeper/msg_server_test.go +++ b/modules/core/04-channel/v2/keeper/msg_server_test.go @@ -11,94 +11,11 @@ import ( clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" commitmenttypes "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types" - ibcerrors "github.com/cosmos/ibc-go/v9/modules/core/errors" ibctesting "github.com/cosmos/ibc-go/v9/testing" "github.com/cosmos/ibc-go/v9/testing/mock" mockv2 "github.com/cosmos/ibc-go/v9/testing/mock/v2" ) -func (suite *KeeperTestSuite) TestRegisterCounterparty() { - var ( - path *ibctesting.Path - msg *types.MsgRegisterCounterparty - ) - cases := []struct { - name string - malleate func() - expError error - }{ - { - "success", - func() { - // set it before handler - suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.SetChannel(suite.chainA.GetContext(), msg.ChannelId, types.NewChannel(path.EndpointA.ClientID, "", ibctesting.MerklePath)) - }, - nil, - }, - { - "failure: creator not set", - func() { - suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.DeleteCreator(suite.chainA.GetContext(), path.EndpointA.ChannelID) - }, - ibcerrors.ErrUnauthorized, - }, - { - "failure: signer does not match creator", - func() { - suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.SetCreator(suite.chainA.GetContext(), path.EndpointA.ChannelID, ibctesting.TestAccAddress) - }, - ibcerrors.ErrUnauthorized, - }, - { - "failure: channel must already exist", - func() { - suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.DeleteCreator(suite.chainA.GetContext(), path.EndpointA.ChannelID) - suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.ChannelStore(suite.chainA.GetContext()).Delete([]byte(path.EndpointA.ChannelID)) - }, - types.ErrChannelNotFound, - }, - } - - for _, tc := range cases { - suite.Run(tc.name, func() { - suite.SetupTest() - - path = ibctesting.NewPath(suite.chainA, suite.chainB) - path.SetupClients() - - suite.Require().NoError(path.EndpointA.CreateChannel()) - suite.Require().NoError(path.EndpointB.CreateChannel()) - - signer := path.EndpointA.Chain.SenderAccount.GetAddress().String() - msg = types.NewMsgRegisterCounterparty(path.EndpointA.ChannelID, path.EndpointB.ChannelID, signer) - - tc.malleate() - - res, err := path.EndpointA.Chain.SendMsgs(msg) - - expPass := tc.expError == nil - if expPass { - suite.Require().NotNil(res) - suite.Require().Nil(err) - - // Assert counterparty channel id filled in and creator deleted - channel, found := suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.GetChannel(suite.chainA.GetContext(), path.EndpointA.ChannelID) - suite.Require().True(found) - suite.Require().Equal(channel.CounterpartyChannelId, path.EndpointB.ChannelID) - - _, found = suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.GetCreator(suite.chainA.GetContext(), path.EndpointA.ChannelID) - suite.Require().False(found) - - seq, found := suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.GetNextSequenceSend(suite.chainA.GetContext(), path.EndpointA.ChannelID) - suite.Require().True(found) - suite.Require().Equal(seq, uint64(1)) - } else { - ibctesting.RequireErrorIsOrContains(suite.T(), err, tc.expError, "expected error %q, got %q instead", tc.expError, err) - } - }) - } -} - func (suite *KeeperTestSuite) TestMsgSendPacket() { var ( path *ibctesting.Path diff --git a/modules/core/04-channel/v2/keeper/packet.go b/modules/core/04-channel/v2/keeper/packet.go index 4657503ece4..136b5b01940 100644 --- a/modules/core/04-channel/v2/keeper/packet.go +++ b/modules/core/04-channel/v2/keeper/packet.go @@ -99,7 +99,7 @@ func (k *Keeper) recvPacket( } if counterparty.ClientId != packet.SourceClient { - return errorsmod.Wrapf(types.ErrInvalidChannelIdentifier, "counterparty id (%s) does not match packet source id (%s)", counterparty.ClientId, packet.SourceClient) + return errorsmod.Wrapf(clienttypes.ErrInvalidCounterparty, "counterparty id (%s) does not match packet source id (%s)", counterparty.ClientId, packet.SourceClient) } // check if packet timed out by comparing it with the latest height of the chain @@ -161,7 +161,7 @@ func (k Keeper) WriteAcknowledgement( } if counterparty.ClientId != packet.SourceClient { - return errorsmod.Wrapf(types.ErrInvalidChannelIdentifier, "counterparty id (%s) does not match packet source id (%s)", counterparty.ClientId, packet.SourceClient) + return errorsmod.Wrapf(clienttypes.ErrInvalidCounterparty, "counterparty id (%s) does not match packet source id (%s)", counterparty.ClientId, packet.SourceClient) } // NOTE: IBC app modules might have written the acknowledgement synchronously on @@ -198,7 +198,7 @@ func (k *Keeper) acknowledgePacket(ctx context.Context, packet types.Packet, ack } if counterparty.ClientId != packet.DestinationClient { - return errorsmod.Wrapf(types.ErrInvalidChannelIdentifier, "counterparty id (%s) does not match packet destination id (%s)", counterparty.ClientId, packet.DestinationClient) + return errorsmod.Wrapf(clienttypes.ErrInvalidCounterparty, "counterparty id (%s) does not match packet destination id (%s)", counterparty.ClientId, packet.DestinationClient) } commitment := k.GetPacketCommitment(ctx, packet.SourceClient, packet.Sequence) @@ -262,7 +262,7 @@ func (k *Keeper) timeoutPacket( } if counterparty.ClientId != packet.DestinationClient { - return errorsmod.Wrapf(types.ErrInvalidChannelIdentifier, "counterparty id (%s) does not match packet destination id (%s)", counterparty.ClientId, packet.DestinationClient) + return errorsmod.Wrapf(clienttypes.ErrInvalidCounterparty, "counterparty id (%s) does not match packet destination id (%s)", counterparty.ClientId, packet.DestinationClient) } // check that timeout height or timeout timestamp has passed on the other end diff --git a/modules/core/04-channel/v2/keeper/packet_test.go b/modules/core/04-channel/v2/keeper/packet_test.go index b75d661db41..9afb07a2cc7 100644 --- a/modules/core/04-channel/v2/keeper/packet_test.go +++ b/modules/core/04-channel/v2/keeper/packet_test.go @@ -167,7 +167,7 @@ func (suite *KeeperTestSuite) TestRecvPacket() { func() { packet.SourceClient = unusedChannel }, - types.ErrInvalidChannelIdentifier, + clienttypes.ErrInvalidCounterparty, }, { "failure: packet has timed out", @@ -261,7 +261,7 @@ func (suite *KeeperTestSuite) TestWriteAcknowledgement() { func() { packet.SourceClient = unusedChannel }, - types.ErrInvalidChannelIdentifier, + clienttypes.ErrInvalidCounterparty, }, { "failure: ack already exists", @@ -353,7 +353,7 @@ func (suite *KeeperTestSuite) TestAcknowledgePacket() { func() { packet.DestinationClient = unusedChannel }, - types.ErrInvalidChannelIdentifier, + clienttypes.ErrInvalidCounterparty, }, { "failure: packet commitment doesn't exist.", @@ -476,7 +476,7 @@ func (suite *KeeperTestSuite) TestTimeoutPacket() { packet.DestinationClient = unusedChannel }, - types.ErrInvalidChannelIdentifier, + clienttypes.ErrInvalidCounterparty, }, { "failure: packet has not timed out yet", diff --git a/modules/core/04-channel/v2/types/channel.go b/modules/core/04-channel/v2/types/channel.go deleted file mode 100644 index f4ab5b2afe4..00000000000 --- a/modules/core/04-channel/v2/types/channel.go +++ /dev/null @@ -1,51 +0,0 @@ -package types - -import ( - errorsmod "cosmossdk.io/errors" - - commitmenttypes "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types/v2" - host "github.com/cosmos/ibc-go/v9/modules/core/24-host" -) - -// NewChannel creates a new Channel instance -func NewChannel(clientID, counterpartyChannelID string, merklePathPrefix commitmenttypes.MerklePath) Channel { - return Channel{ - ClientId: clientID, - CounterpartyChannelId: counterpartyChannelID, - MerklePathPrefix: merklePathPrefix, - } -} - -// Validate validates the Channel -func (c Channel) Validate() error { - if err := host.ClientIdentifierValidator(c.ClientId); err != nil { - return err - } - - if err := host.ChannelIdentifierValidator(c.CounterpartyChannelId); err != nil { - return err - } - - if err := c.MerklePathPrefix.ValidateAsPrefix(); err != nil { - return errorsmod.Wrap(ErrInvalidChannel, err.Error()) - } - - return nil -} - -// NewIdentifiedChannel creates a new IdentifiedChannel instance -func NewIdentifiedChannel(channelID string, channel Channel) IdentifiedChannel { - return IdentifiedChannel{ - Channel: channel, - ChannelId: channelID, - } -} - -// ValidateBasic performs a basic validation of the identifiers and channel fields. -func (ic IdentifiedChannel) ValidateBasic() error { - if err := host.ChannelIdentifierValidator(ic.ChannelId); err != nil { - return errorsmod.Wrap(err, "invalid channel ID") - } - - return ic.Channel.Validate() -} diff --git a/modules/core/04-channel/v2/types/channel.pb.go b/modules/core/04-channel/v2/types/channel.pb.go deleted file mode 100644 index 8d3dafb35ae..00000000000 --- a/modules/core/04-channel/v2/types/channel.pb.go +++ /dev/null @@ -1,658 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ibc/core/channel/v2/channel.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - v2 "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types/v2" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Channel defines the channel end on a chain that is implementing the version 2 IBC protocol -// Each side will maintain its own Channel to create an IBC channel -// The channel will be referenced by a channelID which will be used to send packets -// to the counterparty -// The channel will contain the client identifier that will provide proof verification for the channel -// and the counterparty channel identifier that the other channel end will be using -// to send packets to our channel end. -type Channel struct { - // the client identifier of the light client representing the counterparty chain - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - // the counterparty identifier that must be used by packets sent by counterparty - // to our channel end. - CounterpartyChannelId string `protobuf:"bytes,2,opt,name=counterparty_channel_id,json=counterpartyChannelId,proto3" json:"counterparty_channel_id,omitempty"` - // the key path used to store packet flow messages that the counterparty - // will use to send to us. In backwards compatible cases, we will append the channelID and sequence in order to create - // the final path. - MerklePathPrefix v2.MerklePath `protobuf:"bytes,3,opt,name=merkle_path_prefix,json=merklePathPrefix,proto3" json:"merkle_path_prefix"` -} - -func (m *Channel) Reset() { *m = Channel{} } -func (m *Channel) String() string { return proto.CompactTextString(m) } -func (*Channel) ProtoMessage() {} -func (*Channel) Descriptor() ([]byte, []int) { - return fileDescriptor_7e9b57d8f218397d, []int{0} -} -func (m *Channel) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Channel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Channel.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Channel) XXX_Merge(src proto.Message) { - xxx_messageInfo_Channel.Merge(m, src) -} -func (m *Channel) XXX_Size() int { - return m.Size() -} -func (m *Channel) XXX_DiscardUnknown() { - xxx_messageInfo_Channel.DiscardUnknown(m) -} - -var xxx_messageInfo_Channel proto.InternalMessageInfo - -func (m *Channel) GetClientId() string { - if m != nil { - return m.ClientId - } - return "" -} - -func (m *Channel) GetCounterpartyChannelId() string { - if m != nil { - return m.CounterpartyChannelId - } - return "" -} - -func (m *Channel) GetMerklePathPrefix() v2.MerklePath { - if m != nil { - return m.MerklePathPrefix - } - return v2.MerklePath{} -} - -// IdentifiedChannel defines a channel with an additional channel identifier field. -type IdentifiedChannel struct { - // channel identified. - Channel Channel `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel"` - // channel identifier - ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` -} - -func (m *IdentifiedChannel) Reset() { *m = IdentifiedChannel{} } -func (m *IdentifiedChannel) String() string { return proto.CompactTextString(m) } -func (*IdentifiedChannel) ProtoMessage() {} -func (*IdentifiedChannel) Descriptor() ([]byte, []int) { - return fileDescriptor_7e9b57d8f218397d, []int{1} -} -func (m *IdentifiedChannel) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *IdentifiedChannel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_IdentifiedChannel.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *IdentifiedChannel) XXX_Merge(src proto.Message) { - xxx_messageInfo_IdentifiedChannel.Merge(m, src) -} -func (m *IdentifiedChannel) XXX_Size() int { - return m.Size() -} -func (m *IdentifiedChannel) XXX_DiscardUnknown() { - xxx_messageInfo_IdentifiedChannel.DiscardUnknown(m) -} - -var xxx_messageInfo_IdentifiedChannel proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Channel)(nil), "ibc.core.channel.v2.Channel") - proto.RegisterType((*IdentifiedChannel)(nil), "ibc.core.channel.v2.IdentifiedChannel") -} - -func init() { proto.RegisterFile("ibc/core/channel/v2/channel.proto", fileDescriptor_7e9b57d8f218397d) } - -var fileDescriptor_7e9b57d8f218397d = []byte{ - // 356 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xc1, 0x4e, 0xea, 0x40, - 0x14, 0x86, 0x3b, 0xf7, 0x92, 0xcb, 0x65, 0xd8, 0x68, 0xd5, 0x48, 0x50, 0x0b, 0xb2, 0x91, 0x0d, - 0x33, 0xa6, 0x1a, 0x13, 0x0d, 0x2b, 0x5c, 0xb1, 0x30, 0x21, 0x2c, 0x58, 0xb8, 0x69, 0xda, 0xe9, - 0xd0, 0x4e, 0xec, 0x74, 0x9a, 0x76, 0x68, 0xe4, 0x0d, 0x5c, 0xfa, 0x08, 0x3e, 0x85, 0xcf, 0xc0, - 0x92, 0xa5, 0x2b, 0x63, 0xe0, 0x45, 0x4c, 0xa7, 0x2d, 0x90, 0xe8, 0xee, 0xcc, 0x39, 0xff, 0xf9, - 0xf2, 0xff, 0x73, 0xe0, 0x39, 0x73, 0x08, 0x26, 0x22, 0xa6, 0x98, 0xf8, 0x76, 0x18, 0xd2, 0x00, - 0xa7, 0x66, 0x59, 0xa2, 0x28, 0x16, 0x52, 0xe8, 0x07, 0xcc, 0x21, 0x28, 0x93, 0xa0, 0xb2, 0x9f, - 0x9a, 0xcd, 0x43, 0x4f, 0x78, 0x42, 0xcd, 0x71, 0x56, 0xe5, 0xd2, 0xe6, 0xc5, 0x96, 0x26, 0x38, - 0x67, 0x92, 0xd3, 0x50, 0x2a, 0xe0, 0xe6, 0x95, 0x0b, 0x3b, 0xef, 0x00, 0x56, 0xef, 0x73, 0x9a, - 0x7e, 0x02, 0x6b, 0x24, 0x60, 0x34, 0x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0x73, 0x64, 0x39, 0x8f, - 0x68, 0xe2, 0xfc, 0x53, 0xf7, 0xb8, 0xfa, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xc2, 0xc9, 0x7e, 0x8b, - 0x08, 0x02, 0x00, 0x00, -} - -func (m *Channel) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Channel) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Channel) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.MerklePathPrefix.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintChannel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.CounterpartyChannelId) > 0 { - i -= len(m.CounterpartyChannelId) - copy(dAtA[i:], m.CounterpartyChannelId) - i = encodeVarintChannel(dAtA, i, uint64(len(m.CounterpartyChannelId))) - i-- - dAtA[i] = 0x12 - } - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintChannel(dAtA, i, uint64(len(m.ClientId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *IdentifiedChannel) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *IdentifiedChannel) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *IdentifiedChannel) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChannelId) > 0 { - i -= len(m.ChannelId) - copy(dAtA[i:], m.ChannelId) - i = encodeVarintChannel(dAtA, i, uint64(len(m.ChannelId))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Channel.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintChannel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintChannel(dAtA []byte, offset int, v uint64) int { - offset -= sovChannel(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Channel) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = len(m.CounterpartyChannelId) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - l = m.MerklePathPrefix.Size() - n += 1 + l + sovChannel(uint64(l)) - return n -} - -func (m *IdentifiedChannel) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Channel.Size() - n += 1 + l + sovChannel(uint64(l)) - l = len(m.ChannelId) - if l > 0 { - n += 1 + l + sovChannel(uint64(l)) - } - return n -} - -func sovChannel(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozChannel(x uint64) (n int) { - return sovChannel(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Channel) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Channel: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Channel: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyChannelId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CounterpartyChannelId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MerklePathPrefix", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.MerklePathPrefix.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *IdentifiedChannel) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: IdentifiedChannel: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: IdentifiedChannel: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Channel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowChannel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthChannel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthChannel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChannelId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipChannel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthChannel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipChannel(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowChannel - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowChannel - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowChannel - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthChannel - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupChannel - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthChannel - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthChannel = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowChannel = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupChannel = fmt.Errorf("proto: unexpected end of group") -) diff --git a/modules/core/04-channel/v2/types/channel_test.go b/modules/core/04-channel/v2/types/channel_test.go deleted file mode 100644 index c6c71d9a157..00000000000 --- a/modules/core/04-channel/v2/types/channel_test.go +++ /dev/null @@ -1,58 +0,0 @@ -package types_test - -import ( - "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" - host "github.com/cosmos/ibc-go/v9/modules/core/24-host" - ibctesting "github.com/cosmos/ibc-go/v9/testing" -) - -func (s *TypesTestSuite) TestValidateChannel() { - var c types.Channel - testCases := []struct { - name string - malleate func() - expErr error - }{ - { - name: "success", - malleate: func() {}, - }, - { - name: "failure: invalid ClientID", - malleate: func() { - c.ClientId = "" - }, - expErr: host.ErrInvalidID, - }, - { - name: "failure: invalid counterparty channel id", - malleate: func() { - c.CounterpartyChannelId = "" - }, - expErr: host.ErrInvalidID, - }, - { - name: "failure: invalid Merkle Path Prefix", - malleate: func() { - c.MerklePathPrefix.KeyPath = [][]byte{} - }, - expErr: types.ErrInvalidChannel, - }, - } - for _, tc := range testCases { - s.Run(tc.name, func() { - c = types.NewChannel(ibctesting.FirstClientID, ibctesting.SecondClientID, ibctesting.MerklePath) - - tc.malleate() - - err := c.Validate() - - expPass := tc.expErr == nil - if expPass { - s.Require().NoError(err) - } else { - ibctesting.RequireErrorIsOrContains(s.T(), err, tc.expErr) - } - }) - } -} diff --git a/modules/core/04-channel/v2/types/codec.go b/modules/core/04-channel/v2/types/codec.go index 12124c4e841..1207e8d4899 100644 --- a/modules/core/04-channel/v2/types/codec.go +++ b/modules/core/04-channel/v2/types/codec.go @@ -11,8 +11,6 @@ import ( func RegisterInterfaces(registry coreregistry.InterfaceRegistrar) { registry.RegisterImplementations( (*sdk.Msg)(nil), - &MsgCreateChannel{}, - &MsgRegisterCounterparty{}, &MsgSendPacket{}, &MsgRecvPacket{}, &MsgTimeout{}, diff --git a/modules/core/04-channel/v2/types/errors.go b/modules/core/04-channel/v2/types/errors.go index eb64f47e5ce..6407370c5be 100644 --- a/modules/core/04-channel/v2/types/errors.go +++ b/modules/core/04-channel/v2/types/errors.go @@ -5,18 +5,15 @@ import ( ) var ( - ErrInvalidChannel = errorsmod.Register(SubModuleName, 2, "invalid channel") - ErrChannelNotFound = errorsmod.Register(SubModuleName, 3, "channel not found") - ErrInvalidPacket = errorsmod.Register(SubModuleName, 4, "invalid packet") - ErrInvalidPayload = errorsmod.Register(SubModuleName, 5, "invalid payload") - ErrSequenceSendNotFound = errorsmod.Register(SubModuleName, 6, "sequence send not found") - ErrInvalidAcknowledgement = errorsmod.Register(SubModuleName, 7, "invalid acknowledgement") - ErrPacketCommitmentNotFound = errorsmod.Register(SubModuleName, 8, "packet commitment not found") - ErrAcknowledgementNotFound = errorsmod.Register(SubModuleName, 9, "packet acknowledgement not found") - ErrInvalidTimeout = errorsmod.Register(SubModuleName, 10, "invalid packet timeout") - ErrTimeoutElapsed = errorsmod.Register(SubModuleName, 11, "timeout elapsed") - ErrTimeoutNotReached = errorsmod.Register(SubModuleName, 12, "timeout not reached") - ErrInvalidChannelIdentifier = errorsmod.Register(SubModuleName, 13, "invalid channel identifier") - ErrAcknowledgementExists = errorsmod.Register(SubModuleName, 14, "acknowledgement for packet already exists") - ErrNoOpMsg = errorsmod.Register(SubModuleName, 15, "message is redundant, no-op will be performed") + ErrInvalidPacket = errorsmod.Register(SubModuleName, 2, "invalid packet") + ErrInvalidPayload = errorsmod.Register(SubModuleName, 3, "invalid payload") + ErrSequenceSendNotFound = errorsmod.Register(SubModuleName, 4, "sequence send not found") + ErrInvalidAcknowledgement = errorsmod.Register(SubModuleName, 5, "invalid acknowledgement") + ErrPacketCommitmentNotFound = errorsmod.Register(SubModuleName, 6, "packet commitment not found") + ErrAcknowledgementNotFound = errorsmod.Register(SubModuleName, 7, "packet acknowledgement not found") + ErrInvalidTimeout = errorsmod.Register(SubModuleName, 8, "invalid packet timeout") + ErrTimeoutElapsed = errorsmod.Register(SubModuleName, 9, "timeout elapsed") + ErrTimeoutNotReached = errorsmod.Register(SubModuleName, 10, "timeout not reached") + ErrAcknowledgementExists = errorsmod.Register(SubModuleName, 11, "acknowledgement for packet already exists") + ErrNoOpMsg = errorsmod.Register(SubModuleName, 12, "message is redundant, no-op will be performed") ) diff --git a/modules/core/04-channel/v2/types/genesis.go b/modules/core/04-channel/v2/types/genesis.go index fb06476bb41..d94365b15de 100644 --- a/modules/core/04-channel/v2/types/genesis.go +++ b/modules/core/04-channel/v2/types/genesis.go @@ -4,7 +4,6 @@ import ( "errors" "fmt" - channeltypesv1 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" host "github.com/cosmos/ibc-go/v9/modules/core/24-host" ) @@ -40,56 +39,29 @@ func (ps PacketSequence) Validate() error { // NewGenesisState creates a GenesisState instance. func NewGenesisState( - channels []IdentifiedChannel, acks, receipts, commitments []PacketState, - sendSeqs []PacketSequence, nextChannelSequence uint64, + acks, receipts, commitments []PacketState, + sendSeqs []PacketSequence, ) GenesisState { return GenesisState{ - Channels: channels, - Acknowledgements: acks, - Receipts: receipts, - Commitments: commitments, - SendSequences: sendSeqs, - NextChannelSequence: nextChannelSequence, + Acknowledgements: acks, + Receipts: receipts, + Commitments: commitments, + SendSequences: sendSeqs, } } // DefaultGenesisState returns the ibc channel v2 submodule's default genesis state. func DefaultGenesisState() GenesisState { return GenesisState{ - Channels: []IdentifiedChannel{}, - Acknowledgements: []PacketState{}, - Receipts: []PacketState{}, - Commitments: []PacketState{}, - SendSequences: []PacketSequence{}, - NextChannelSequence: 0, + Acknowledgements: []PacketState{}, + Receipts: []PacketState{}, + Commitments: []PacketState{}, + SendSequences: []PacketSequence{}, } } // Validate performs basic genesis state validation returning an error upon any failure. func (gs GenesisState) Validate() error { - // keep track of the max sequence to ensure it is less than - // the next sequence used in creating channel identifiers. - var maxSequence uint64 - - for i, channel := range gs.Channels { - sequence, err := channeltypesv1.ParseChannelSequence(channel.ChannelId) - if err != nil { - return err - } - - if sequence > maxSequence { - maxSequence = sequence - } - - if err := channel.ValidateBasic(); err != nil { - return fmt.Errorf("invalid channel %v channel index %d: %w", channel, i, err) - } - } - - if maxSequence != 0 && maxSequence >= gs.NextChannelSequence { - return fmt.Errorf("next channel sequence %d must be greater than maximum sequence used in channel identifier %d", gs.NextChannelSequence, maxSequence) - } - for i, ack := range gs.Acknowledgements { if err := ack.Validate(); err != nil { return fmt.Errorf("invalid acknowledgement %v ack index %d: %w", ack, i, err) diff --git a/modules/core/04-channel/v2/types/genesis.pb.go b/modules/core/04-channel/v2/types/genesis.pb.go index 079aaa7ac8c..bb06101aec1 100644 --- a/modules/core/04-channel/v2/types/genesis.pb.go +++ b/modules/core/04-channel/v2/types/genesis.pb.go @@ -25,13 +25,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the ibc channel/v2 submodule's genesis state. type GenesisState struct { - Channels []IdentifiedChannel `protobuf:"bytes,1,rep,name=channels,proto3,casttype=IdentifiedChannel" json:"channels"` - Acknowledgements []PacketState `protobuf:"bytes,2,rep,name=acknowledgements,proto3" json:"acknowledgements"` - Commitments []PacketState `protobuf:"bytes,3,rep,name=commitments,proto3" json:"commitments"` - Receipts []PacketState `protobuf:"bytes,4,rep,name=receipts,proto3" json:"receipts"` - SendSequences []PacketSequence `protobuf:"bytes,5,rep,name=send_sequences,json=sendSequences,proto3" json:"send_sequences"` - // the sequence for the next generated channel identifier - NextChannelSequence uint64 `protobuf:"varint,6,opt,name=next_channel_sequence,json=nextChannelSequence,proto3" json:"next_channel_sequence,omitempty"` + Acknowledgements []PacketState `protobuf:"bytes,2,rep,name=acknowledgements,proto3" json:"acknowledgements"` + Commitments []PacketState `protobuf:"bytes,3,rep,name=commitments,proto3" json:"commitments"` + Receipts []PacketState `protobuf:"bytes,4,rep,name=receipts,proto3" json:"receipts"` + SendSequences []PacketSequence `protobuf:"bytes,5,rep,name=send_sequences,json=sendSequences,proto3" json:"send_sequences"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -67,13 +64,6 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo -func (m *GenesisState) GetChannels() []IdentifiedChannel { - if m != nil { - return m.Channels - } - return nil -} - func (m *GenesisState) GetAcknowledgements() []PacketState { if m != nil { return m.Acknowledgements @@ -102,13 +92,6 @@ func (m *GenesisState) GetSendSequences() []PacketSequence { return nil } -func (m *GenesisState) GetNextChannelSequence() uint64 { - if m != nil { - return m.NextChannelSequence - } - return 0 -} - // PacketState defines the generic type necessary to retrieve and store // packet commitments, acknowledgements, and receipts. // Caller is responsible for knowing the context necessary to interpret this @@ -219,35 +202,31 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v2/genesis.proto", fileDescriptor_b5d374f126f051c3) } var fileDescriptor_b5d374f126f051c3 = []byte{ - // 439 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x41, 0x8b, 0xd3, 0x40, - 0x14, 0xc7, 0x33, 0xdb, 0xb8, 0x74, 0xa7, 0xeb, 0xa2, 0xb3, 0x0a, 0xb1, 0x42, 0x1a, 0x2b, 0x48, - 0x2f, 0x9b, 0x91, 0xe8, 0x45, 0xf1, 0x14, 0x0f, 0xda, 0xdb, 0x12, 0xc1, 0x83, 0x20, 0x35, 0x99, - 0x79, 0x66, 0x87, 0x4d, 0x66, 0x6a, 0x67, 0x5a, 0xf5, 0x1b, 0x78, 0xf4, 0x23, 0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0x93, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x70, - 0xe9, 0xcf, 0xef, 0x56, 0x03, 0x00, 0x00, + // 370 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4f, 0xfa, 0x40, + 0x18, 0xc6, 0x5b, 0xe8, 0xff, 0x1f, 0x38, 0x90, 0x98, 0xd3, 0xa1, 0xc1, 0xa4, 0x54, 0x5c, 0xba, + 0xd0, 0x33, 0xe8, 0xa2, 0x71, 0x62, 0x51, 0x36, 0x52, 0x13, 0x07, 0x17, 0x6c, 0xaf, 0x6f, 0xca, + 0x85, 0xf6, 0x0e, 0xb9, 0x03, 0xe3, 0x37, 0x70, 0xf4, 0x23, 0xf8, 0x59, 0x9c, 0x18, 0x19, 0x9d, + 0x8c, 0x81, 0x2f, 0x62, 0x68, 0x81, 0x60, 0x34, 0x26, 0xb8, 0xbd, 0xf7, 0xde, 0xf3, 0xfc, 0x9e, + 0x77, 0x78, 0xd0, 0x21, 0x0b, 0x28, 0xa1, 0x62, 0x08, 0x84, 0xf6, 0x7c, 0xce, 0x21, 0x26, 0xe3, + 0x26, 0x89, 0x80, 0x83, 0x64, 0xd2, 0x1d, 0x0c, 0x85, 0x12, 0x78, 0x8f, 0x05, 0xd4, 0x5d, 0x48, + 0xdc, 0xa5, 0xc4, 0x1d, 0x37, 0xab, 0xfb, 0x91, 0x88, 0x44, 0xfa, 0x4f, 0x16, 0x53, 0x26, 0xad, + 0xbf, 0xe6, 0x50, 0xf9, 0x32, 0x33, 0x5f, 0x2b, 0x5f, 0x01, 0xf6, 0xd0, 0xae, 0x4f, 0xfb, 0x5c, + 0x3c, 0xc4, 0x10, 0x46, 0x90, 0x00, 0x57, 0xd2, 0xcc, 0xd9, 0x79, 0xa7, 0xd4, 0xb4, 0xdd, 0x1f, + 0xb0, 0x6e, 0xc7, 0xa7, 0x7d, 0x50, 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, 0x38, 0x00, 0x19, + 0xfc, 0x4f, 0x0b, 0x75, 0xf2, 0x19, 0x00, 0x00, 0xff, 0xff, 0xee, 0xb6, 0xa0, 0xcd, 0xa0, 0x02, + 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -270,11 +249,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.NextChannelSequence != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.NextChannelSequence)) - i-- - dAtA[i] = 0x30 - } if len(m.SendSequences) > 0 { for iNdEx := len(m.SendSequences) - 1; iNdEx >= 0; iNdEx-- { { @@ -331,20 +305,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x12 } } - if len(m.Channels) > 0 { - for iNdEx := len(m.Channels) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Channels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } return len(dAtA) - i, nil } @@ -442,12 +402,6 @@ func (m *GenesisState) Size() (n int) { } var l int _ = l - if len(m.Channels) > 0 { - for _, e := range m.Channels { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } if len(m.Acknowledgements) > 0 { for _, e := range m.Acknowledgements { l = e.Size() @@ -472,9 +426,6 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } - if m.NextChannelSequence != 0 { - n += 1 + sovGenesis(uint64(m.NextChannelSequence)) - } return n } @@ -549,40 +500,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Channels", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Channels = append(m.Channels, IdentifiedChannel{}) - if err := m.Channels[len(m.Channels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Acknowledgements", wireType) @@ -719,25 +636,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NextChannelSequence", wireType) - } - m.NextChannelSequence = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NextChannelSequence |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/modules/core/04-channel/v2/types/genesis_test.go b/modules/core/04-channel/v2/types/genesis_test.go index e70290d54b1..7b22f9c5719 100644 --- a/modules/core/04-channel/v2/types/genesis_test.go +++ b/modules/core/04-channel/v2/types/genesis_test.go @@ -2,13 +2,11 @@ package types_test import ( "errors" - "fmt" "testing" "github.com/stretchr/testify/require" "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" - host "github.com/cosmos/ibc-go/v9/modules/core/24-host" ibctesting "github.com/cosmos/ibc-go/v9/testing" ) @@ -26,29 +24,13 @@ func TestValidateGenesis(t *testing.T) { { "valid genesis", types.NewGenesisState( - []types.IdentifiedChannel{ - types.NewIdentifiedChannel( - ibctesting.FirstChannelID, types.NewChannel(ibctesting.FirstClientID, ibctesting.SecondChannelID, ibctesting.MerklePath), - ), - types.NewIdentifiedChannel( - ibctesting.SecondChannelID, types.NewChannel(ibctesting.SecondClientID, ibctesting.FirstChannelID, ibctesting.MerklePath), - ), - }, []types.PacketState{types.NewPacketState(ibctesting.FirstChannelID, 1, []byte("ack"))}, []types.PacketState{types.NewPacketState(ibctesting.SecondChannelID, 1, []byte(""))}, []types.PacketState{types.NewPacketState(ibctesting.FirstChannelID, 1, []byte("commit_hash"))}, []types.PacketSequence{types.NewPacketSequence(ibctesting.SecondChannelID, 1)}, - 2, ), nil, }, - { - "invalid channel identifier", - types.GenesisState{ - Channels: []types.IdentifiedChannel{types.NewIdentifiedChannel(ibctesting.InvalidID, types.NewChannel(ibctesting.FirstClientID, ibctesting.SecondChannelID, ibctesting.MerklePath))}, - }, - host.ErrInvalidID, - }, { "invalid ack", types.GenesisState{ @@ -76,16 +58,6 @@ func TestValidateGenesis(t *testing.T) { }, errors.New("sequence cannot be 0"), }, - { - "next channel sequence is less than maximum channel identifier sequence used", - types.GenesisState{ - Channels: []types.IdentifiedChannel{ - types.NewIdentifiedChannel("channel-10", types.NewChannel(ibctesting.FirstClientID, ibctesting.SecondChannelID, ibctesting.MerklePath)), - }, - NextChannelSequence: 0, - }, - fmt.Errorf("next channel sequence 0 must be greater than maximum sequence used in channel identifier 10"), - }, } for _, tc := range testCases { diff --git a/modules/core/04-channel/v2/types/keys.go b/modules/core/04-channel/v2/types/keys.go index 9b636340e38..98c8e520b46 100644 --- a/modules/core/04-channel/v2/types/keys.go +++ b/modules/core/04-channel/v2/types/keys.go @@ -3,14 +3,4 @@ package types const ( // SubModuleName defines the channelv2 module name. SubModuleName = "channelv2" - - // ChannelPrefix is the prefix under which all v2 channels are stored. - // It is imported from types since it is not part of the ics-24 host - // specification. - ChannelPrefix = "channels" - - // CreatorPrefix is the prefix under which all v2 channel creators are stored. - // It is imported from types since it is not part of the ics-24 host - // specification. - CreatorPrefix = "creators" ) diff --git a/modules/core/04-channel/v2/types/msgs.go b/modules/core/04-channel/v2/types/msgs.go index ead580b1742..7c71e8972fe 100644 --- a/modules/core/04-channel/v2/types/msgs.go +++ b/modules/core/04-channel/v2/types/msgs.go @@ -9,7 +9,6 @@ import ( clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" commitmenttypesv1 "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types" - commitmenttypesv2 "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types/v2" host "github.com/cosmos/ibc-go/v9/modules/core/24-host" ibcerrors "github.com/cosmos/ibc-go/v9/modules/core/errors" ) @@ -17,12 +16,6 @@ import ( const MaxTimeoutDelta time.Duration = 24 * time.Hour var ( - _ sdk.Msg = (*MsgCreateChannel)(nil) - _ sdk.HasValidateBasic = (*MsgCreateChannel)(nil) - - _ sdk.Msg = (*MsgRegisterCounterparty)(nil) - _ sdk.HasValidateBasic = (*MsgRegisterCounterparty)(nil) - _ sdk.Msg = (*MsgSendPacket)(nil) _ sdk.HasValidateBasic = (*MsgSendPacket)(nil) @@ -36,58 +29,6 @@ var ( _ sdk.HasValidateBasic = (*MsgAcknowledgement)(nil) ) -// NewMsgCreateChannel creates a new MsgCreateChannel instance -func NewMsgCreateChannel(clientID string, merklePathPrefix commitmenttypesv2.MerklePath, signer string) *MsgCreateChannel { - return &MsgCreateChannel{ - Signer: signer, - ClientId: clientID, - MerklePathPrefix: merklePathPrefix, - } -} - -// ValidateBasic performs basic checks on a MsgCreateChannel. -func (msg *MsgCreateChannel) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(msg.Signer); err != nil { - return errorsmod.Wrapf(ibcerrors.ErrInvalidAddress, "string could not be parsed as address: %v", err) - } - - if err := host.ClientIdentifierValidator(msg.ClientId); err != nil { - return err - } - - if err := msg.MerklePathPrefix.ValidateAsPrefix(); err != nil { - return err - } - - return nil -} - -// NewMsgRegisterCounterparty creates a new MsgRegisterCounterparty instance -func NewMsgRegisterCounterparty(channelID, counterpartyChannelID string, signer string) *MsgRegisterCounterparty { - return &MsgRegisterCounterparty{ - Signer: signer, - ChannelId: channelID, - CounterpartyChannelId: counterpartyChannelID, - } -} - -// ValidateBasic performs basic checks on a MsgRegisterCounterparty. -func (msg *MsgRegisterCounterparty) ValidateBasic() error { - if _, err := sdk.AccAddressFromBech32(msg.Signer); err != nil { - return errorsmod.Wrapf(ibcerrors.ErrInvalidAddress, "string could not be parsed as address: %v", err) - } - - if err := host.ChannelIdentifierValidator(msg.ChannelId); err != nil { - return err - } - - if err := host.ChannelIdentifierValidator(msg.CounterpartyChannelId); err != nil { - return err - } - - return nil -} - // NewMsgSendPacket creates a new MsgSendPacket instance. func NewMsgSendPacket(sourceClient string, timeoutTimestamp uint64, signer string, payloads ...Payload) *MsgSendPacket { return &MsgSendPacket{ diff --git a/modules/core/04-channel/v2/types/msgs_test.go b/modules/core/04-channel/v2/types/msgs_test.go index 74d968339dd..e097a7fd173 100644 --- a/modules/core/04-channel/v2/types/msgs_test.go +++ b/modules/core/04-channel/v2/types/msgs_test.go @@ -1,7 +1,6 @@ package types_test import ( - "errors" "testing" "github.com/stretchr/testify/suite" @@ -36,117 +35,6 @@ func TestTypesTestSuite(t *testing.T) { suite.Run(t, new(TypesTestSuite)) } -func (s *TypesTestSuite) TestMsgRegisterCounterpartyValidateBasic() { - var msg *types.MsgRegisterCounterparty - - testCases := []struct { - name string - malleate func() - expError error - }{ - { - "success", - func() {}, - nil, - }, - { - "failure: invalid signer address", - func() { - msg.Signer = "invalid" - }, - ibcerrors.ErrInvalidAddress, - }, - { - "failure: invalid channel ID", - func() { - msg.ChannelId = "" - }, - host.ErrInvalidID, - }, - { - "failure: invalid counterparty channel ID", - func() { - msg.CounterpartyChannelId = "" - }, - host.ErrInvalidID, - }, - } - - for _, tc := range testCases { - msg = types.NewMsgRegisterCounterparty( - ibctesting.FirstChannelID, - ibctesting.SecondChannelID, - ibctesting.TestAccAddress, - ) - - tc.malleate() - - err := msg.ValidateBasic() - expPass := tc.expError == nil - if expPass { - s.Require().NoError(err, "valid case %s failed", tc.name) - } else { - s.Require().ErrorIs(err, tc.expError, "invalid case %s passed", tc.name) - } - } -} - -// TestMsgCreateChannelValidateBasic tests ValidateBasic for MsgCreateChannel -func (s *TypesTestSuite) TestMsgCreateChannelValidateBasic() { - var msg *types.MsgCreateChannel - - testCases := []struct { - name string - malleate func() - expError error - }{ - { - "success", - func() {}, - nil, - }, - { - "failure: invalid signer address", - func() { - msg.Signer = "invalid" - }, - ibcerrors.ErrInvalidAddress, - }, - { - "failure: invalid client ID", - func() { - msg.ClientId = "" - }, - host.ErrInvalidID, - }, - { - "failure: empty key path", - func() { - msg.MerklePathPrefix.KeyPath = nil - }, - errors.New("path cannot have length 0"), - }, - } - - for _, tc := range testCases { - msg = types.NewMsgCreateChannel( - ibctesting.FirstClientID, - commitmenttypes.NewMerklePath([]byte("key")), - ibctesting.TestAccAddress, - ) - - tc.malleate() - - err := msg.ValidateBasic() - expPass := tc.expError == nil - if expPass { - s.Require().NoError(err, "valid case %s failed", tc.name) - } else { - s.Require().ErrorContains(err, tc.expError.Error(), "invalid case %s passed", tc.name) - } - } -} - func (s *TypesTestSuite) TestMsgSendPacketValidateBasic() { var msg *types.MsgSendPacket testCases := []struct { diff --git a/modules/core/04-channel/v2/types/query.go b/modules/core/04-channel/v2/types/query.go index deec70333ef..fdc87dccb39 100644 --- a/modules/core/04-channel/v2/types/query.go +++ b/modules/core/04-channel/v2/types/query.go @@ -1,51 +1,9 @@ package types import ( - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" ) -// NewQueryChannelRequest creates and returns a new channel query request. -func NewQueryChannelRequest(channelID string) *QueryChannelRequest { - return &QueryChannelRequest{ - ChannelId: channelID, - } -} - -// NewQueryChannelResponse creates and returns a new channel query response. -func NewQueryChannelResponse(channel Channel) *QueryChannelResponse { - return &QueryChannelResponse{ - Channel: channel, - } -} - -// NewQueryChannelClientStateRequest creates and returns a new ChannelClientState query request. -func NewQueryChannelClientStateRequest(channelID string) *QueryChannelClientStateRequest { - return &QueryChannelClientStateRequest{ - ChannelId: channelID, - } -} - -// NewQueryChannelClientStateResponse creates and returns a new ChannelClientState query response. -func NewQueryChannelClientStateResponse(identifiedClientState clienttypes.IdentifiedClientState, proof []byte, height clienttypes.Height) *QueryChannelClientStateResponse { - return &QueryChannelClientStateResponse{ - IdentifiedClientState: &identifiedClientState, - Proof: proof, - ProofHeight: height, - } -} - -// NewQueryChannelConsensusStateResponse creates and returns a new ChannelConsensusState query response. -func NewQueryChannelConsensusStateResponse(clientID string, anyConsensusState *codectypes.Any, proof []byte, height clienttypes.Height) *QueryChannelConsensusStateResponse { - return &QueryChannelConsensusStateResponse{ - ConsensusState: anyConsensusState, - ClientId: clientID, - Proof: proof, - ProofHeight: height, - } -} - // NewQueryNextSequenceSendRequest creates a new next sequence send query. func NewQueryNextSequenceSendRequest(clientID string) *QueryNextSequenceSendRequest { return &QueryNextSequenceSendRequest{ diff --git a/modules/core/04-channel/v2/types/query.pb.go b/modules/core/04-channel/v2/types/query.pb.go index a22ff923532..4f230d4757a 100644 --- a/modules/core/04-channel/v2/types/query.pb.go +++ b/modules/core/04-channel/v2/types/query.pb.go @@ -10,7 +10,6 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - any "github.com/cosmos/gogoproto/types/any" types "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" @@ -32,348 +31,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// QueryChannelRequest is the request type for the Query/Channel RPC method -type QueryChannelRequest struct { - ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` -} - -func (m *QueryChannelRequest) Reset() { *m = QueryChannelRequest{} } -func (m *QueryChannelRequest) String() string { return proto.CompactTextString(m) } -func (*QueryChannelRequest) ProtoMessage() {} -func (*QueryChannelRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{0} -} -func (m *QueryChannelRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryChannelRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryChannelRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryChannelRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryChannelRequest.Merge(m, src) -} -func (m *QueryChannelRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryChannelRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryChannelRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryChannelRequest proto.InternalMessageInfo - -func (m *QueryChannelRequest) GetChannelId() string { - if m != nil { - return m.ChannelId - } - return "" -} - -// QueryChannelRequest is the response type for the Query/Channel RPC method -type QueryChannelResponse struct { - // the channel associated with the provided channel id - Channel Channel `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel"` -} - -func (m *QueryChannelResponse) Reset() { *m = QueryChannelResponse{} } -func (m *QueryChannelResponse) String() string { return proto.CompactTextString(m) } -func (*QueryChannelResponse) ProtoMessage() {} -func (*QueryChannelResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{1} -} -func (m *QueryChannelResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryChannelResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryChannelResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryChannelResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryChannelResponse.Merge(m, src) -} -func (m *QueryChannelResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryChannelResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryChannelResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryChannelResponse proto.InternalMessageInfo - -func (m *QueryChannelResponse) GetChannel() Channel { - if m != nil { - return m.Channel - } - return Channel{} -} - -// QueryChannelClientStateRequest is the request type for the Query/ClientState -// RPC method -type QueryChannelClientStateRequest struct { - // channel unique identifier - ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` -} - -func (m *QueryChannelClientStateRequest) Reset() { *m = QueryChannelClientStateRequest{} } -func (m *QueryChannelClientStateRequest) String() string { return proto.CompactTextString(m) } -func (*QueryChannelClientStateRequest) ProtoMessage() {} -func (*QueryChannelClientStateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{2} -} -func (m *QueryChannelClientStateRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryChannelClientStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryChannelClientStateRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryChannelClientStateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryChannelClientStateRequest.Merge(m, src) -} -func (m *QueryChannelClientStateRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryChannelClientStateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryChannelClientStateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryChannelClientStateRequest proto.InternalMessageInfo - -func (m *QueryChannelClientStateRequest) GetChannelId() string { - if m != nil { - return m.ChannelId - } - return "" -} - -// QueryChannelClientStateResponse is the Response type for the -// Query/QueryChannelClientState RPC method -type QueryChannelClientStateResponse struct { - // client state associated with the channel - IdentifiedClientState *types.IdentifiedClientState `protobuf:"bytes,1,opt,name=identified_client_state,json=identifiedClientState,proto3" json:"identified_client_state,omitempty"` - // merkle proof of existence - Proof []byte `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` - // height at which the proof was retrieved - ProofHeight types.Height `protobuf:"bytes,3,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height"` -} - -func (m *QueryChannelClientStateResponse) Reset() { *m = QueryChannelClientStateResponse{} } -func (m *QueryChannelClientStateResponse) String() string { return proto.CompactTextString(m) } -func (*QueryChannelClientStateResponse) ProtoMessage() {} -func (*QueryChannelClientStateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{3} -} -func (m *QueryChannelClientStateResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryChannelClientStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryChannelClientStateResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryChannelClientStateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryChannelClientStateResponse.Merge(m, src) -} -func (m *QueryChannelClientStateResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryChannelClientStateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryChannelClientStateResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryChannelClientStateResponse proto.InternalMessageInfo - -func (m *QueryChannelClientStateResponse) GetIdentifiedClientState() *types.IdentifiedClientState { - if m != nil { - return m.IdentifiedClientState - } - return nil -} - -func (m *QueryChannelClientStateResponse) GetProof() []byte { - if m != nil { - return m.Proof - } - return nil -} - -func (m *QueryChannelClientStateResponse) GetProofHeight() types.Height { - if m != nil { - return m.ProofHeight - } - return types.Height{} -} - -// QueryChannelConsensusStateRequest is the request type for the Query/ConsensusState -// RPC method -type QueryChannelConsensusStateRequest struct { - // channel unique identifier - ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - // revision number of the consensus state - RevisionNumber uint64 `protobuf:"varint,2,opt,name=revision_number,json=revisionNumber,proto3" json:"revision_number,omitempty"` - // revision height of the consensus state - RevisionHeight uint64 `protobuf:"varint,3,opt,name=revision_height,json=revisionHeight,proto3" json:"revision_height,omitempty"` -} - -func (m *QueryChannelConsensusStateRequest) Reset() { *m = QueryChannelConsensusStateRequest{} } -func (m *QueryChannelConsensusStateRequest) String() string { return proto.CompactTextString(m) } -func (*QueryChannelConsensusStateRequest) ProtoMessage() {} -func (*QueryChannelConsensusStateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{4} -} -func (m *QueryChannelConsensusStateRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryChannelConsensusStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryChannelConsensusStateRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryChannelConsensusStateRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryChannelConsensusStateRequest.Merge(m, src) -} -func (m *QueryChannelConsensusStateRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryChannelConsensusStateRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryChannelConsensusStateRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryChannelConsensusStateRequest proto.InternalMessageInfo - -func (m *QueryChannelConsensusStateRequest) GetChannelId() string { - if m != nil { - return m.ChannelId - } - return "" -} - -func (m *QueryChannelConsensusStateRequest) GetRevisionNumber() uint64 { - if m != nil { - return m.RevisionNumber - } - return 0 -} - -func (m *QueryChannelConsensusStateRequest) GetRevisionHeight() uint64 { - if m != nil { - return m.RevisionHeight - } - return 0 -} - -// QueryChannelConsensusStateResponse is the Response type for the -// Query/QueryChannelConsensusState RPC method -type QueryChannelConsensusStateResponse struct { - // consensus state associated with the channel - ConsensusState *any.Any `protobuf:"bytes,1,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state,omitempty"` - // client ID associated with the consensus state - ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - // merkle proof of existence - Proof []byte `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"` - // height at which the proof was retrieved - ProofHeight types.Height `protobuf:"bytes,4,opt,name=proof_height,json=proofHeight,proto3" json:"proof_height"` -} - -func (m *QueryChannelConsensusStateResponse) Reset() { *m = QueryChannelConsensusStateResponse{} } -func (m *QueryChannelConsensusStateResponse) String() string { return proto.CompactTextString(m) } -func (*QueryChannelConsensusStateResponse) ProtoMessage() {} -func (*QueryChannelConsensusStateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{5} -} -func (m *QueryChannelConsensusStateResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryChannelConsensusStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryChannelConsensusStateResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryChannelConsensusStateResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryChannelConsensusStateResponse.Merge(m, src) -} -func (m *QueryChannelConsensusStateResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryChannelConsensusStateResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryChannelConsensusStateResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryChannelConsensusStateResponse proto.InternalMessageInfo - -func (m *QueryChannelConsensusStateResponse) GetConsensusState() *any.Any { - if m != nil { - return m.ConsensusState - } - return nil -} - -func (m *QueryChannelConsensusStateResponse) GetClientId() string { - if m != nil { - return m.ClientId - } - return "" -} - -func (m *QueryChannelConsensusStateResponse) GetProof() []byte { - if m != nil { - return m.Proof - } - return nil -} - -func (m *QueryChannelConsensusStateResponse) GetProofHeight() types.Height { - if m != nil { - return m.ProofHeight - } - return types.Height{} -} - // QueryNextSequenceSendRequest is the request type for the Query/QueryNextSequenceSend RPC method type QueryNextSequenceSendRequest struct { // client unique identifier @@ -384,7 +41,7 @@ func (m *QueryNextSequenceSendRequest) Reset() { *m = QueryNextSequenceS func (m *QueryNextSequenceSendRequest) String() string { return proto.CompactTextString(m) } func (*QueryNextSequenceSendRequest) ProtoMessage() {} func (*QueryNextSequenceSendRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{6} + return fileDescriptor_a328cba4986edcab, []int{0} } func (m *QueryNextSequenceSendRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -434,7 +91,7 @@ func (m *QueryNextSequenceSendResponse) Reset() { *m = QueryNextSequence func (m *QueryNextSequenceSendResponse) String() string { return proto.CompactTextString(m) } func (*QueryNextSequenceSendResponse) ProtoMessage() {} func (*QueryNextSequenceSendResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{7} + return fileDescriptor_a328cba4986edcab, []int{1} } func (m *QueryNextSequenceSendResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -496,7 +153,7 @@ func (m *QueryPacketCommitmentRequest) Reset() { *m = QueryPacketCommitm func (m *QueryPacketCommitmentRequest) String() string { return proto.CompactTextString(m) } func (*QueryPacketCommitmentRequest) ProtoMessage() {} func (*QueryPacketCommitmentRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{8} + return fileDescriptor_a328cba4986edcab, []int{2} } func (m *QueryPacketCommitmentRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -553,7 +210,7 @@ func (m *QueryPacketCommitmentResponse) Reset() { *m = QueryPacketCommit func (m *QueryPacketCommitmentResponse) String() string { return proto.CompactTextString(m) } func (*QueryPacketCommitmentResponse) ProtoMessage() {} func (*QueryPacketCommitmentResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{9} + return fileDescriptor_a328cba4986edcab, []int{3} } func (m *QueryPacketCommitmentResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -615,7 +272,7 @@ func (m *QueryPacketCommitmentsRequest) Reset() { *m = QueryPacketCommit func (m *QueryPacketCommitmentsRequest) String() string { return proto.CompactTextString(m) } func (*QueryPacketCommitmentsRequest) ProtoMessage() {} func (*QueryPacketCommitmentsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{10} + return fileDescriptor_a328cba4986edcab, []int{4} } func (m *QueryPacketCommitmentsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -672,7 +329,7 @@ func (m *QueryPacketCommitmentsResponse) Reset() { *m = QueryPacketCommi func (m *QueryPacketCommitmentsResponse) String() string { return proto.CompactTextString(m) } func (*QueryPacketCommitmentsResponse) ProtoMessage() {} func (*QueryPacketCommitmentsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{11} + return fileDescriptor_a328cba4986edcab, []int{5} } func (m *QueryPacketCommitmentsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -734,7 +391,7 @@ func (m *QueryPacketAcknowledgementRequest) Reset() { *m = QueryPacketAc func (m *QueryPacketAcknowledgementRequest) String() string { return proto.CompactTextString(m) } func (*QueryPacketAcknowledgementRequest) ProtoMessage() {} func (*QueryPacketAcknowledgementRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{12} + return fileDescriptor_a328cba4986edcab, []int{6} } func (m *QueryPacketAcknowledgementRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -791,7 +448,7 @@ func (m *QueryPacketAcknowledgementResponse) Reset() { *m = QueryPacketA func (m *QueryPacketAcknowledgementResponse) String() string { return proto.CompactTextString(m) } func (*QueryPacketAcknowledgementResponse) ProtoMessage() {} func (*QueryPacketAcknowledgementResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{13} + return fileDescriptor_a328cba4986edcab, []int{7} } func (m *QueryPacketAcknowledgementResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -856,7 +513,7 @@ func (m *QueryPacketAcknowledgementsRequest) Reset() { *m = QueryPacketA func (m *QueryPacketAcknowledgementsRequest) String() string { return proto.CompactTextString(m) } func (*QueryPacketAcknowledgementsRequest) ProtoMessage() {} func (*QueryPacketAcknowledgementsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{14} + return fileDescriptor_a328cba4986edcab, []int{8} } func (m *QueryPacketAcknowledgementsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -920,7 +577,7 @@ func (m *QueryPacketAcknowledgementsResponse) Reset() { *m = QueryPacket func (m *QueryPacketAcknowledgementsResponse) String() string { return proto.CompactTextString(m) } func (*QueryPacketAcknowledgementsResponse) ProtoMessage() {} func (*QueryPacketAcknowledgementsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{15} + return fileDescriptor_a328cba4986edcab, []int{9} } func (m *QueryPacketAcknowledgementsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -982,7 +639,7 @@ func (m *QueryPacketReceiptRequest) Reset() { *m = QueryPacketReceiptReq func (m *QueryPacketReceiptRequest) String() string { return proto.CompactTextString(m) } func (*QueryPacketReceiptRequest) ProtoMessage() {} func (*QueryPacketReceiptRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{16} + return fileDescriptor_a328cba4986edcab, []int{10} } func (m *QueryPacketReceiptRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1039,7 +696,7 @@ func (m *QueryPacketReceiptResponse) Reset() { *m = QueryPacketReceiptRe func (m *QueryPacketReceiptResponse) String() string { return proto.CompactTextString(m) } func (*QueryPacketReceiptResponse) ProtoMessage() {} func (*QueryPacketReceiptResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{17} + return fileDescriptor_a328cba4986edcab, []int{11} } func (m *QueryPacketReceiptResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1101,7 +758,7 @@ func (m *QueryUnreceivedPacketsRequest) Reset() { *m = QueryUnreceivedPa func (m *QueryUnreceivedPacketsRequest) String() string { return proto.CompactTextString(m) } func (*QueryUnreceivedPacketsRequest) ProtoMessage() {} func (*QueryUnreceivedPacketsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{18} + return fileDescriptor_a328cba4986edcab, []int{12} } func (m *QueryUnreceivedPacketsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1156,7 +813,7 @@ func (m *QueryUnreceivedPacketsResponse) Reset() { *m = QueryUnreceivedP func (m *QueryUnreceivedPacketsResponse) String() string { return proto.CompactTextString(m) } func (*QueryUnreceivedPacketsResponse) ProtoMessage() {} func (*QueryUnreceivedPacketsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{19} + return fileDescriptor_a328cba4986edcab, []int{13} } func (m *QueryUnreceivedPacketsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1212,7 +869,7 @@ func (m *QueryUnreceivedAcksRequest) Reset() { *m = QueryUnreceivedAcksR func (m *QueryUnreceivedAcksRequest) String() string { return proto.CompactTextString(m) } func (*QueryUnreceivedAcksRequest) ProtoMessage() {} func (*QueryUnreceivedAcksRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{20} + return fileDescriptor_a328cba4986edcab, []int{14} } func (m *QueryUnreceivedAcksRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1268,7 +925,7 @@ func (m *QueryUnreceivedAcksResponse) Reset() { *m = QueryUnreceivedAcks func (m *QueryUnreceivedAcksResponse) String() string { return proto.CompactTextString(m) } func (*QueryUnreceivedAcksResponse) ProtoMessage() {} func (*QueryUnreceivedAcksResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a328cba4986edcab, []int{21} + return fileDescriptor_a328cba4986edcab, []int{15} } func (m *QueryUnreceivedAcksResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1312,12 +969,6 @@ func (m *QueryUnreceivedAcksResponse) GetHeight() types.Height { } func init() { - proto.RegisterType((*QueryChannelRequest)(nil), "ibc.core.channel.v2.QueryChannelRequest") - proto.RegisterType((*QueryChannelResponse)(nil), "ibc.core.channel.v2.QueryChannelResponse") - proto.RegisterType((*QueryChannelClientStateRequest)(nil), "ibc.core.channel.v2.QueryChannelClientStateRequest") - proto.RegisterType((*QueryChannelClientStateResponse)(nil), "ibc.core.channel.v2.QueryChannelClientStateResponse") - proto.RegisterType((*QueryChannelConsensusStateRequest)(nil), "ibc.core.channel.v2.QueryChannelConsensusStateRequest") - proto.RegisterType((*QueryChannelConsensusStateResponse)(nil), "ibc.core.channel.v2.QueryChannelConsensusStateResponse") proto.RegisterType((*QueryNextSequenceSendRequest)(nil), "ibc.core.channel.v2.QueryNextSequenceSendRequest") proto.RegisterType((*QueryNextSequenceSendResponse)(nil), "ibc.core.channel.v2.QueryNextSequenceSendResponse") proto.RegisterType((*QueryPacketCommitmentRequest)(nil), "ibc.core.channel.v2.QueryPacketCommitmentRequest") @@ -1339,90 +990,72 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v2/query.proto", fileDescriptor_a328cba4986edcab) } var fileDescriptor_a328cba4986edcab = []byte{ - // 1328 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff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 0x6f, 0x5e, 0x2d, 0xda, 0xa4, 0x7e, 0x83, 0x94, 0xed, 0x42, 0x6d, 0x8b, - 0x72, 0x17, 0xdc, 0xf4, 0xdc, 0x55, 0x1f, 0x3e, 0x67, 0xa7, 0x42, 0x79, 0xfe, 0xb8, 0xf8, 0x93, - 0x69, 0xf6, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8d, 0x64, 0x80, 0x86, 0x13, 0x16, 0x00, 0x00, + // 1031 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4d, 0x6f, 0x1b, 0x45, + 0x18, 0xce, 0xc4, 0x6e, 0x95, 0xbe, 0x4e, 0x21, 0x1d, 0x02, 0x72, 0x37, 0xc1, 0x75, 0x17, 0x09, + 0x2c, 0x44, 0x77, 0x62, 0x17, 0x41, 0x51, 0xf9, 0x4a, 0x22, 0xda, 0x20, 0x50, 0x55, 0x36, 0x7c, + 0x48, 0x51, 0x25, 0x6b, 0xbd, 0x1e, 0x36, 0x8b, 0xed, 0x9d, 0xad, 0x67, 0x6d, 0x52, 0x55, 0xb9, + 0x20, 0x2e, 0xdc, 0x90, 0x7a, 0xe3, 0x17, 0xc0, 0x8f, 0x00, 0x89, 0x5b, 0x7b, 0x2b, 0x42, 0x48, + 0x9c, 0xa0, 0x4a, 0x90, 0xf8, 0x07, 0x9c, 0x91, 0x67, 0xc6, 0xf6, 0xae, 0xbd, 0xde, 0xec, 0xa6, + 0x0d, 0xe2, 0x36, 0x3b, 0x7e, 0x3f, 0x9e, 0xe7, 0x9d, 0xe7, 0x9d, 0x77, 0x12, 0xb8, 0xe0, 0x36, + 0x6c, 0x62, 0xb3, 0x2e, 0x25, 0xf6, 0xae, 0xe5, 0x79, 0xb4, 0x4d, 0xfa, 0x35, 0x72, 0xbb, 0x47, + 0xbb, 0x77, 0x0c, 0xbf, 0xcb, 0x02, 0x86, 0x9f, 0x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a4, + 0xb6, 0x57, 0xe0, 0x3f, 0x10, 0xe0, 0xdf, 0xc3, 0x9b, 0x59, 0xc1, 0x77, 0x65, 0xa0, 0xc8, 0xb9, + 0x3c, 0x42, 0x70, 0x6e, 0x6a, 0x40, 0x24, 0xf5, 0xcb, 0xac, 0x49, 0x95, 0xd4, 0x2f, 0x33, 0x27, + 0x90, 0xde, 0x10, 0x5c, 0x6e, 0xe1, 0x9d, 0x27, 0xd2, 0xfe, 0x7c, 0x9f, 0xf4, 0x46, 0xa9, 0xea, + 0xbe, 0x22, 0xf3, 0x27, 0x82, 0xa7, 0xa2, 0xc3, 0x01, 0x93, 0x34, 0x58, 0x43, 0x33, 0x4b, 0x5b, + 0x4b, 0xef, 0xa0, 0x98, 0x7d, 0x21, 0x98, 0x35, 0x71, 0xe3, 0xb1, 0x98, 0xc5, 0xcd, 0xc2, 0x08, + 0xc9, 0x41, 0x9f, 0x6d, 0x7c, 0x7a, 0xff, 0xa0, 0x84, 0x1e, 0x1e, 0x94, 0xd0, 0xa3, 0x83, 0x12, + 0xfa, 0xf6, 0xb0, 0x34, 0xf7, 0xf0, 0xb0, 0x34, 0xf7, 0xfb, 0x61, 0x69, 0x6e, 0xe7, 0x4d, 0xc7, + 0x0d, 0x76, 0x7b, 0x0d, 0xc3, 0x66, 0x1d, 0xa2, 0xfe, 0x31, 0xe0, 0x36, 0xec, 0x4b, 0x0e, 0x23, + 0xfd, 0x37, 0x48, 0x87, 0x35, 0x7b, 0x6d, 0xca, 0x25, 0xb8, 0xb5, 0x57, 0x2f, 0x85, 0xf0, 0x05, + 0x77, 0x7c, 0xca, 0x1b, 0xa7, 0xc5, 0x9f, 0xeb, 0x97, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xdc, + 0x82, 0xc5, 0xf4, 0x8a, 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1437,14 +1070,6 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { - // Channel queries the counterparty of an IBC client. - Channel(ctx context.Context, in *QueryChannelRequest, opts ...grpc.CallOption) (*QueryChannelResponse, error) - // ChannelClientState queries for the client state for the channel associated - // with the provided channel identifiers. - ChannelClientState(ctx context.Context, in *QueryChannelClientStateRequest, opts ...grpc.CallOption) (*QueryChannelClientStateResponse, error) - // ChannelConsensusState queries for the consensus state for the channel associated - // with the provided channel identifiers. - ChannelConsensusState(ctx context.Context, in *QueryChannelConsensusStateRequest, opts ...grpc.CallOption) (*QueryChannelConsensusStateResponse, error) // NextSequenceSend returns the next send sequence for a given channel. NextSequenceSend(ctx context.Context, in *QueryNextSequenceSendRequest, opts ...grpc.CallOption) (*QueryNextSequenceSendResponse, error) // PacketCommitment queries a stored packet commitment hash. @@ -1471,33 +1096,6 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } -func (c *queryClient) Channel(ctx context.Context, in *QueryChannelRequest, opts ...grpc.CallOption) (*QueryChannelResponse, error) { - out := new(QueryChannelResponse) - err := c.cc.Invoke(ctx, "/ibc.core.channel.v2.Query/Channel", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) ChannelClientState(ctx context.Context, in *QueryChannelClientStateRequest, opts ...grpc.CallOption) (*QueryChannelClientStateResponse, error) { - out := new(QueryChannelClientStateResponse) - err := c.cc.Invoke(ctx, "/ibc.core.channel.v2.Query/ChannelClientState", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) ChannelConsensusState(ctx context.Context, in *QueryChannelConsensusStateRequest, opts ...grpc.CallOption) (*QueryChannelConsensusStateResponse, error) { - out := new(QueryChannelConsensusStateResponse) - err := c.cc.Invoke(ctx, "/ibc.core.channel.v2.Query/ChannelConsensusState", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *queryClient) NextSequenceSend(ctx context.Context, in *QueryNextSequenceSendRequest, opts ...grpc.CallOption) (*QueryNextSequenceSendResponse, error) { out := new(QueryNextSequenceSendResponse) err := c.cc.Invoke(ctx, "/ibc.core.channel.v2.Query/NextSequenceSend", in, out, opts...) @@ -1572,14 +1170,6 @@ func (c *queryClient) UnreceivedAcks(ctx context.Context, in *QueryUnreceivedAck // QueryServer is the server API for Query service. type QueryServer interface { - // Channel queries the counterparty of an IBC client. - Channel(context.Context, *QueryChannelRequest) (*QueryChannelResponse, error) - // ChannelClientState queries for the client state for the channel associated - // with the provided channel identifiers. - ChannelClientState(context.Context, *QueryChannelClientStateRequest) (*QueryChannelClientStateResponse, error) - // ChannelConsensusState queries for the consensus state for the channel associated - // with the provided channel identifiers. - ChannelConsensusState(context.Context, *QueryChannelConsensusStateRequest) (*QueryChannelConsensusStateResponse, error) // NextSequenceSend returns the next send sequence for a given channel. NextSequenceSend(context.Context, *QueryNextSequenceSendRequest) (*QueryNextSequenceSendResponse, error) // PacketCommitment queries a stored packet commitment hash. @@ -1602,15 +1192,6 @@ type QueryServer interface { type UnimplementedQueryServer struct { } -func (*UnimplementedQueryServer) Channel(ctx context.Context, req *QueryChannelRequest) (*QueryChannelResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Channel not implemented") -} -func (*UnimplementedQueryServer) ChannelClientState(ctx context.Context, req *QueryChannelClientStateRequest) (*QueryChannelClientStateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChannelClientState not implemented") -} -func (*UnimplementedQueryServer) ChannelConsensusState(ctx context.Context, req *QueryChannelConsensusStateRequest) (*QueryChannelConsensusStateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChannelConsensusState not implemented") -} func (*UnimplementedQueryServer) NextSequenceSend(ctx context.Context, req *QueryNextSequenceSendRequest) (*QueryNextSequenceSendResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method NextSequenceSend not implemented") } @@ -1640,60 +1221,6 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } -func _Query_Channel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryChannelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Channel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.channel.v2.Query/Channel", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Channel(ctx, req.(*QueryChannelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_ChannelClientState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryChannelClientStateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ChannelClientState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.channel.v2.Query/ChannelClientState", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ChannelClientState(ctx, req.(*QueryChannelClientStateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_ChannelConsensusState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryChannelConsensusStateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).ChannelConsensusState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.channel.v2.Query/ChannelConsensusState", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ChannelConsensusState(ctx, req.(*QueryChannelConsensusStateRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_NextSequenceSend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryNextSequenceSendRequest) if err := dec(in); err != nil { @@ -1842,18 +1369,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "ibc.core.channel.v2.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ - { - MethodName: "Channel", - Handler: _Query_Channel_Handler, - }, - { - MethodName: "ChannelClientState", - Handler: _Query_ChannelClientState_Handler, - }, - { - MethodName: "ChannelConsensusState", - Handler: _Query_ChannelConsensusState_Handler, - }, { MethodName: "NextSequenceSend", Handler: _Query_NextSequenceSend_Handler, @@ -1891,250 +1406,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Metadata: "ibc/core/channel/v2/query.proto", } -func (m *QueryChannelRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryChannelRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryChannelRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChannelId) > 0 { - i -= len(m.ChannelId) - copy(dAtA[i:], m.ChannelId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChannelId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryChannelResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryChannelResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryChannelResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Channel.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryChannelClientStateRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryChannelClientStateRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryChannelClientStateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChannelId) > 0 { - i -= len(m.ChannelId) - copy(dAtA[i:], m.ChannelId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChannelId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryChannelClientStateResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryChannelClientStateResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryChannelClientStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Proof) > 0 { - i -= len(m.Proof) - copy(dAtA[i:], m.Proof) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Proof))) - i-- - dAtA[i] = 0x12 - } - if m.IdentifiedClientState != nil { - { - size, err := m.IdentifiedClientState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryChannelConsensusStateRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryChannelConsensusStateRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryChannelConsensusStateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.RevisionHeight != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.RevisionHeight)) - i-- - dAtA[i] = 0x18 - } - if m.RevisionNumber != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.RevisionNumber)) - i-- - dAtA[i] = 0x10 - } - if len(m.ChannelId) > 0 { - i -= len(m.ChannelId) - copy(dAtA[i:], m.ChannelId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChannelId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryChannelConsensusStateResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryChannelConsensusStateResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryChannelConsensusStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if len(m.Proof) > 0 { - i -= len(m.Proof) - copy(dAtA[i:], m.Proof) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Proof))) - i-- - dAtA[i] = 0x1a - } - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ClientId))) - i-- - dAtA[i] = 0x12 - } - if m.ConsensusState != nil { - { - size, err := m.ConsensusState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *QueryNextSequenceSendRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2496,20 +1767,20 @@ func (m *QueryPacketAcknowledgementsRequest) MarshalToSizedBuffer(dAtA []byte) ( var l int _ = l if len(m.PacketCommitmentSequences) > 0 { - dAtA13 := make([]byte, len(m.PacketCommitmentSequences)*10) - var j12 int + dAtA8 := make([]byte, len(m.PacketCommitmentSequences)*10) + var j7 int for _, num := range m.PacketCommitmentSequences { for num >= 1<<7 { - dAtA13[j12] = uint8(uint64(num)&0x7f | 0x80) + dAtA8[j7] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j12++ + j7++ } - dAtA13[j12] = uint8(num) - j12++ + dAtA8[j7] = uint8(num) + j7++ } - i -= j12 - copy(dAtA[i:], dAtA13[:j12]) - i = encodeVarintQuery(dAtA, i, uint64(j12)) + i -= j7 + copy(dAtA[i:], dAtA8[:j7]) + i = encodeVarintQuery(dAtA, i, uint64(j7)) i-- dAtA[i] = 0x1a } @@ -2700,20 +1971,20 @@ func (m *QueryUnreceivedPacketsRequest) MarshalToSizedBuffer(dAtA []byte) (int, var l int _ = l if len(m.Sequences) > 0 { - dAtA19 := make([]byte, len(m.Sequences)*10) - var j18 int + dAtA14 := make([]byte, len(m.Sequences)*10) + var j13 int for _, num := range m.Sequences { for num >= 1<<7 { - dAtA19[j18] = uint8(uint64(num)&0x7f | 0x80) + dAtA14[j13] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j18++ + j13++ } - dAtA19[j18] = uint8(num) - j18++ + dAtA14[j13] = uint8(num) + j13++ } - i -= j18 - copy(dAtA[i:], dAtA19[:j18]) - i = encodeVarintQuery(dAtA, i, uint64(j18)) + i -= j13 + copy(dAtA[i:], dAtA14[:j13]) + i = encodeVarintQuery(dAtA, i, uint64(j13)) i-- dAtA[i] = 0x12 } @@ -2758,20 +2029,20 @@ func (m *QueryUnreceivedPacketsResponse) MarshalToSizedBuffer(dAtA []byte) (int, i-- dAtA[i] = 0x12 if len(m.Sequences) > 0 { - dAtA22 := make([]byte, len(m.Sequences)*10) - var j21 int + dAtA17 := make([]byte, len(m.Sequences)*10) + var j16 int for _, num := range m.Sequences { for num >= 1<<7 { - dAtA22[j21] = uint8(uint64(num)&0x7f | 0x80) + dAtA17[j16] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j21++ + j16++ } - dAtA22[j21] = uint8(num) - j21++ + dAtA17[j16] = uint8(num) + j16++ } - i -= j21 - copy(dAtA[i:], dAtA22[:j21]) - i = encodeVarintQuery(dAtA, i, uint64(j21)) + i -= j16 + copy(dAtA[i:], dAtA17[:j16]) + i = encodeVarintQuery(dAtA, i, uint64(j16)) i-- dAtA[i] = 0xa } @@ -2799,20 +2070,20 @@ func (m *QueryUnreceivedAcksRequest) MarshalToSizedBuffer(dAtA []byte) (int, err var l int _ = l if len(m.PacketAckSequences) > 0 { - dAtA24 := make([]byte, len(m.PacketAckSequences)*10) - var j23 int + dAtA19 := make([]byte, len(m.PacketAckSequences)*10) + var j18 int for _, num := range m.PacketAckSequences { for num >= 1<<7 { - dAtA24[j23] = uint8(uint64(num)&0x7f | 0x80) + dAtA19[j18] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j23++ + j18++ } - dAtA24[j23] = uint8(num) - j23++ + dAtA19[j18] = uint8(num) + j18++ } - i -= j23 - copy(dAtA[i:], dAtA24[:j23]) - i = encodeVarintQuery(dAtA, i, uint64(j23)) + i -= j18 + copy(dAtA[i:], dAtA19[:j18]) + i = encodeVarintQuery(dAtA, i, uint64(j18)) i-- dAtA[i] = 0x12 } @@ -2857,20 +2128,20 @@ func (m *QueryUnreceivedAcksResponse) MarshalToSizedBuffer(dAtA []byte) (int, er i-- dAtA[i] = 0x12 if len(m.Sequences) > 0 { - dAtA27 := make([]byte, len(m.Sequences)*10) - var j26 int + dAtA22 := make([]byte, len(m.Sequences)*10) + var j21 int for _, num := range m.Sequences { for num >= 1<<7 { - dAtA27[j26] = uint8(uint64(num)&0x7f | 0x80) + dAtA22[j21] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j26++ + j21++ } - dAtA27[j26] = uint8(num) - j26++ + dAtA22[j21] = uint8(num) + j21++ } - i -= j26 - copy(dAtA[i:], dAtA27[:j26]) - i = encodeVarintQuery(dAtA, i, uint64(j26)) + i -= j21 + copy(dAtA[i:], dAtA22[:j21]) + i = encodeVarintQuery(dAtA, i, uint64(j21)) i-- dAtA[i] = 0xa } @@ -2888,104 +2159,6 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *QueryChannelRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChannelId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryChannelResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Channel.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryChannelClientStateRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChannelId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryChannelClientStateResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.IdentifiedClientState != nil { - l = m.IdentifiedClientState.Size() - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Proof) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = m.ProofHeight.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryChannelConsensusStateRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChannelId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.RevisionNumber != 0 { - n += 1 + sovQuery(uint64(m.RevisionNumber)) - } - if m.RevisionHeight != 0 { - n += 1 + sovQuery(uint64(m.RevisionHeight)) - } - return n -} - -func (m *QueryChannelConsensusStateResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ConsensusState != nil { - l = m.ConsensusState.Size() - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.Proof) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = m.ProofHeight.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - func (m *QueryNextSequenceSendRequest) Size() (n int) { if m == nil { return 0 @@ -3286,711 +2459,6 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *QueryChannelRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryChannelRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryChannelRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChannelId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryChannelResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryChannelResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryChannelResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Channel.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryChannelClientStateRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryChannelClientStateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryChannelClientStateRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChannelId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryChannelClientStateResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryChannelClientStateResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryChannelClientStateResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IdentifiedClientState", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.IdentifiedClientState == nil { - m.IdentifiedClientState = &types.IdentifiedClientState{} - } - if err := m.IdentifiedClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) - if m.Proof == nil { - m.Proof = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryChannelConsensusStateRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryChannelConsensusStateRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryChannelConsensusStateRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChannelId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RevisionNumber", wireType) - } - m.RevisionNumber = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RevisionNumber |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RevisionHeight", wireType) - } - m.RevisionHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RevisionHeight |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryChannelConsensusStateResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryChannelConsensusStateResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryChannelConsensusStateResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ConsensusState == nil { - m.ConsensusState = &any.Any{} - } - if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proof = append(m.Proof[:0], dAtA[iNdEx:postIndex]...) - if m.Proof == nil { - m.Proof = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *QueryNextSequenceSendRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/modules/core/04-channel/v2/types/query.pb.gw.go b/modules/core/04-channel/v2/types/query.pb.gw.go index e6585d7bee1..63572d446cc 100644 --- a/modules/core/04-channel/v2/types/query.pb.gw.go +++ b/modules/core/04-channel/v2/types/query.pb.gw.go @@ -33,186 +33,6 @@ var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage var _ = metadata.Join -func request_Query_Channel_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryChannelRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["channel_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") - } - - protoReq.ChannelId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) - } - - msg, err := client.Channel(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Channel_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryChannelRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["channel_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") - } - - protoReq.ChannelId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) - } - - msg, err := server.Channel(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_ChannelClientState_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryChannelClientStateRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["channel_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") - } - - protoReq.ChannelId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) - } - - msg, err := client.ChannelClientState(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_ChannelClientState_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryChannelClientStateRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["channel_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") - } - - protoReq.ChannelId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) - } - - msg, err := server.ChannelClientState(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_ChannelConsensusState_0 = &utilities.DoubleArray{Encoding: map[string]int{"channel_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_ChannelConsensusState_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryChannelConsensusStateRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["channel_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") - } - - protoReq.ChannelId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ChannelConsensusState_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.ChannelConsensusState(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_ChannelConsensusState_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryChannelConsensusStateRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["channel_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") - } - - protoReq.ChannelId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ChannelConsensusState_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.ChannelConsensusState(ctx, &protoReq) - return msg, metadata, err - -} - func request_Query_NextSequenceSend_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryNextSequenceSendRequest var metadata runtime.ServerMetadata @@ -797,75 +617,6 @@ func local_request_Query_UnreceivedAcks_0(ctx context.Context, marshaler runtime // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - mux.Handle("GET", pattern_Query_Channel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Channel_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Channel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ChannelClientState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_ChannelClientState_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ChannelClientState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ChannelConsensusState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_ChannelConsensusState_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ChannelConsensusState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_NextSequenceSend_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1091,66 +842,6 @@ func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc // "QueryClient" to call the correct interceptors. func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - mux.Handle("GET", pattern_Query_Channel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Channel_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Channel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ChannelClientState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_ChannelClientState_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ChannelClientState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_ChannelConsensusState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_ChannelConsensusState_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_ChannelConsensusState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_NextSequenceSend_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1315,12 +1006,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Channel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"ibc", "core", "channel", "v2", "channels", "channel_id"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_ChannelClientState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"ibc", "core", "channel", "v2", "channels", "channel_id", "client_state"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_ChannelConsensusState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"ibc", "core", "channel", "v2", "channels", "channel_id", "consensus_state"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_NextSequenceSend_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"ibc", "core", "channel", "v2", "clients", "client_id", "next_sequence_send"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_PacketCommitment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7}, []string{"ibc", "core", "channel", "v2", "clients", "client_id", "packet_commitments", "sequence"}, "", runtime.AssumeColonVerbOpt(false))) @@ -1339,12 +1024,6 @@ var ( ) var ( - forward_Query_Channel_0 = runtime.ForwardResponseMessage - - forward_Query_ChannelClientState_0 = runtime.ForwardResponseMessage - - forward_Query_ChannelConsensusState_0 = runtime.ForwardResponseMessage - forward_Query_NextSequenceSend_0 = runtime.ForwardResponseMessage forward_Query_PacketCommitment_0 = runtime.ForwardResponseMessage diff --git a/modules/core/04-channel/v2/types/tx.pb.go b/modules/core/04-channel/v2/types/tx.pb.go index 7f8de660dd8..ba67180f946 100644 --- a/modules/core/04-channel/v2/types/tx.pb.go +++ b/modules/core/04-channel/v2/types/tx.pb.go @@ -11,7 +11,6 @@ import ( grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" types "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" - v2 "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types/v2" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -67,169 +66,6 @@ func (ResponseResultType) EnumDescriptor() ([]byte, []int) { return fileDescriptor_d421c7119e969b99, []int{0} } -// MsgCreateChannel defines the message used to create a v2 Channel. -type MsgCreateChannel struct { - // the client identifier of the light client representing the counterparty chain - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` - // the key path used to store packet flow messages that the counterparty - // will use to send to us. - MerklePathPrefix v2.MerklePath `protobuf:"bytes,2,opt,name=merkle_path_prefix,json=merklePathPrefix,proto3" json:"merkle_path_prefix"` - // signer address - Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` -} - -func (m *MsgCreateChannel) Reset() { *m = MsgCreateChannel{} } -func (m *MsgCreateChannel) String() string { return proto.CompactTextString(m) } -func (*MsgCreateChannel) ProtoMessage() {} -func (*MsgCreateChannel) Descriptor() ([]byte, []int) { - return fileDescriptor_d421c7119e969b99, []int{0} -} -func (m *MsgCreateChannel) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreateChannel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreateChannel.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgCreateChannel) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateChannel.Merge(m, src) -} -func (m *MsgCreateChannel) XXX_Size() int { - return m.Size() -} -func (m *MsgCreateChannel) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateChannel.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreateChannel proto.InternalMessageInfo - -// MsgCreateChannelResponse defines the Msg/CreateChannel response type. -type MsgCreateChannelResponse struct { - ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` -} - -func (m *MsgCreateChannelResponse) Reset() { *m = MsgCreateChannelResponse{} } -func (m *MsgCreateChannelResponse) String() string { return proto.CompactTextString(m) } -func (*MsgCreateChannelResponse) ProtoMessage() {} -func (*MsgCreateChannelResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d421c7119e969b99, []int{1} -} -func (m *MsgCreateChannelResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreateChannelResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreateChannelResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgCreateChannelResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateChannelResponse.Merge(m, src) -} -func (m *MsgCreateChannelResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgCreateChannelResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateChannelResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreateChannelResponse proto.InternalMessageInfo - -// MsgRegisterCounterparty defines the message used to provide the counterparty channel -// identifier. -type MsgRegisterCounterparty struct { - // unique identifier we will use to write all packet messages sent to counterparty - ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - // counterparty channel identifier - CounterpartyChannelId string `protobuf:"bytes,2,opt,name=counterparty_channel_id,json=counterpartyChannelId,proto3" json:"counterparty_channel_id,omitempty"` - // signer address - Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` -} - -func (m *MsgRegisterCounterparty) Reset() { *m = MsgRegisterCounterparty{} } -func (m *MsgRegisterCounterparty) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterCounterparty) ProtoMessage() {} -func (*MsgRegisterCounterparty) Descriptor() ([]byte, []int) { - return fileDescriptor_d421c7119e969b99, []int{2} -} -func (m *MsgRegisterCounterparty) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterCounterparty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterCounterparty.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgRegisterCounterparty) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterCounterparty.Merge(m, src) -} -func (m *MsgRegisterCounterparty) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterCounterparty) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterCounterparty.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterCounterparty proto.InternalMessageInfo - -// MsgRegisterCounterpartyResponse defines the Msg/RegisterCounterparty response type. -type MsgRegisterCounterpartyResponse struct { -} - -func (m *MsgRegisterCounterpartyResponse) Reset() { *m = MsgRegisterCounterpartyResponse{} } -func (m *MsgRegisterCounterpartyResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterCounterpartyResponse) ProtoMessage() {} -func (*MsgRegisterCounterpartyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d421c7119e969b99, []int{3} -} -func (m *MsgRegisterCounterpartyResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterCounterpartyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterCounterpartyResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgRegisterCounterpartyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterCounterpartyResponse.Merge(m, src) -} -func (m *MsgRegisterCounterpartyResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterCounterpartyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterCounterpartyResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterCounterpartyResponse proto.InternalMessageInfo - // MsgSendPacket sends an outgoing IBC packet. type MsgSendPacket struct { SourceClient string `protobuf:"bytes,1,opt,name=source_client,json=sourceClient,proto3" json:"source_client,omitempty"` @@ -242,7 +78,7 @@ func (m *MsgSendPacket) Reset() { *m = MsgSendPacket{} } func (m *MsgSendPacket) String() string { return proto.CompactTextString(m) } func (*MsgSendPacket) ProtoMessage() {} func (*MsgSendPacket) Descriptor() ([]byte, []int) { - return fileDescriptor_d421c7119e969b99, []int{4} + return fileDescriptor_d421c7119e969b99, []int{0} } func (m *MsgSendPacket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -280,7 +116,7 @@ func (m *MsgSendPacketResponse) Reset() { *m = MsgSendPacketResponse{} } func (m *MsgSendPacketResponse) String() string { return proto.CompactTextString(m) } func (*MsgSendPacketResponse) ProtoMessage() {} func (*MsgSendPacketResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d421c7119e969b99, []int{5} + return fileDescriptor_d421c7119e969b99, []int{1} } func (m *MsgSendPacketResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -321,7 +157,7 @@ func (m *MsgRecvPacket) Reset() { *m = MsgRecvPacket{} } func (m *MsgRecvPacket) String() string { return proto.CompactTextString(m) } func (*MsgRecvPacket) ProtoMessage() {} func (*MsgRecvPacket) Descriptor() ([]byte, []int) { - return fileDescriptor_d421c7119e969b99, []int{6} + return fileDescriptor_d421c7119e969b99, []int{2} } func (m *MsgRecvPacket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -359,7 +195,7 @@ func (m *MsgRecvPacketResponse) Reset() { *m = MsgRecvPacketResponse{} } func (m *MsgRecvPacketResponse) String() string { return proto.CompactTextString(m) } func (*MsgRecvPacketResponse) ProtoMessage() {} func (*MsgRecvPacketResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d421c7119e969b99, []int{7} + return fileDescriptor_d421c7119e969b99, []int{3} } func (m *MsgRecvPacketResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -400,7 +236,7 @@ func (m *MsgTimeout) Reset() { *m = MsgTimeout{} } func (m *MsgTimeout) String() string { return proto.CompactTextString(m) } func (*MsgTimeout) ProtoMessage() {} func (*MsgTimeout) Descriptor() ([]byte, []int) { - return fileDescriptor_d421c7119e969b99, []int{8} + return fileDescriptor_d421c7119e969b99, []int{4} } func (m *MsgTimeout) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -438,7 +274,7 @@ func (m *MsgTimeoutResponse) Reset() { *m = MsgTimeoutResponse{} } func (m *MsgTimeoutResponse) String() string { return proto.CompactTextString(m) } func (*MsgTimeoutResponse) ProtoMessage() {} func (*MsgTimeoutResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d421c7119e969b99, []int{9} + return fileDescriptor_d421c7119e969b99, []int{5} } func (m *MsgTimeoutResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -480,7 +316,7 @@ func (m *MsgAcknowledgement) Reset() { *m = MsgAcknowledgement{} } func (m *MsgAcknowledgement) String() string { return proto.CompactTextString(m) } func (*MsgAcknowledgement) ProtoMessage() {} func (*MsgAcknowledgement) Descriptor() ([]byte, []int) { - return fileDescriptor_d421c7119e969b99, []int{10} + return fileDescriptor_d421c7119e969b99, []int{6} } func (m *MsgAcknowledgement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -518,7 +354,7 @@ func (m *MsgAcknowledgementResponse) Reset() { *m = MsgAcknowledgementRe func (m *MsgAcknowledgementResponse) String() string { return proto.CompactTextString(m) } func (*MsgAcknowledgementResponse) ProtoMessage() {} func (*MsgAcknowledgementResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d421c7119e969b99, []int{11} + return fileDescriptor_d421c7119e969b99, []int{7} } func (m *MsgAcknowledgementResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -549,10 +385,6 @@ var xxx_messageInfo_MsgAcknowledgementResponse proto.InternalMessageInfo func init() { proto.RegisterEnum("ibc.core.channel.v2.ResponseResultType", ResponseResultType_name, ResponseResultType_value) - proto.RegisterType((*MsgCreateChannel)(nil), "ibc.core.channel.v2.MsgCreateChannel") - proto.RegisterType((*MsgCreateChannelResponse)(nil), "ibc.core.channel.v2.MsgCreateChannelResponse") - proto.RegisterType((*MsgRegisterCounterparty)(nil), "ibc.core.channel.v2.MsgRegisterCounterparty") - proto.RegisterType((*MsgRegisterCounterpartyResponse)(nil), "ibc.core.channel.v2.MsgRegisterCounterpartyResponse") proto.RegisterType((*MsgSendPacket)(nil), "ibc.core.channel.v2.MsgSendPacket") proto.RegisterType((*MsgSendPacketResponse)(nil), "ibc.core.channel.v2.MsgSendPacketResponse") proto.RegisterType((*MsgRecvPacket)(nil), "ibc.core.channel.v2.MsgRecvPacket") @@ -566,70 +398,58 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v2/tx.proto", fileDescriptor_d421c7119e969b99) } var fileDescriptor_d421c7119e969b99 = []byte{ - // 995 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x96, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xc7, 0xbd, 0xb1, 0x9b, 0x26, 0xcf, 0x09, 0x36, 0x43, 0x4b, 0xcc, 0x36, 0xd8, 0xc6, 0x80, - 0x12, 0x02, 0xf1, 0xd2, 0xa5, 0x20, 0xa5, 0x42, 0x54, 0xe9, 0xe2, 0x0a, 0x4b, 0x75, 0x62, 0xad, - 0xed, 0x4a, 0xfc, 0x10, 0xab, 0xf5, 0x7a, 0xba, 0x5e, 0xc5, 0xfb, 0x83, 0x9d, 0xb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c6, 0x9f, 0xcc, 0xfb, 0x1e, 0x26, 0xdd, - 0x79, 0xfa, 0x0c, 0xfd, 0xe4, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x10, 0x9a, 0x56, 0xa7, 0x56, - 0x0b, 0x00, 0x00, + // 803 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x96, 0x4d, 0x6f, 0xda, 0x48, + 0x18, 0xc7, 0x71, 0x70, 0x48, 0x76, 0x20, 0x0b, 0xeb, 0x7d, 0x63, 0xbd, 0x11, 0x58, 0xec, 0x4a, + 0xc9, 0xb2, 0x8a, 0xbd, 0x61, 0x77, 0x0f, 0x89, 0x56, 0x5b, 0x25, 0xd4, 0x51, 0x23, 0xe5, 0x05, + 0xd9, 0x50, 0xa9, 0x6d, 0x54, 0x04, 0x66, 0x6a, 0xac, 0x60, 0x8f, 0xcb, 0x18, 0xda, 0xdc, 0xaa, + 0x9e, 0x22, 0x4e, 0xfd, 0x02, 0x91, 0x2a, 0xf5, 0x0b, 0xe4, 0xd0, 0x0f, 0x11, 0xf5, 0x94, 0x63, + 0x4e, 0x55, 0x14, 0x0e, 0xf9, 0x1a, 0x95, 0x67, 0x86, 0xd7, 0x98, 0x26, 0x52, 0xe9, 0x09, 0xcf, + 0x7f, 0x7e, 0xcf, 0xf3, 0xcc, 0xf3, 0x1f, 0x33, 0x63, 0xb0, 0x68, 0x55, 0x0d, 0xc5, 0x40, 0x4d, + 0xa8, 0x18, 0xf5, 0x8a, 0xe3, 0xc0, 0x86, 0xd2, 0xce, 0x29, 0xde, 0x4b, 0xd9, 0x6d, 0x22, 0x0f, + 0x09, 0xdf, 0x5b, 0x55, 0x43, 0xf6, 0x67, 0x65, 0x36, 0x2b, 0xb7, 0x73, 0xe2, 0x0f, 0x26, 0x32, + 0x11, 0x99, 0x57, 0xfc, 0x27, 0x8a, 0x8a, 0x3f, 0x1b, 0x08, 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, 0xf8, 0xf8, 0x7f, + 0x71, 0x62, 0xec, 0x18, 0x28, 0x2a, 0x77, 0x04, 0x7b, 0xc5, 0xc4, 0xd9, 0x57, 0xd7, 0xa7, 0x59, + 0x6e, 0xf3, 0xe1, 0xd9, 0x55, 0x8a, 0x3b, 0xbf, 0x4a, 0x71, 0x97, 0x57, 0x29, 0xee, 0x4d, 0x37, + 0x15, 0x3a, 0xef, 0xa6, 0x42, 0x17, 0xdd, 0x54, 0xe8, 0xf1, 0x7f, 0xa6, 0xe5, 0xd5, 0x5b, 0x55, + 0xd9, 0x40, 0xb6, 0xc2, 0x3e, 0x09, 0xac, 0xaa, 0xb1, 0x62, 0x22, 0xa5, 0xbd, 0xa6, 0xd8, 0xa8, + 0xd6, 0x6a, 0x40, 0x4c, 0x2f, 0xfb, 0xbf, 0xfe, 0x59, 0x19, 0xfe, 0xe6, 0x38, 0x72, 0x21, 0xae, + 0x46, 0xc8, 0x85, 0xff, 0xf7, 0xa7, 0x00, 0x00, 0x00, 0xff, 0xff, 0x40, 0xb6, 0x94, 0x19, 0x97, + 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -644,10 +464,6 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { - // CreateChannel defines a rpc handler method for MsgCreateChannel - CreateChannel(ctx context.Context, in *MsgCreateChannel, opts ...grpc.CallOption) (*MsgCreateChannelResponse, error) - // RegisterCounterparty defines a rpc handler method for MsgRegisterCounterparty. - RegisterCounterparty(ctx context.Context, in *MsgRegisterCounterparty, opts ...grpc.CallOption) (*MsgRegisterCounterpartyResponse, error) // SendPacket defines a rpc handler method for MsgSendPacket. SendPacket(ctx context.Context, in *MsgSendPacket, opts ...grpc.CallOption) (*MsgSendPacketResponse, error) // RecvPacket defines a rpc handler method for MsgRecvPacket. @@ -666,24 +482,6 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } -func (c *msgClient) CreateChannel(ctx context.Context, in *MsgCreateChannel, opts ...grpc.CallOption) (*MsgCreateChannelResponse, error) { - out := new(MsgCreateChannelResponse) - err := c.cc.Invoke(ctx, "/ibc.core.channel.v2.Msg/CreateChannel", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) RegisterCounterparty(ctx context.Context, in *MsgRegisterCounterparty, opts ...grpc.CallOption) (*MsgRegisterCounterpartyResponse, error) { - out := new(MsgRegisterCounterpartyResponse) - err := c.cc.Invoke(ctx, "/ibc.core.channel.v2.Msg/RegisterCounterparty", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *msgClient) SendPacket(ctx context.Context, in *MsgSendPacket, opts ...grpc.CallOption) (*MsgSendPacketResponse, error) { out := new(MsgSendPacketResponse) err := c.cc.Invoke(ctx, "/ibc.core.channel.v2.Msg/SendPacket", in, out, opts...) @@ -722,10 +520,6 @@ func (c *msgClient) Acknowledgement(ctx context.Context, in *MsgAcknowledgement, // MsgServer is the server API for Msg service. type MsgServer interface { - // CreateChannel defines a rpc handler method for MsgCreateChannel - CreateChannel(context.Context, *MsgCreateChannel) (*MsgCreateChannelResponse, error) - // RegisterCounterparty defines a rpc handler method for MsgRegisterCounterparty. - RegisterCounterparty(context.Context, *MsgRegisterCounterparty) (*MsgRegisterCounterpartyResponse, error) // SendPacket defines a rpc handler method for MsgSendPacket. SendPacket(context.Context, *MsgSendPacket) (*MsgSendPacketResponse, error) // RecvPacket defines a rpc handler method for MsgRecvPacket. @@ -740,12 +534,6 @@ type MsgServer interface { type UnimplementedMsgServer struct { } -func (*UnimplementedMsgServer) CreateChannel(ctx context.Context, req *MsgCreateChannel) (*MsgCreateChannelResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateChannel not implemented") -} -func (*UnimplementedMsgServer) RegisterCounterparty(ctx context.Context, req *MsgRegisterCounterparty) (*MsgRegisterCounterpartyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterCounterparty not implemented") -} func (*UnimplementedMsgServer) SendPacket(ctx context.Context, req *MsgSendPacket) (*MsgSendPacketResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SendPacket not implemented") } @@ -763,42 +551,6 @@ func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) } -func _Msg_CreateChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgCreateChannel) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).CreateChannel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.channel.v2.Msg/CreateChannel", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CreateChannel(ctx, req.(*MsgCreateChannel)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_RegisterCounterparty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRegisterCounterparty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RegisterCounterparty(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.channel.v2.Msg/RegisterCounterparty", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RegisterCounterparty(ctx, req.(*MsgRegisterCounterparty)) - } - return interceptor(ctx, in, info, handler) -} - func _Msg_SendPacket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgSendPacket) if err := dec(in); err != nil { @@ -875,14 +627,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "ibc.core.channel.v2.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ - { - MethodName: "CreateChannel", - Handler: _Msg_CreateChannel_Handler, - }, - { - MethodName: "RegisterCounterparty", - Handler: _Msg_RegisterCounterparty_Handler, - }, { MethodName: "SendPacket", Handler: _Msg_SendPacket_Handler, @@ -904,7 +648,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Metadata: "ibc/core/channel/v2/tx.proto", } -func (m *MsgCreateChannel) Marshal() (dAtA []byte, err error) { +func (m *MsgSendPacket) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -914,12 +658,12 @@ func (m *MsgCreateChannel) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgCreateChannel) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSendPacket) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgCreateChannel) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgSendPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -929,29 +673,38 @@ func (m *MsgCreateChannel) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Signer) i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } - { - size, err := m.MerklePathPrefix.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Payloads) > 0 { + for iNdEx := len(m.Payloads) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Payloads[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x12 - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ClientId))) + if m.TimeoutTimestamp != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.TimeoutTimestamp)) + i-- + dAtA[i] = 0x10 + } + if len(m.SourceClient) > 0 { + i -= len(m.SourceClient) + copy(dAtA[i:], m.SourceClient) + i = encodeVarintTx(dAtA, i, uint64(len(m.SourceClient))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MsgCreateChannelResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgSendPacketResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -961,27 +714,25 @@ func (m *MsgCreateChannelResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgCreateChannelResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSendPacketResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgCreateChannelResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgSendPacketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ChannelId) > 0 { - i -= len(m.ChannelId) - copy(dAtA[i:], m.ChannelId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ChannelId))) + if m.Sequence != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Sequence)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *MsgRegisterCounterparty) Marshal() (dAtA []byte, err error) { +func (m *MsgRecvPacket) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -991,12 +742,12 @@ func (m *MsgRegisterCounterparty) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgRegisterCounterparty) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgRecvPacket) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgRegisterCounterparty) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgRecvPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1006,26 +757,39 @@ func (m *MsgRegisterCounterparty) MarshalToSizedBuffer(dAtA []byte) (int, error) copy(dAtA[i:], m.Signer) i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 + } + { + size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } - if len(m.CounterpartyChannelId) > 0 { - i -= len(m.CounterpartyChannelId) - copy(dAtA[i:], m.CounterpartyChannelId) - i = encodeVarintTx(dAtA, i, uint64(len(m.CounterpartyChannelId))) + i-- + dAtA[i] = 0x1a + if len(m.ProofCommitment) > 0 { + i -= len(m.ProofCommitment) + copy(dAtA[i:], m.ProofCommitment) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProofCommitment))) i-- dAtA[i] = 0x12 } - if len(m.ChannelId) > 0 { - i -= len(m.ChannelId) - copy(dAtA[i:], m.ChannelId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ChannelId))) - i-- - dAtA[i] = 0xa + { + size, err := m.Packet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *MsgRegisterCounterpartyResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgRecvPacketResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1035,20 +799,25 @@ func (m *MsgRegisterCounterpartyResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgRegisterCounterpartyResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgRecvPacketResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgRegisterCounterpartyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgRecvPacketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if m.Result != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Result)) + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } -func (m *MsgSendPacket) Marshal() (dAtA []byte, err error) { +func (m *MsgTimeout) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1058,12 +827,12 @@ func (m *MsgSendPacket) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgSendPacket) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgTimeout) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgSendPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgTimeout) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1073,191 +842,22 @@ func (m *MsgSendPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Signer) i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x2a } - if len(m.Payloads) > 0 { - for iNdEx := len(m.Payloads) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Payloads[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a + { + size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } - if m.TimeoutTimestamp != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.TimeoutTimestamp)) - i-- - dAtA[i] = 0x10 - } - if len(m.SourceClient) > 0 { - i -= len(m.SourceClient) - copy(dAtA[i:], m.SourceClient) - i = encodeVarintTx(dAtA, i, uint64(len(m.SourceClient))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgSendPacketResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgSendPacketResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSendPacketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sequence != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Sequence)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgRecvPacket) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgRecvPacket) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRecvPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x22 - } - { - size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.ProofCommitment) > 0 { - i -= len(m.ProofCommitment) - copy(dAtA[i:], m.ProofCommitment) - i = encodeVarintTx(dAtA, i, uint64(len(m.ProofCommitment))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Packet.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *MsgRecvPacketResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgRecvPacketResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRecvPacketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Result != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Result)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgTimeout) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgTimeout) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgTimeout) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x2a - } - { - size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.ProofUnreceived) > 0 { - i -= len(m.ProofUnreceived) - copy(dAtA[i:], m.ProofUnreceived) - i = encodeVarintTx(dAtA, i, uint64(len(m.ProofUnreceived))) + i-- + dAtA[i] = 0x1a + if len(m.ProofUnreceived) > 0 { + i -= len(m.ProofUnreceived) + copy(dAtA[i:], m.ProofUnreceived) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProofUnreceived))) i-- dAtA[i] = 0x12 } @@ -1408,68 +1008,6 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *MsgCreateChannel) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ClientId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = m.MerklePathPrefix.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgCreateChannelResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChannelId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgRegisterCounterparty) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChannelId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.CounterpartyChannelId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgRegisterCounterpartyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func (m *MsgSendPacket) Size() (n int) { if m == nil { return 0 @@ -1615,431 +1153,6 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MsgCreateChannel) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgCreateChannel: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateChannel: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ClientId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MerklePathPrefix", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.MerklePathPrefix.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgCreateChannelResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgCreateChannelResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateChannelResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChannelId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgRegisterCounterparty) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgRegisterCounterparty: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterCounterparty: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChannelId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyChannelId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.CounterpartyChannelId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgRegisterCounterpartyResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgRegisterCounterpartyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterCounterpartyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *MsgSendPacket) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/proto/ibc/core/channel/v2/channel.proto b/proto/ibc/core/channel/v2/channel.proto deleted file mode 100644 index f3ac209cdd9..00000000000 --- a/proto/ibc/core/channel/v2/channel.proto +++ /dev/null @@ -1,37 +0,0 @@ -syntax = "proto3"; - -package ibc.core.channel.v2; - -option go_package = "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types"; - -import "gogoproto/gogo.proto"; -import "ibc/core/commitment/v2/commitment.proto"; - -// Channel defines the channel end on a chain that is implementing the version 2 IBC protocol -// Each side will maintain its own Channel to create an IBC channel -// The channel will be referenced by a channelID which will be used to send packets -// to the counterparty -// The channel will contain the client identifier that will provide proof verification for the channel -// and the counterparty channel identifier that the other channel end will be using -// to send packets to our channel end. -message Channel { - // the client identifier of the light client representing the counterparty chain - string client_id = 1; - // the counterparty identifier that must be used by packets sent by counterparty - // to our channel end. - string counterparty_channel_id = 2; - // the key path used to store packet flow messages that the counterparty - // will use to send to us. In backwards compatible cases, we will append the channelID and sequence in order to create - // the final path. - ibc.core.commitment.v2.MerklePath merkle_path_prefix = 3 [(gogoproto.nullable) = false]; -} - -// IdentifiedChannel defines a channel with an additional channel identifier field. -message IdentifiedChannel { - option (gogoproto.goproto_getters) = false; - - // channel identified. - Channel channel = 1 [(gogoproto.nullable) = false]; - // channel identifier - string channel_id = 2; -} diff --git a/proto/ibc/core/channel/v2/genesis.proto b/proto/ibc/core/channel/v2/genesis.proto index f127481951d..cb32dca06ea 100644 --- a/proto/ibc/core/channel/v2/genesis.proto +++ b/proto/ibc/core/channel/v2/genesis.proto @@ -5,17 +5,13 @@ package ibc.core.channel.v2; option go_package = "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types"; import "gogoproto/gogo.proto"; -import "ibc/core/channel/v2/channel.proto"; // GenesisState defines the ibc channel/v2 submodule's genesis state. message GenesisState { - repeated IdentifiedChannel channels = 1 [(gogoproto.casttype) = "IdentifiedChannel", (gogoproto.nullable) = false]; - repeated PacketState acknowledgements = 2 [(gogoproto.nullable) = false]; - repeated PacketState commitments = 3 [(gogoproto.nullable) = false]; - repeated PacketState receipts = 4 [(gogoproto.nullable) = false]; - repeated PacketSequence send_sequences = 5 [(gogoproto.nullable) = false]; - // the sequence for the next generated channel identifier - uint64 next_channel_sequence = 6; + repeated PacketState acknowledgements = 2 [(gogoproto.nullable) = false]; + repeated PacketState commitments = 3 [(gogoproto.nullable) = false]; + repeated PacketState receipts = 4 [(gogoproto.nullable) = false]; + repeated PacketSequence send_sequences = 5 [(gogoproto.nullable) = false]; } // PacketState defines the generic type necessary to retrieve and store diff --git a/proto/ibc/core/channel/v2/query.proto b/proto/ibc/core/channel/v2/query.proto index 01f83d8bf6f..3efb9fcfe7d 100644 --- a/proto/ibc/core/channel/v2/query.proto +++ b/proto/ibc/core/channel/v2/query.proto @@ -5,32 +5,13 @@ package ibc.core.channel.v2; option go_package = "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types"; import "cosmos/base/query/v1beta1/pagination.proto"; -import "ibc/core/channel/v2/channel.proto"; import "ibc/core/channel/v2/genesis.proto"; import "ibc/core/client/v1/client.proto"; import "google/api/annotations.proto"; -import "google/protobuf/any.proto"; import "gogoproto/gogo.proto"; // Query provides defines the gRPC querier service service Query { - // Channel queries the counterparty of an IBC client. - rpc Channel(QueryChannelRequest) returns (QueryChannelResponse) { - option (google.api.http).get = "/ibc/core/channel/v2/channels/{channel_id}"; - } - - // ChannelClientState queries for the client state for the channel associated - // with the provided channel identifiers. - rpc ChannelClientState(QueryChannelClientStateRequest) returns (QueryChannelClientStateResponse) { - option (google.api.http).get = "/ibc/core/channel/v2/channels/{channel_id}/client_state"; - } - - // ChannelConsensusState queries for the consensus state for the channel associated - // with the provided channel identifiers. - rpc ChannelConsensusState(QueryChannelConsensusStateRequest) returns (QueryChannelConsensusStateResponse) { - option (google.api.http).get = "/ibc/core/channel/v2/channels/{channel_id}/consensus_state"; - } - // NextSequenceSend returns the next send sequence for a given channel. rpc NextSequenceSend(QueryNextSequenceSendRequest) returns (QueryNextSequenceSendResponse) { option (google.api.http).get = "/ibc/core/channel/v2/clients/{client_id}/next_sequence_send"; @@ -74,59 +55,6 @@ service Query { } } -// QueryChannelRequest is the request type for the Query/Channel RPC method -message QueryChannelRequest { - string channel_id = 1; -} - -// QueryChannelRequest is the response type for the Query/Channel RPC method -message QueryChannelResponse { - // the channel associated with the provided channel id - Channel channel = 1 [(gogoproto.nullable) = false]; -} - -// QueryChannelClientStateRequest is the request type for the Query/ClientState -// RPC method -message QueryChannelClientStateRequest { - // channel unique identifier - string channel_id = 1; -} - -// QueryChannelClientStateResponse is the Response type for the -// Query/QueryChannelClientState RPC method -message QueryChannelClientStateResponse { - // client state associated with the channel - ibc.core.client.v1.IdentifiedClientState identified_client_state = 1; - // merkle proof of existence - bytes proof = 2; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; -} - -// QueryChannelConsensusStateRequest is the request type for the Query/ConsensusState -// RPC method -message QueryChannelConsensusStateRequest { - // channel unique identifier - string channel_id = 1; - // revision number of the consensus state - uint64 revision_number = 2; - // revision height of the consensus state - uint64 revision_height = 3; -} - -// QueryChannelConsensusStateResponse is the Response type for the -// Query/QueryChannelConsensusState RPC method -message QueryChannelConsensusStateResponse { - // consensus state associated with the channel - google.protobuf.Any consensus_state = 1; - // client ID associated with the consensus state - string client_id = 2; - // merkle proof of existence - bytes proof = 3; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; -} - // QueryNextSequenceSendRequest is the request type for the Query/QueryNextSequenceSend RPC method message QueryNextSequenceSendRequest { // client unique identifier diff --git a/proto/ibc/core/channel/v2/tx.proto b/proto/ibc/core/channel/v2/tx.proto index 75ec4d45e39..6c3c224c2ea 100644 --- a/proto/ibc/core/channel/v2/tx.proto +++ b/proto/ibc/core/channel/v2/tx.proto @@ -8,18 +8,11 @@ import "gogoproto/gogo.proto"; import "cosmos/msg/v1/msg.proto"; import "ibc/core/channel/v2/packet.proto"; import "ibc/core/client/v1/client.proto"; -import "ibc/core/commitment/v2/commitment.proto"; // Msg defines the ibc/channel/v2 Msg service. service Msg { option (cosmos.msg.v1.service) = true; - // CreateChannel defines a rpc handler method for MsgCreateChannel - rpc CreateChannel(MsgCreateChannel) returns (MsgCreateChannelResponse); - - // RegisterCounterparty defines a rpc handler method for MsgRegisterCounterparty. - rpc RegisterCounterparty(MsgRegisterCounterparty) returns (MsgRegisterCounterpartyResponse); - // SendPacket defines a rpc handler method for MsgSendPacket. rpc SendPacket(MsgSendPacket) returns (MsgSendPacketResponse); @@ -33,46 +26,6 @@ service Msg { rpc Acknowledgement(MsgAcknowledgement) returns (MsgAcknowledgementResponse); } -// MsgCreateChannel defines the message used to create a v2 Channel. -message MsgCreateChannel { - option (cosmos.msg.v1.signer) = "signer"; - - option (gogoproto.goproto_getters) = false; - - // the client identifier of the light client representing the counterparty chain - string client_id = 1; - // the key path used to store packet flow messages that the counterparty - // will use to send to us. - ibc.core.commitment.v2.MerklePath merkle_path_prefix = 2 [(gogoproto.nullable) = false]; - // signer address - string signer = 3; -} - -// MsgCreateChannelResponse defines the Msg/CreateChannel response type. -message MsgCreateChannelResponse { - option (gogoproto.goproto_getters) = false; - - string channel_id = 1; -} - -// MsgRegisterCounterparty defines the message used to provide the counterparty channel -// identifier. -message MsgRegisterCounterparty { - option (cosmos.msg.v1.signer) = "signer"; - - option (gogoproto.goproto_getters) = false; - - // unique identifier we will use to write all packet messages sent to counterparty - string channel_id = 1; - // counterparty channel identifier - string counterparty_channel_id = 2; - // signer address - string signer = 3; -} - -// MsgRegisterCounterpartyResponse defines the Msg/RegisterCounterparty response type. -message MsgRegisterCounterpartyResponse {} - // MsgSendPacket sends an outgoing IBC packet. message MsgSendPacket { option (cosmos.msg.v1.signer) = "signer"; diff --git a/testing/endpoint_v2.go b/testing/endpoint_v2.go index 3e9671dff9b..cbde15f925c 100644 --- a/testing/endpoint_v2.go +++ b/testing/endpoint_v2.go @@ -10,25 +10,6 @@ import ( hostv2 "github.com/cosmos/ibc-go/v9/modules/core/24-host/v2" ) -// CreateChannel will construct and execute a new MsgCreateChannel on the associated endpoint. -func (endpoint *Endpoint) CreateChannel() (err error) { - endpoint.IncrementNextChannelSequence() - msg := channeltypesv2.NewMsgCreateChannel(endpoint.ClientID, endpoint.MerklePathPrefix, endpoint.Chain.SenderAccount.GetAddress().String()) - - // create channel - res, err := endpoint.Chain.SendMsgs(msg) - if err != nil { - return err - } - - endpoint.ChannelID, err = ParseChannelIDFromEvents(res.Events) - if err != nil { - return err - } - - return nil -} - // RegisterCounterparty will construct and execute a MsgRegisterCounterparty on the associated endpoint. func (endpoint *Endpoint) RegisterCounterparty() (err error) { msg := clienttypes.NewMsgRegisterCounterparty(endpoint.ClientID, endpoint.Counterparty.MerklePathPrefix.KeyPath, endpoint.Counterparty.ClientID, endpoint.Chain.SenderAccount.GetAddress().String()) diff --git a/testing/path.go b/testing/path.go index 823c4999839..a63cb3da563 100644 --- a/testing/path.go +++ b/testing/path.go @@ -160,8 +160,6 @@ func (path *Path) Setup() { func (path *Path) SetupV2() { path.SetupClients() - // path.CreateChannelsV2() - path.SetupCounterparties() } @@ -262,19 +260,6 @@ func (path *Path) CreateChannels() { } } -// CreateChannelsV2 initializes two channel endpoints by executing CreateChannel on both chainA and chainB. -func (path *Path) CreateChannelsV2() { - err := path.EndpointA.CreateChannel() - if err != nil { - panic(err) - } - - err = path.EndpointB.CreateChannel() - if err != nil { - panic(err) - } -} - // EnableFeeOnPath enables fee on a channel given a path. func EnableFeeOnPath(path *Path) *Path { path.EndpointA.ChannelConfig.Version = ibcmock.MockFeeVersion