From 5fdd3445780699ef7c060f8073d5b501bd6eaa11 Mon Sep 17 00:00:00 2001 From: DimitrisJim Date: Mon, 14 Oct 2024 12:37:39 +0300 Subject: [PATCH 1/3] chore: move tx's to channel/v2 (#7435) * chore: move tx's to channel/v2 * Use channel identifier when setting creator. --- e2e/testsuite/codec.go | 4 +- .../v2}/client/cli/cli.go | 0 .../v2}/client/cli/query.go | 2 +- .../v2}/client/cli/tx.go | 2 +- modules/core/04-channel/v2/keeper/events.go | 18 + .../v2}/keeper/grpc_query.go | 2 +- .../v2}/keeper/grpc_query_test.go | 14 +- modules/core/04-channel/v2/keeper/keeper.go | 23 + .../core/04-channel/v2/keeper/keeper_test.go | 45 + .../core/04-channel/v2/keeper/msg_server.go | 44 + .../04-channel/v2/keeper/msg_server_test.go | 71 ++ modules/core/04-channel/v2/keeper/packet.go | 15 +- .../v2}/module.go | 4 +- modules/core/04-channel/v2/types/codec.go | 2 + .../v2}/types/events.go | 0 modules/core/04-channel/v2/types/keys.go | 5 + .../v2}/types/merkle.go | 0 .../v2}/types/merkle_test.go | 24 +- modules/core/04-channel/v2/types/msgs.go | 70 ++ .../v2}/types/msgs_test.go | 23 +- .../v2}/types/query.pb.go | 76 +- .../v2}/types/query.pb.gw.go | 2 +- modules/core/04-channel/v2/types/tx.pb.go | 1013 ++++++++++++++- modules/core/client/cli/cli.go | 6 +- modules/core/keeper/msg_server.go | 46 - modules/core/keeper/msg_server_test.go | 69 -- modules/core/module.go | 5 - modules/core/packet-server/keeper/events.go | 25 - modules/core/packet-server/keeper/keeper.go | 23 - .../core/packet-server/keeper/keeper_test.go | 53 - modules/core/packet-server/keeper/relay.go | 7 +- modules/core/packet-server/types/codec.go | 15 - modules/core/packet-server/types/keys.go | 5 - modules/core/packet-server/types/msgs.go | 68 - modules/core/packet-server/types/tx.pb.go | 1091 ----------------- modules/core/types/codec.go | 2 - .../v1 => channel/v2}/query.proto | 6 +- proto/ibc/core/channel/v2/tx.proto | 48 + proto/ibc/core/packetserver/v1/tx.proto | 62 - testing/endpoint.go | 6 +- testing/events.go | 4 +- 41 files changed, 1373 insertions(+), 1627 deletions(-) rename modules/core/{packet-server => 04-channel/v2}/client/cli/cli.go (100%) rename modules/core/{packet-server => 04-channel/v2}/client/cli/query.go (95%) rename modules/core/{packet-server => 04-channel/v2}/client/cli/tx.go (95%) rename modules/core/{packet-server => 04-channel/v2}/keeper/grpc_query.go (95%) rename modules/core/{packet-server => 04-channel/v2}/keeper/grpc_query_test.go (78%) rename modules/core/{packet-server => 04-channel/v2}/module.go (75%) rename modules/core/{packet-server => 04-channel/v2}/types/events.go (100%) rename modules/core/{packet-server => 04-channel/v2}/types/merkle.go (100%) rename modules/core/{packet-server => 04-channel/v2}/types/merkle_test.go (78%) rename modules/core/{packet-server => 04-channel/v2}/types/msgs_test.go (81%) rename modules/core/{packet-server => 04-channel/v2}/types/query.pb.go (83%) rename modules/core/{packet-server => 04-channel/v2}/types/query.pb.gw.go (99%) delete mode 100644 modules/core/packet-server/keeper/events.go delete mode 100644 modules/core/packet-server/keeper/keeper_test.go delete mode 100644 modules/core/packet-server/types/codec.go delete mode 100644 modules/core/packet-server/types/msgs.go delete mode 100644 modules/core/packet-server/types/tx.pb.go rename proto/ibc/core/{packetserver/v1 => channel/v2}/query.proto (80%) delete mode 100644 proto/ibc/core/packetserver/v1/tx.proto diff --git a/e2e/testsuite/codec.go b/e2e/testsuite/codec.go index 5de0570cd18..cb90333b30a 100644 --- a/e2e/testsuite/codec.go +++ b/e2e/testsuite/codec.go @@ -32,7 +32,7 @@ import ( clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" connectiontypes "github.com/cosmos/ibc-go/v9/modules/core/03-connection/types" channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" - packetservertypes "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types" + channeltypesv2 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" solomachine "github.com/cosmos/ibc-go/v9/modules/light-clients/06-solomachine" ibctmtypes "github.com/cosmos/ibc-go/v9/modules/light-clients/07-tendermint" ibctesting "github.com/cosmos/ibc-go/v9/testing" @@ -70,7 +70,7 @@ func codecAndEncodingConfig() (*codec.ProtoCodec, testutil.TestEncodingConfig) { connectiontypes.RegisterInterfaces(cfg.InterfaceRegistry) ibctmtypes.RegisterInterfaces(cfg.InterfaceRegistry) wasmtypes.RegisterInterfaces(cfg.InterfaceRegistry) - packetservertypes.RegisterInterfaces(cfg.InterfaceRegistry) + channeltypesv2.RegisterInterfaces(cfg.InterfaceRegistry) // all other types upgradetypes.RegisterInterfaces(cfg.InterfaceRegistry) diff --git a/modules/core/packet-server/client/cli/cli.go b/modules/core/04-channel/v2/client/cli/cli.go similarity index 100% rename from modules/core/packet-server/client/cli/cli.go rename to modules/core/04-channel/v2/client/cli/cli.go diff --git a/modules/core/packet-server/client/cli/query.go b/modules/core/04-channel/v2/client/cli/query.go similarity index 95% rename from modules/core/packet-server/client/cli/query.go rename to modules/core/04-channel/v2/client/cli/query.go index 82e87400007..822284192b2 100644 --- a/modules/core/packet-server/client/cli/query.go +++ b/modules/core/04-channel/v2/client/cli/query.go @@ -9,8 +9,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/version" + "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" "github.com/cosmos/ibc-go/v9/modules/core/exported" - "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types" ) // getCmdQueryChannel defines the command to query the client information (creator and channel) for the given client ID. diff --git a/modules/core/packet-server/client/cli/tx.go b/modules/core/04-channel/v2/client/cli/tx.go similarity index 95% rename from modules/core/packet-server/client/cli/tx.go rename to modules/core/04-channel/v2/client/cli/tx.go index a1180c24b87..746012fcb32 100644 --- a/modules/core/packet-server/client/cli/tx.go +++ b/modules/core/04-channel/v2/client/cli/tx.go @@ -10,8 +10,8 @@ import ( "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" "github.com/cosmos/ibc-go/v9/modules/core/exported" - "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types" ) // newProvideCounterpartyCmd defines the command to provide the counterparty to an IBC channel. diff --git a/modules/core/04-channel/v2/keeper/events.go b/modules/core/04-channel/v2/keeper/events.go index 9d90ff5b36e..061826315e0 100644 --- a/modules/core/04-channel/v2/keeper/events.go +++ b/modules/core/04-channel/v2/keeper/events.go @@ -3,6 +3,8 @@ package keeper import ( "context" + sdk "github.com/cosmos/cosmos-sdk/types" + channeltypesv2 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" ) @@ -25,3 +27,19 @@ func EmitAcknowledgePacketEvents(ctx context.Context, packet channeltypesv2.Pack func EmitTimeoutPacketEvents(ctx context.Context, packet channeltypesv2.Packet) { // TODO: https://github.com/cosmos/ibc-go/issues/7386 } + +// EmitCreateChannelEvent emits a channel create event. +func (*Keeper) EmitCreateChannelEvent(ctx context.Context, channelID string) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + sdkCtx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + channeltypesv2.EventTypeCreateChannel, + sdk.NewAttribute(channeltypesv2.AttributeKeyChannelID, channelID), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, channeltypesv2.AttributeValueCategory), + ), + }) +} diff --git a/modules/core/packet-server/keeper/grpc_query.go b/modules/core/04-channel/v2/keeper/grpc_query.go similarity index 95% rename from modules/core/packet-server/keeper/grpc_query.go rename to modules/core/04-channel/v2/keeper/grpc_query.go index bc0182180bf..fde351da818 100644 --- a/modules/core/packet-server/keeper/grpc_query.go +++ b/modules/core/04-channel/v2/keeper/grpc_query.go @@ -10,8 +10,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" host "github.com/cosmos/ibc-go/v9/modules/core/24-host" - "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types" ) var _ types.QueryServer = (*queryServer)(nil) diff --git a/modules/core/packet-server/keeper/grpc_query_test.go b/modules/core/04-channel/v2/keeper/grpc_query_test.go similarity index 78% rename from modules/core/packet-server/keeper/grpc_query_test.go rename to modules/core/04-channel/v2/keeper/grpc_query_test.go index 79a2987c789..ad50fe3c6ba 100644 --- a/modules/core/packet-server/keeper/grpc_query_test.go +++ b/modules/core/04-channel/v2/keeper/grpc_query_test.go @@ -6,9 +6,9 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/keeper" + "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" commitmenttypes "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types" - "github.com/cosmos/ibc-go/v9/modules/core/packet-server/keeper" - "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types" ibctesting "github.com/cosmos/ibc-go/v9/testing" ) @@ -28,8 +28,8 @@ func (suite *KeeperTestSuite) TestQueryChannel() { "success", func() { ctx := suite.chainA.GetContext() - suite.chainA.App.GetIBCKeeper().PacketServerKeeper.SetCreator(ctx, ibctesting.FirstChannelID, expCreator) - suite.chainA.App.GetIBCKeeper().PacketServerKeeper.SetChannel(ctx, ibctesting.FirstChannelID, expChannel) + suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.SetCreator(ctx, ibctesting.FirstChannelID, expCreator) + suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.SetChannel(ctx, ibctesting.FirstChannelID, expChannel) req = &types.QueryChannelRequest{ ChannelId: ibctesting.FirstChannelID, @@ -42,7 +42,7 @@ func (suite *KeeperTestSuite) TestQueryChannel() { func() { expCreator = "" - suite.chainA.App.GetIBCKeeper().PacketServerKeeper.SetChannel(suite.chainA.GetContext(), ibctesting.FirstChannelID, expChannel) + suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.SetChannel(suite.chainA.GetContext(), ibctesting.FirstChannelID, expChannel) req = &types.QueryChannelRequest{ ChannelId: ibctesting.FirstChannelID, @@ -55,7 +55,7 @@ func (suite *KeeperTestSuite) TestQueryChannel() { func() { expChannel = types.Channel{} - suite.chainA.App.GetIBCKeeper().PacketServerKeeper.SetCreator(suite.chainA.GetContext(), ibctesting.FirstChannelID, expCreator) + suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.SetCreator(suite.chainA.GetContext(), ibctesting.FirstChannelID, expCreator) req = &types.QueryChannelRequest{ ChannelId: ibctesting.FirstChannelID, @@ -100,7 +100,7 @@ func (suite *KeeperTestSuite) TestQueryChannel() { tc.malleate() - queryServer := keeper.NewQueryServer(suite.chainA.GetSimApp().IBCKeeper.PacketServerKeeper) + queryServer := keeper.NewQueryServer(suite.chainA.GetSimApp().IBCKeeper.ChannelKeeperV2) res, err := queryServer.Channel(suite.chainA.GetContext(), req) expPass := tc.expError == nil diff --git a/modules/core/04-channel/v2/keeper/keeper.go b/modules/core/04-channel/v2/keeper/keeper.go index 0d2d00a6da9..7cb64278ff8 100644 --- a/modules/core/04-channel/v2/keeper/keeper.go +++ b/modules/core/04-channel/v2/keeper/keeper.go @@ -79,6 +79,29 @@ func (k *Keeper) GetChannel(ctx context.Context, channelID string) (types.Channe return channel, true } +// GetCreator returns the creator of the client. +func (k *Keeper) GetCreator(ctx context.Context, clientID string) (string, bool) { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + bz := k.ChannelStore(sdkCtx, clientID).Get([]byte(types.CreatorKey)) + if len(bz) == 0 { + return "", false + } + + return string(bz), true +} + +// SetCreator sets the creator of the client. +func (k *Keeper) SetCreator(ctx context.Context, clientID, creator string) { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + k.ChannelStore(sdkCtx, clientID).Set([]byte(types.CreatorKey), []byte(creator)) +} + +// DeleteCreator deletes the creator associated with the client. +func (k *Keeper) DeleteCreator(ctx context.Context, clientID string) { + sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 + k.ChannelStore(sdkCtx, clientID).Delete([]byte(types.CreatorKey)) +} + // GetPacketReceipt returns the packet receipt from the packet receipt path based on the channelID and sequence. func (k *Keeper) GetPacketReceipt(ctx context.Context, channelID string, sequence uint64) ([]byte, bool) { store := k.storeService.OpenKVStore(ctx) diff --git a/modules/core/04-channel/v2/keeper/keeper_test.go b/modules/core/04-channel/v2/keeper/keeper_test.go index 80363d813d7..93580d13d77 100644 --- a/modules/core/04-channel/v2/keeper/keeper_test.go +++ b/modules/core/04-channel/v2/keeper/keeper_test.go @@ -7,6 +7,7 @@ import ( "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" ) @@ -107,3 +108,47 @@ func (suite *KeeperTestSuite) TestAliasV1Channel() { }) } } + +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") + + // Channel not yet stored for another client. + retrievedChannel, found = suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.GetChannel(suite.chainA.GetContext(), ibctesting.SecondClientID) + suite.Require().False(found, "GetChannel unexpectedly returned a channel") + suite.Require().Equal(channeltypes2.Channel{}, retrievedChannel, "Channel retrieved not empty") +} + +func (suite *KeeperTestSuite) TestSetCreator() { + clientID := ibctesting.FirstClientID + expectedCreator := "test-creator" + + // Set the creator for the client + suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.SetCreator(suite.chainA.GetContext(), clientID, expectedCreator) + + // Retrieve the creator from the store + retrievedCreator, found := suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.GetCreator(suite.chainA.GetContext(), clientID) + + // 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 non stored creator is not found + retrievedCreator, found = suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.GetCreator(suite.chainA.GetContext(), ibctesting.SecondClientID) + suite.Require().False(found, "GetCreator unexpectedly returned a creator") + suite.Require().Empty(retrievedCreator, "Creator is not empty") + + // Verify that the creator is deleted from the store + suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.DeleteCreator(suite.chainA.GetContext(), clientID) + retrievedCreator, found = suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.GetCreator(suite.chainA.GetContext(), clientID) + 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 740ebb02daa..d86b87e3432 100644 --- a/modules/core/04-channel/v2/keeper/msg_server.go +++ b/modules/core/04-channel/v2/keeper/msg_server.go @@ -9,6 +9,7 @@ import ( channeltypesv1 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" channeltypesv2 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" + ibcerrors "github.com/cosmos/ibc-go/v9/modules/core/errors" ) var _ channeltypesv2.MsgServer = &Keeper{} @@ -135,3 +136,46 @@ func (k *Keeper) Timeout(ctx context.Context, timeout *channeltypesv2.MsgTimeout return &channeltypesv2.MsgTimeoutResponse{Result: channeltypesv1.SUCCESS}, nil } + +// CreateChannel defines a rpc handler method for MsgCreateChannel +func (k *Keeper) CreateChannel(goCtx context.Context, msg *channeltypesv2.MsgCreateChannel) (*channeltypesv2.MsgCreateChannelResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + channelID := k.channelKeeperV1.GenerateChannelIdentifier(ctx) + + // Initialize channel with empty counterparty channel identifier. + channel := channeltypesv2.NewChannel(msg.ClientId, "", msg.MerklePathPrefix) + k.SetChannel(ctx, channelID, channel) + + k.SetCreator(ctx, channelID, msg.Signer) + + k.EmitCreateChannelEvent(goCtx, channelID) + + return &channeltypesv2.MsgCreateChannelResponse{ChannelId: channelID}, nil +} + +// ProvideCounterparty defines a rpc handler method for MsgProvideCounterparty. +func (k *Keeper) ProvideCounterparty(goCtx context.Context, msg *channeltypesv2.MsgProvideCounterparty) (*channeltypesv2.MsgProvideCounterpartyResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + 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, ok := k.GetChannel(ctx, msg.ChannelId) + if !ok { + return nil, errorsmod.Wrapf(channeltypesv2.ErrInvalidChannel, "channel must exist for channel id %s", msg.ChannelId) + } + + 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) + + return &channeltypesv2.MsgProvideCounterpartyResponse{}, nil +} 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 1f4aabd1c86..4fd61d3f2e3 100644 --- a/modules/core/04-channel/v2/keeper/msg_server_test.go +++ b/modules/core/04-channel/v2/keeper/msg_server_test.go @@ -9,6 +9,7 @@ import ( clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" channeltypesv1 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" channeltypesv2 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/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" @@ -111,3 +112,73 @@ func (suite *KeeperTestSuite) TestMsgSendPacket() { }) } } + +func (suite *KeeperTestSuite) TestProvideCounterparty() { + var ( + path *ibctesting.Path + msg *channeltypesv2.MsgProvideCounterparty + ) + 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, channeltypesv2.NewChannel(path.EndpointA.ClientID, "", ibctesting.MerklePath)) + }, + nil, + }, + + { + "failure: signer does not match creator", + func() { + msg.Signer = path.EndpointB.Chain.SenderAccount.GetAddress().String() + }, + ibcerrors.ErrUnauthorized, + }, + /* // Account sequence mismatch, expected 5, got 6. :thinking: + { + "failure: counterparty does not already exists", + func() { + suite.chainA.App.GetIBCKeeper().ChannelKeeperV2.ChannelStore(suite.chainA.GetContext(), path.EndpointA.ChannelID).Delete([]byte(channeltypesv2.ChannelKey)) + }, + channeltypesv2.ErrInvalidChannel, + }, + */ + } + + for _, tc := range cases { + tc := tc + 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 = channeltypesv2.NewMsgProvideCounterparty(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.ClientID) + suite.Require().False(found) + } else { + suite.Require().Error(err) + } + } +} diff --git a/modules/core/04-channel/v2/keeper/packet.go b/modules/core/04-channel/v2/keeper/packet.go index a3ac7e3401e..360b1611de6 100644 --- a/modules/core/04-channel/v2/keeper/packet.go +++ b/modules/core/04-channel/v2/keeper/packet.go @@ -14,7 +14,6 @@ import ( channeltypesv2 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" hostv2 "github.com/cosmos/ibc-go/v9/modules/core/24-host/v2" "github.com/cosmos/ibc-go/v9/modules/core/exported" - "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types" ) // sendPacket constructs a packet from the input arguments, writes a packet commitment to state @@ -31,7 +30,7 @@ func (k *Keeper) sendPacket( // TODO: figure out how aliasing will work when more than one packet data is sent. channel, ok = k.convertV1Channel(ctx, data[0].SourcePort, sourceChannel) if !ok { - return 0, "", errorsmod.Wrap(types.ErrChannelNotFound, sourceChannel) + return 0, "", errorsmod.Wrap(channeltypesv2.ErrChannelNotFound, sourceChannel) } } @@ -107,7 +106,7 @@ func (k *Keeper) recvPacket( // TODO: figure out how aliasing will work when more than one packet data is sent. channel, ok = k.convertV1Channel(ctx, packet.Data[0].DestinationPort, packet.DestinationChannel) if !ok { - return errorsmod.Wrap(types.ErrChannelNotFound, packet.DestinationChannel) + return errorsmod.Wrap(channeltypesv2.ErrChannelNotFound, packet.DestinationChannel) } } if channel.CounterpartyChannelId != packet.SourceChannel { @@ -135,7 +134,7 @@ func (k *Keeper) recvPacket( } path := hostv2.PacketCommitmentKey(packet.SourceChannel, packet.Sequence) - merklePath := types.BuildMerklePath(channel.MerklePathPrefix, path) + merklePath := channeltypesv2.BuildMerklePath(channel.MerklePathPrefix, path) commitment := channeltypesv2.CommitPacket(packet) @@ -166,7 +165,7 @@ func (k *Keeper) acknowledgePacket(ctx context.Context, packet channeltypesv2.Pa // that the packet was indeed sent by our counterparty. channel, ok := k.GetChannel(ctx, packet.SourceChannel) if !ok { - return errorsmod.Wrap(types.ErrChannelNotFound, packet.SourceChannel) + return errorsmod.Wrap(channeltypesv2.ErrChannelNotFound, packet.SourceChannel) } if channel.CounterpartyChannelId != packet.DestinationChannel { @@ -194,7 +193,7 @@ func (k *Keeper) acknowledgePacket(ctx context.Context, packet channeltypesv2.Pa } path := hostv2.PacketAcknowledgementKey(packet.DestinationChannel, packet.Sequence) - merklePath := types.BuildMerklePath(channel.MerklePathPrefix, path) + merklePath := channeltypesv2.BuildMerklePath(channel.MerklePathPrefix, path) if err := k.ClientKeeper.VerifyMembership( ctx, @@ -237,7 +236,7 @@ func (k *Keeper) timeoutPacket( // TODO: figure out how aliasing will work when more than one packet data is sent. channel, ok = k.convertV1Channel(ctx, packet.Data[0].SourcePort, packet.SourceChannel) if !ok { - return errorsmod.Wrap(types.ErrChannelNotFound, packet.DestinationChannel) + return errorsmod.Wrap(channeltypesv2.ErrChannelNotFound, packet.DestinationChannel) } } if channel.CounterpartyChannelId != packet.DestinationChannel { @@ -275,7 +274,7 @@ func (k *Keeper) timeoutPacket( // verify packet receipt absence path := hostv2.PacketReceiptKey(packet.SourceChannel, packet.Sequence) - merklePath := types.BuildMerklePath(channel.MerklePathPrefix, path) + merklePath := channeltypesv2.BuildMerklePath(channel.MerklePathPrefix, path) if err := k.ClientKeeper.VerifyNonMembership( ctx, diff --git a/modules/core/packet-server/module.go b/modules/core/04-channel/v2/module.go similarity index 75% rename from modules/core/packet-server/module.go rename to modules/core/04-channel/v2/module.go index c695542ca50..9bc3ad94699 100644 --- a/modules/core/packet-server/module.go +++ b/modules/core/04-channel/v2/module.go @@ -3,8 +3,8 @@ package client import ( "github.com/spf13/cobra" - "github.com/cosmos/ibc-go/v9/modules/core/packet-server/client/cli" - "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types" + "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/client/cli" + "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" ) // Name returns the IBC client name diff --git a/modules/core/04-channel/v2/types/codec.go b/modules/core/04-channel/v2/types/codec.go index 1053c8b64d6..79941f59175 100644 --- a/modules/core/04-channel/v2/types/codec.go +++ b/modules/core/04-channel/v2/types/codec.go @@ -14,5 +14,7 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { &MsgRecvPacket{}, &MsgTimeout{}, &MsgAcknowledgement{}, + &MsgCreateChannel{}, + &MsgProvideCounterparty{}, ) } diff --git a/modules/core/packet-server/types/events.go b/modules/core/04-channel/v2/types/events.go similarity index 100% rename from modules/core/packet-server/types/events.go rename to modules/core/04-channel/v2/types/events.go diff --git a/modules/core/04-channel/v2/types/keys.go b/modules/core/04-channel/v2/types/keys.go index 965f010716e..af3f68c5449 100644 --- a/modules/core/04-channel/v2/types/keys.go +++ b/modules/core/04-channel/v2/types/keys.go @@ -8,4 +8,9 @@ const ( // the channel key is imported from types instead of host because // the channel key is not a part of the ics-24 host specification ChannelKey = "channel" + + // CreatorKey is the key used to store the client creator in the client store + // the creator key is imported from types instead of host because + // the creator key is not a part of the ics-24 host specification + CreatorKey = "creator" ) diff --git a/modules/core/packet-server/types/merkle.go b/modules/core/04-channel/v2/types/merkle.go similarity index 100% rename from modules/core/packet-server/types/merkle.go rename to modules/core/04-channel/v2/types/merkle.go diff --git a/modules/core/packet-server/types/merkle_test.go b/modules/core/04-channel/v2/types/merkle_test.go similarity index 78% rename from modules/core/packet-server/types/merkle_test.go rename to modules/core/04-channel/v2/types/merkle_test.go index 46c75dd2303..8990d05a83d 100644 --- a/modules/core/packet-server/types/merkle_test.go +++ b/modules/core/04-channel/v2/types/merkle_test.go @@ -1,35 +1,13 @@ package types_test import ( - "testing" - - "github.com/stretchr/testify/suite" - + "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" commitmenttypes "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" - "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types" ibctesting "github.com/cosmos/ibc-go/v9/testing" ) -type TypesTestSuite struct { - suite.Suite - - coordinator *ibctesting.Coordinator - chainA *ibctesting.TestChain - chainB *ibctesting.TestChain -} - -func (s *TypesTestSuite) SetupTest() { - s.coordinator = ibctesting.NewCoordinator(s.T(), 2) - s.chainA = s.coordinator.GetChain(ibctesting.GetChainID(1)) - s.chainB = s.coordinator.GetChain(ibctesting.GetChainID(2)) -} - -func TestTypesTestSuite(t *testing.T) { - suite.Run(t, new(TypesTestSuite)) -} - func (s *TypesTestSuite) TestBuildMerklePath() { path := ibctesting.NewPath(s.chainA, s.chainB) path.SetupV2() diff --git a/modules/core/04-channel/v2/types/msgs.go b/modules/core/04-channel/v2/types/msgs.go index f2b52aaf802..936157cc5c7 100644 --- a/modules/core/04-channel/v2/types/msgs.go +++ b/modules/core/04-channel/v2/types/msgs.go @@ -1,5 +1,75 @@ package types +import ( + errorsmod "cosmossdk.io/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + + commitmenttypes "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" +) + +var ( + _ sdk.Msg = (*MsgProvideCounterparty)(nil) + _ sdk.HasValidateBasic = (*MsgProvideCounterparty)(nil) + + _ sdk.Msg = (*MsgCreateChannel)(nil) + _ sdk.HasValidateBasic = (*MsgCreateChannel)(nil) +) + +// NewMsgProvideCounterparty creates a new MsgProvideCounterparty instance +func NewMsgProvideCounterparty(channelID, counterpartyChannelID string, signer string) *MsgProvideCounterparty { + return &MsgProvideCounterparty{ + Signer: signer, + ChannelId: channelID, + CounterpartyChannelId: counterpartyChannelID, + } +} + +// ValidateBasic performs basic checks on a MsgProvideCounterparty. +func (msg *MsgProvideCounterparty) 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 +} + +// NewMsgCreateChannel creates a new MsgCreateChannel instance +func NewMsgCreateChannel(clientID string, merklePathPrefix commitmenttypes.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 +} + // NewMsgSendPacket creates a new MsgSendPacket instance. func NewMsgSendPacket(sourceChannel string, timeoutTimestamp uint64, signer string, packetData ...PacketData) *MsgSendPacket { return &MsgSendPacket{ diff --git a/modules/core/packet-server/types/msgs_test.go b/modules/core/04-channel/v2/types/msgs_test.go similarity index 81% rename from modules/core/packet-server/types/msgs_test.go rename to modules/core/04-channel/v2/types/msgs_test.go index c6af4cf8684..48ce0d511a1 100644 --- a/modules/core/packet-server/types/msgs_test.go +++ b/modules/core/04-channel/v2/types/msgs_test.go @@ -2,14 +2,35 @@ package types_test import ( "errors" + "testing" + "github.com/stretchr/testify/suite" + + "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" commitmenttypes "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types" host "github.com/cosmos/ibc-go/v9/modules/core/24-host" ibcerrors "github.com/cosmos/ibc-go/v9/modules/core/errors" - "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types" ibctesting "github.com/cosmos/ibc-go/v9/testing" ) +type TypesTestSuite struct { + suite.Suite + + coordinator *ibctesting.Coordinator + chainA *ibctesting.TestChain + chainB *ibctesting.TestChain +} + +func (s *TypesTestSuite) SetupTest() { + s.coordinator = ibctesting.NewCoordinator(s.T(), 2) + s.chainA = s.coordinator.GetChain(ibctesting.GetChainID(1)) + s.chainB = s.coordinator.GetChain(ibctesting.GetChainID(2)) +} + +func TestTypesTestSuite(t *testing.T) { + suite.Run(t, new(TypesTestSuite)) +} + // TestMsgProvideCounterpartyValidateBasic tests ValidateBasic for MsgProvideCounterparty func (s *TypesTestSuite) TestMsgProvideCounterpartyValidateBasic() { var msg *types.MsgProvideCounterparty diff --git a/modules/core/packet-server/types/query.pb.go b/modules/core/04-channel/v2/types/query.pb.go similarity index 83% rename from modules/core/packet-server/types/query.pb.go rename to modules/core/04-channel/v2/types/query.pb.go index 694ab5b79ba..04c4360c60d 100644 --- a/modules/core/packet-server/types/query.pb.go +++ b/modules/core/04-channel/v2/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ibc/core/packetserver/v1/query.proto +// source: ibc/core/channel/v2/query.proto package types @@ -38,7 +38,7 @@ 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_7ac0ae50eee8e6db, []int{0} + return fileDescriptor_a328cba4986edcab, []int{0} } func (m *QueryChannelRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -84,7 +84,7 @@ 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_7ac0ae50eee8e6db, []int{1} + return fileDescriptor_a328cba4986edcab, []int{1} } func (m *QueryChannelResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -128,38 +128,36 @@ func (m *QueryChannelResponse) GetChannel() Channel { } func init() { - proto.RegisterType((*QueryChannelRequest)(nil), "ibc.core.packetserver.v1.QueryChannelRequest") - proto.RegisterType((*QueryChannelResponse)(nil), "ibc.core.packetserver.v1.QueryChannelResponse") -} - -func init() { - proto.RegisterFile("ibc/core/packetserver/v1/query.proto", fileDescriptor_7ac0ae50eee8e6db) -} - -var fileDescriptor_7ac0ae50eee8e6db = []byte{ - // 351 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x31, 0x4b, 0x03, 0x31, - 0x14, 0xc7, 0x2f, 0x45, 0x2d, 0x8d, 0x5b, 0xec, 0x70, 0x14, 0x3d, 0x6b, 0x11, 0xa9, 0x48, 0x13, - 0x5a, 0x5d, 0x04, 0x17, 0xeb, 0xe4, 0x68, 0x07, 0x07, 0x17, 0xb9, 0x4b, 0xc3, 0xf5, 0xb0, 0xbd, - 0x77, 0x4d, 0x72, 0x07, 0x45, 0x5c, 0xfc, 0x04, 0x82, 0xa3, 0xb3, 0xdf, 0xa5, 0x63, 0xc1, 0xc5, - 0x49, 0xa4, 0xf5, 0x83, 0xc8, 0xf5, 0xd2, 0x5a, 0xc1, 0x03, 0xb7, 0x97, 0x97, 0xff, 0xff, 0x97, - 0xf7, 0xf2, 0xc7, 0xfb, 0x81, 0xc7, 0x19, 0x07, 0x29, 0x58, 0xe4, 0xf2, 0x3b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6, 0x43, 0xfb, 0x7a, 0x3c, 0x75, 0xd0, 0x64, 0xea, 0xa0, 0xcf, 0xa9, 0x83, - 0x9e, 0x66, 0x8e, 0x35, 0x99, 0x39, 0xd6, 0xfb, 0xcc, 0xb1, 0x6e, 0xce, 0xfc, 0x40, 0xf7, 0x62, - 0x8f, 0x72, 0x18, 0x30, 0x0e, 0x6a, 0x00, 0x2a, 0xa5, 0x36, 0x7c, 0x60, 0xc9, 0x29, 0x1b, 0x40, - 0x37, 0xee, 0x0b, 0xb5, 0x1a, 0x74, 0xc3, 0x24, 0xad, 0x47, 0x91, 0x50, 0xde, 0xc6, 0x3c, 0xb1, - 0xe3, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5b, 0xe3, 0xea, 0xfa, 0x4f, 0x02, 0x00, 0x00, + proto.RegisterType((*QueryChannelRequest)(nil), "ibc.core.channel.v2.QueryChannelRequest") + proto.RegisterType((*QueryChannelResponse)(nil), "ibc.core.channel.v2.QueryChannelResponse") +} + +func init() { proto.RegisterFile("ibc/core/channel/v2/query.proto", fileDescriptor_a328cba4986edcab) } + +var fileDescriptor_a328cba4986edcab = []byte{ + // 339 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcf, 0x4c, 0x4a, 0xd6, + 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0x4f, 0xce, 0x48, 0xcc, 0xcb, 0x4b, 0xcd, 0xd1, 0x2f, 0x33, 0xd2, + 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xce, 0x4c, 0x4a, + 0xd6, 0x03, 0x29, 0xd0, 0x83, 0x2a, 0xd0, 0x2b, 0x33, 0x92, 0x52, 0xc4, 0xa6, 0x0b, 0x26, 0x0f, + 0xd6, 0x27, 0x25, 0x93, 0x9e, 0x9f, 0x9f, 0x9e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, + 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, + 0x10, 0x65, 0x93, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x9f, 0x9c, 0x5f, + 0x9c, 0x9b, 0x5f, 0x0c, 0x32, 0x55, 0x37, 0x3d, 0x5f, 0xbf, 0xcc, 0x52, 0x3f, 0x37, 0x3f, 0xa5, + 0x34, 0x27, 0xb5, 0x18, 0x62, 0x87, 0x81, 0x89, 0x2e, 0x92, 0x35, 0x25, 0x95, 0x05, 0xa9, 0xc5, + 0x49, 0x6c, 0xe0, 0x28, 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x3d, 0x69, 0x95, 0xfc, 0x31, + 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -188,7 +186,7 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { func (c *queryClient) Channel(ctx context.Context, in *QueryChannelRequest, opts ...grpc.CallOption) (*QueryChannelResponse, error) { out := new(QueryChannelResponse) - err := c.cc.Invoke(ctx, "/ibc.core.packetserver.v1.Query/Channel", in, out, opts...) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v2.Query/Channel", in, out, opts...) if err != nil { return nil, err } @@ -223,7 +221,7 @@ func _Query_Channel_Handler(srv interface{}, ctx context.Context, dec func(inter } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ibc.core.packetserver.v1.Query/Channel", + FullMethod: "/ibc.core.channel.v2.Query/Channel", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Channel(ctx, req.(*QueryChannelRequest)) @@ -232,7 +230,7 @@ func _Query_Channel_Handler(srv interface{}, ctx context.Context, dec func(inter } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "ibc.core.packetserver.v1.Query", + ServiceName: "ibc.core.channel.v2.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { @@ -241,7 +239,7 @@ var _Query_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "ibc/core/packetserver/v1/query.proto", + Metadata: "ibc/core/channel/v2/query.proto", } func (m *QueryChannelRequest) Marshal() (dAtA []byte, err error) { diff --git a/modules/core/packet-server/types/query.pb.gw.go b/modules/core/04-channel/v2/types/query.pb.gw.go similarity index 99% rename from modules/core/packet-server/types/query.pb.gw.go rename to modules/core/04-channel/v2/types/query.pb.gw.go index caea72e9575..6ed5d7819e6 100644 --- a/modules/core/packet-server/types/query.pb.gw.go +++ b/modules/core/04-channel/v2/types/query.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: ibc/core/packetserver/v1/query.proto +// source: ibc/core/channel/v2/query.proto /* Package types is a reverse proxy. diff --git a/modules/core/04-channel/v2/types/tx.pb.go b/modules/core/04-channel/v2/types/tx.pb.go index 0532c9c4c4a..b8b915f78bc 100644 --- a/modules/core/04-channel/v2/types/tx.pb.go +++ b/modules/core/04-channel/v2/types/tx.pb.go @@ -12,6 +12,7 @@ import ( proto "github.com/cosmos/gogoproto/proto" types "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" types1 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/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" @@ -349,6 +350,170 @@ func (m *MsgAcknowledgementResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAcknowledgementResponse proto.InternalMessageInfo +// MsgProvideCounterparty defines the message used to provide the counterparty client +// identifier. Can only be invoked one time by the signer of MsgCreateClient if the counterparty +// client identifier was not provided in the initial MsgCreateClient message. +type MsgProvideCounterparty 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 *MsgProvideCounterparty) Reset() { *m = MsgProvideCounterparty{} } +func (m *MsgProvideCounterparty) String() string { return proto.CompactTextString(m) } +func (*MsgProvideCounterparty) ProtoMessage() {} +func (*MsgProvideCounterparty) Descriptor() ([]byte, []int) { + return fileDescriptor_d421c7119e969b99, []int{8} +} +func (m *MsgProvideCounterparty) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgProvideCounterparty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgProvideCounterparty.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 *MsgProvideCounterparty) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgProvideCounterparty.Merge(m, src) +} +func (m *MsgProvideCounterparty) XXX_Size() int { + return m.Size() +} +func (m *MsgProvideCounterparty) XXX_DiscardUnknown() { + xxx_messageInfo_MsgProvideCounterparty.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgProvideCounterparty proto.InternalMessageInfo + +// MsgProvideCounterpartyResponse defines the Msg/ProvideCounterparty response type. +type MsgProvideCounterpartyResponse struct { +} + +func (m *MsgProvideCounterpartyResponse) Reset() { *m = MsgProvideCounterpartyResponse{} } +func (m *MsgProvideCounterpartyResponse) String() string { return proto.CompactTextString(m) } +func (*MsgProvideCounterpartyResponse) ProtoMessage() {} +func (*MsgProvideCounterpartyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d421c7119e969b99, []int{9} +} +func (m *MsgProvideCounterpartyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgProvideCounterpartyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgProvideCounterpartyResponse.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 *MsgProvideCounterpartyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgProvideCounterpartyResponse.Merge(m, src) +} +func (m *MsgProvideCounterpartyResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgProvideCounterpartyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgProvideCounterpartyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgProvideCounterpartyResponse proto.InternalMessageInfo + +// 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{10} +} +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{11} +} +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 + func init() { proto.RegisterType((*MsgSendPacket)(nil), "ibc.core.channel.v2.MsgSendPacket") proto.RegisterType((*MsgSendPacketResponse)(nil), "ibc.core.channel.v2.MsgSendPacketResponse") @@ -358,58 +523,73 @@ func init() { proto.RegisterType((*MsgTimeoutResponse)(nil), "ibc.core.channel.v2.MsgTimeoutResponse") proto.RegisterType((*MsgAcknowledgement)(nil), "ibc.core.channel.v2.MsgAcknowledgement") proto.RegisterType((*MsgAcknowledgementResponse)(nil), "ibc.core.channel.v2.MsgAcknowledgementResponse") + proto.RegisterType((*MsgProvideCounterparty)(nil), "ibc.core.channel.v2.MsgProvideCounterparty") + proto.RegisterType((*MsgProvideCounterpartyResponse)(nil), "ibc.core.channel.v2.MsgProvideCounterpartyResponse") + proto.RegisterType((*MsgCreateChannel)(nil), "ibc.core.channel.v2.MsgCreateChannel") + proto.RegisterType((*MsgCreateChannelResponse)(nil), "ibc.core.channel.v2.MsgCreateChannelResponse") } func init() { proto.RegisterFile("ibc/core/channel/v2/tx.proto", fileDescriptor_d421c7119e969b99) } var fileDescriptor_d421c7119e969b99 = []byte{ - // 724 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0x4d, 0x6f, 0xd3, 0x30, - 0x18, 0xc7, 0x9b, 0xb5, 0x2b, 0xf0, 0x74, 0x5b, 0x47, 0x78, 0xab, 0x02, 0x6a, 0xab, 0x0a, 0xb4, - 0x31, 0x58, 0x42, 0x0b, 0x97, 0x4d, 0x48, 0x68, 0x1b, 0x42, 0x5c, 0x26, 0xa1, 0xac, 0x70, 0x80, - 0x89, 0x2a, 0x75, 0x4d, 0x1a, 0xad, 0x89, 0x43, 0xec, 0x86, 0xed, 0x86, 0x38, 0x21, 0x0e, 0x88, - 0x8f, 0xc0, 0x47, 0xd8, 0x81, 0x0f, 0xb1, 0xe3, 0x0e, 0x1c, 0x38, 0x21, 0xb4, 0x1e, 0xf6, 0x35, - 0x50, 0x6c, 0x37, 0x7d, 0x59, 0xbb, 0x4d, 0x5a, 0x4f, 0x49, 0x9e, 0xe7, 0xef, 0xff, 0xf3, 0xf8, - 0x67, 0xc7, 0x86, 0x3b, 0x4e, 0x1d, 0x19, 0x88, 0x04, 0xd8, 0x40, 0x4d, 0xcb, 0xf3, 0x70, 0xcb, - 0x08, 0x2b, 0x06, 0xdb, 0xd5, 0xfd, 0x80, 0x30, 0xa2, 0x5e, 0x73, 0xea, 0x48, 0x8f, 0xb2, 0xba, - 0xcc, 0xea, 0x61, 0x45, 0xbb, 0x6e, 0x13, 0x9b, 0xf0, 0xbc, 0x11, 0xbd, 0x09, 0xa9, 0x76, 0x0b, - 0x11, 0xea, 0x12, 0x6a, 0xb8, 0xd4, 0x36, 0xc2, 0x72, 0xf4, 0x90, 0x89, 0xe2, 0xa8, 0x0a, 0xbe, - 0x85, 0x76, 0x30, 0x93, 0x8a, 0x11, 0x3d, 0x94, 0xe3, 0x1e, 0xb4, 0x42, 0x2f, 0xdb, 0x72, 0xb0, - 0xc7, 0xa2, 0xa4, 0x78, 0x13, 0x82, 0xd2, 0x6f, 0x05, 0x66, 0x37, 0xa9, 0xbd, 0x85, 0xbd, 0xc6, - 0x2b, 0x6e, 0xab, 0xde, 0x83, 0x39, 0x4a, 0xda, 0x01, 0xc2, 0x35, 0x69, 0x98, 0x53, 0x8a, 0xca, - 0xe2, 0x15, 0x73, 0x56, 0x44, 0x37, 0x44, 0x50, 0x7d, 0x00, 0x57, 0x99, 0xe3, 0x62, 0xd2, 0x66, - 0xb5, 0xe8, 0x49, 0x99, 0xe5, 0xfa, 0xb9, 0xa9, 0xa2, 0xb2, 0x98, 0x32, 0xe7, 0x65, 0xa2, 0xda, - 0x8d, 0xab, 0x2f, 0x20, 0x23, 0x9a, 0xae, 0x35, 0x2c, 0x66, 0xe5, 0x92, 0xc5, 0xe4, 0x62, 0xa6, - 0x52, 0xd0, 0x47, 0x00, 0xd2, 0x45, 0x17, 0xcf, 0x2d, 0x66, 0xad, 0xa7, 0x0e, 0xfe, 0x16, 0x12, - 0x26, 0xf8, 0x71, 0x44, 0xbd, 0x09, 0x69, 0xea, 0xd8, 0x1e, 0x0e, 0x72, 0x29, 0xde, 0x93, 0xfc, - 0x5a, 0x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2, 0xef, 0x28, 0xaf, - 0xfc, 0xe8, 0xe4, 0x13, 0x87, 0x9d, 0x7c, 0xe2, 0x4f, 0x27, 0x9f, 0x78, 0xfb, 0xd4, 0x76, 0x58, - 0xb3, 0x5d, 0xd7, 0x11, 0x71, 0x0d, 0x79, 0x1b, 0x3b, 0x75, 0xb4, 0x6c, 0x13, 0x23, 0x5c, 0x31, - 0x5c, 0xd2, 0x68, 0xb7, 0x30, 0x15, 0x37, 0xe9, 0xa3, 0x27, 0xcb, 0xfd, 0xd7, 0xfd, 0x9e, 0x8f, - 0x69, 0x3d, 0xcd, 0x6f, 0xd3, 0xc7, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0xa8, 0x8c, 0xff, 0x15, - 0x12, 0x08, 0x00, 0x00, + // 912 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x41, 0x6f, 0xdc, 0x44, + 0x14, 0x8e, 0xb3, 0xdb, 0xd0, 0xbc, 0x4d, 0x9a, 0xc5, 0xa5, 0xed, 0xca, 0x85, 0xdd, 0xd5, 0x8a, + 0x2a, 0x21, 0x25, 0x36, 0x71, 0x11, 0x52, 0x2a, 0xa4, 0xaa, 0x5d, 0x84, 0xe8, 0x61, 0xa5, 0xc8, + 0x09, 0x3d, 0x00, 0xc2, 0xf2, 0xda, 0xaf, 0x5e, 0x2b, 0x6b, 0x8f, 0xf1, 0xcc, 0xba, 0xc9, 0x0d, + 0x71, 0xe2, 0x84, 0x38, 0x72, 0xe4, 0x27, 0xe4, 0xc0, 0x8f, 0xe8, 0xb1, 0x07, 0x0e, 0x9c, 0x10, + 0x4a, 0x0e, 0x95, 0xf8, 0x15, 0xc8, 0x33, 0xb3, 0xb6, 0xb3, 0xf5, 0x26, 0x41, 0xcd, 0xc9, 0xf6, + 0x7b, 0xdf, 0xfb, 0xde, 0x7b, 0xdf, 0x1b, 0xcf, 0x0c, 0xbc, 0x1f, 0x0c, 0x5d, 0xc3, 0x25, 0x09, + 0x1a, 0xee, 0xc8, 0x89, 0x22, 0x1c, 0x1b, 0xa9, 0x69, 0xb0, 0x43, 0x3d, 0x4e, 0x08, 0x23, 0xea, + 0xcd, 0x60, 0xe8, 0xea, 0x99, 0x57, 0x97, 0x5e, 0x3d, 0x35, 0xb5, 0xf7, 0x7c, 0xe2, 0x13, 0xee, + 0x37, 0xb2, 0x37, 0x01, 0xd5, 0xee, 0xb8, 0x84, 0x86, 0x84, 0x1a, 0x21, 0xf5, 0x8d, 0x74, 0x3b, + 0x7b, 0x48, 0x47, 0xb7, 0x2a, 0x43, 0xec, 0xb8, 0x07, 0xc8, 0x24, 0xa2, 0xa2, 0x86, 0xed, 0xbc, + 0x06, 0xad, 0x53, 0x78, 0xc7, 0x01, 0x46, 0x2c, 0x73, 0x8a, 0x37, 0x09, 0x58, 0x2f, 0x00, 0x24, + 0x0c, 0x03, 0x16, 0x72, 0x90, 0x59, 0xfa, 0x12, 0xc0, 0xde, 0x9f, 0x0a, 0xac, 0x0e, 0xa8, 0xbf, + 0x87, 0x91, 0xb7, 0xcb, 0xf3, 0xab, 0xf7, 0xe0, 0x06, 0x25, 0x93, 0xc4, 0x45, 0x5b, 0x66, 0x6e, + 0x29, 0x5d, 0x65, 0x63, 0xd9, 0x5a, 0x15, 0xd6, 0xbe, 0x30, 0xaa, 0xf7, 0xe1, 0x5d, 0x16, 0x84, + 0x48, 0x26, 0xcc, 0xce, 0x9e, 0x94, 0x39, 0x61, 0xdc, 0x5a, 0xec, 0x2a, 0x1b, 0x75, 0xab, 0x29, + 0x1d, 0xfb, 0x53, 0xbb, 0xfa, 0x25, 0x34, 0x44, 0x77, 0xb6, 0xe7, 0x30, 0xa7, 0x55, 0xeb, 0xd6, + 0x36, 0x1a, 0x66, 0x47, 0xaf, 0x50, 0x52, 0x17, 0x55, 0x7c, 0xe1, 0x30, 0xe7, 0x49, 0xfd, 0xe5, + 0xdf, 0x9d, 0x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0x95, 0x7f, 0x4e, 0xda, 0xca, 0xaf, 0xa7, 0xed, 0x85, 0x57, + 0xa7, 0xed, 0x85, 0xbf, 0x4e, 0xdb, 0x0b, 0xdf, 0x7c, 0xee, 0x07, 0x6c, 0x34, 0x19, 0x66, 0x7f, + 0x8a, 0x21, 0xef, 0x91, 0xc1, 0xd0, 0xdd, 0xf2, 0x89, 0x91, 0xee, 0x18, 0x21, 0xf1, 0x26, 0x63, + 0xa4, 0xe2, 0x8a, 0xf7, 0xc9, 0xa7, 0x5b, 0xe5, 0x8b, 0xea, 0x51, 0x8c, 0x74, 0xb8, 0xc4, 0xaf, + 0x77, 0x0f, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xb5, 0xbf, 0x8f, 0xe6, 0xcc, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -424,6 +604,10 @@ 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) + // ProvideCounterparty defines a rpc handler method for MsgProvideCounterparty. + ProvideCounterparty(ctx context.Context, in *MsgProvideCounterparty, opts ...grpc.CallOption) (*MsgProvideCounterpartyResponse, 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. @@ -442,6 +626,24 @@ 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) ProvideCounterparty(ctx context.Context, in *MsgProvideCounterparty, opts ...grpc.CallOption) (*MsgProvideCounterpartyResponse, error) { + out := new(MsgProvideCounterpartyResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v2.Msg/ProvideCounterparty", 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...) @@ -480,6 +682,10 @@ 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) + // ProvideCounterparty defines a rpc handler method for MsgProvideCounterparty. + ProvideCounterparty(context.Context, *MsgProvideCounterparty) (*MsgProvideCounterpartyResponse, error) // SendPacket defines a rpc handler method for MsgSendPacket. SendPacket(context.Context, *MsgSendPacket) (*MsgSendPacketResponse, error) // RecvPacket defines a rpc handler method for MsgRecvPacket. @@ -494,6 +700,12 @@ 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) ProvideCounterparty(ctx context.Context, req *MsgProvideCounterparty) (*MsgProvideCounterpartyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProvideCounterparty not implemented") +} func (*UnimplementedMsgServer) SendPacket(ctx context.Context, req *MsgSendPacket) (*MsgSendPacketResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SendPacket not implemented") } @@ -511,6 +723,42 @@ 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_ProvideCounterparty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgProvideCounterparty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ProvideCounterparty(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v2.Msg/ProvideCounterparty", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ProvideCounterparty(ctx, req.(*MsgProvideCounterparty)) + } + 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 { @@ -587,6 +835,14 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "ibc.core.channel.v2.Msg", HandlerType: (*MsgServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "CreateChannel", + Handler: _Msg_CreateChannel_Handler, + }, + { + MethodName: "ProvideCounterparty", + Handler: _Msg_ProvideCounterparty_Handler, + }, { MethodName: "SendPacket", Handler: _Msg_SendPacket_Handler, @@ -962,6 +1218,150 @@ func (m *MsgAcknowledgementResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *MsgProvideCounterparty) 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 *MsgProvideCounterparty) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgProvideCounterparty) 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] = 0x1a + } + 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] = 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 + } + return len(dAtA) - i, nil +} + +func (m *MsgProvideCounterpartyResponse) 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 *MsgProvideCounterpartyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgProvideCounterpartyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgCreateChannel) 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 *MsgCreateChannel) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateChannel) 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] = 0x1a + } + { + size, err := m.MerklePathPrefix.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + 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))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateChannelResponse) 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 *MsgCreateChannelResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateChannelResponse) 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))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -1115,22 +1515,84 @@ func (m *MsgAcknowledgementResponse) Size() (n int) { return n } -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgSendPacket) 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 - } +func (m *MsgProvideCounterparty) 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 *MsgProvideCounterpartyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +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 sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgSendPacket) 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 } @@ -2162,6 +2624,431 @@ func (m *MsgAcknowledgementResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgProvideCounterparty) 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: MsgProvideCounterparty: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgProvideCounterparty: 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 *MsgProvideCounterpartyResponse) 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: MsgProvideCounterpartyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgProvideCounterpartyResponse: 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 *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 skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/modules/core/client/cli/cli.go b/modules/core/client/cli/cli.go index 56f3ff765d3..7edaf621076 100644 --- a/modules/core/client/cli/cli.go +++ b/modules/core/client/cli/cli.go @@ -8,8 +8,8 @@ import ( ibcclient "github.com/cosmos/ibc-go/v9/modules/core/02-client" connection "github.com/cosmos/ibc-go/v9/modules/core/03-connection" channel "github.com/cosmos/ibc-go/v9/modules/core/04-channel" + channelv2 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2" ibcexported "github.com/cosmos/ibc-go/v9/modules/core/exported" - packetserver "github.com/cosmos/ibc-go/v9/modules/core/packet-server" ) // GetTxCmd returns the transaction commands for this module @@ -25,7 +25,7 @@ func GetTxCmd() *cobra.Command { ibcTxCmd.AddCommand( ibcclient.GetTxCmd(), channel.GetTxCmd(), - packetserver.GetTxCmd(), + channelv2.GetTxCmd(), ) return ibcTxCmd @@ -46,7 +46,7 @@ func GetQueryCmd() *cobra.Command { ibcclient.GetQueryCmd(), connection.GetQueryCmd(), channel.GetQueryCmd(), - packetserver.GetQueryCmd(), + channelv2.GetQueryCmd(), ) return ibcQueryCmd diff --git a/modules/core/keeper/msg_server.go b/modules/core/keeper/msg_server.go index 9f4351369bc..a59bfc28490 100644 --- a/modules/core/keeper/msg_server.go +++ b/modules/core/keeper/msg_server.go @@ -16,8 +16,6 @@ import ( porttypes "github.com/cosmos/ibc-go/v9/modules/core/05-port/types" ibcerrors "github.com/cosmos/ibc-go/v9/modules/core/errors" "github.com/cosmos/ibc-go/v9/modules/core/internal/telemetry" - packetserverkeeper "github.com/cosmos/ibc-go/v9/modules/core/packet-server/keeper" - packetservertypes "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types" coretypes "github.com/cosmos/ibc-go/v9/modules/core/types" ) @@ -26,7 +24,6 @@ var ( _ connectiontypes.MsgServer = (*Keeper)(nil) _ channeltypes.MsgServer = (*Keeper)(nil) _ channeltypes.PacketMsgServer = (*Keeper)(nil) - _ packetservertypes.MsgServer = (*Keeper)(nil) ) // CreateClient defines a rpc handler method for MsgCreateClient. @@ -140,49 +137,6 @@ func (k *Keeper) IBCSoftwareUpgrade(goCtx context.Context, msg *clienttypes.MsgI return &clienttypes.MsgIBCSoftwareUpgradeResponse{}, nil } -// CreateChannel defines a rpc handler method for MsgCreateChannel -func (k *Keeper) CreateChannel(goCtx context.Context, msg *packetservertypes.MsgCreateChannel) (*packetservertypes.MsgCreateChannelResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - channelID := k.ChannelKeeper.GenerateChannelIdentifier(ctx) - - // Initialize channel with empty counterparty channel identifier. - channel := packetservertypes.NewChannel(msg.ClientId, "", msg.MerklePathPrefix) - k.PacketServerKeeper.SetChannel(ctx, channelID, channel) - - k.PacketServerKeeper.SetCreator(ctx, channelID, msg.Signer) - - packetserverkeeper.EmitCreateChannelEvent(goCtx, channelID) - - return &packetservertypes.MsgCreateChannelResponse{ChannelId: channelID}, nil -} - -// ProvideCounterparty defines a rpc handler method for MsgProvideCounterparty. -func (k *Keeper) ProvideCounterparty(goCtx context.Context, msg *packetservertypes.MsgProvideCounterparty) (*packetservertypes.MsgProvideCounterpartyResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - creator, found := k.PacketServerKeeper.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, ok := k.PacketServerKeeper.GetChannel(ctx, msg.ChannelId) - if !ok { - return nil, errorsmod.Wrapf(packetservertypes.ErrInvalidChannel, "channel must exist for channel id %s", msg.ChannelId) - } - - channel.CounterpartyChannelId = msg.CounterpartyChannelId - k.PacketServerKeeper.SetChannel(ctx, msg.ChannelId, channel) - // Delete client creator from state as it is not needed after this point. - k.PacketServerKeeper.DeleteCreator(ctx, msg.ChannelId) - - return &packetservertypes.MsgProvideCounterpartyResponse{}, nil -} - // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. func (k *Keeper) ConnectionOpenInit(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenInit) (*connectiontypes.MsgConnectionOpenInitResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) diff --git a/modules/core/keeper/msg_server_test.go b/modules/core/keeper/msg_server_test.go index 404240f72d7..e101d57ed06 100644 --- a/modules/core/keeper/msg_server_test.go +++ b/modules/core/keeper/msg_server_test.go @@ -1203,75 +1203,6 @@ func (suite *KeeperTestSuite) TestHandleTimeoutOnClosePacket() { } } -func (suite *KeeperTestSuite) TestProvideCounterparty() { - var ( - path *ibctesting.Path - msg *packetservertypes.MsgProvideCounterparty - ) - cases := []struct { - name string - malleate func() - expError error - }{ - { - "success", - func() { - // set it before handler - suite.chainA.App.GetIBCKeeper().PacketServerKeeper.SetChannel(suite.chainA.GetContext(), msg.ChannelId, packetservertypes.NewChannel(path.EndpointA.ClientID, "", ibctesting.MerklePath)) - }, - nil, - }, - { - "failure: signer does not match creator", - func() { - msg.Signer = ibctesting.TestAccAddress - }, - ibcerrors.ErrUnauthorized, - }, - { - "failure: counterparty does not already exists", - func() { - suite.chainA.App.GetIBCKeeper().PacketServerKeeper.ChannelStore(suite.chainA.GetContext(), path.EndpointA.ChannelID).Delete([]byte(packetservertypes.ChannelKey)) - }, - packetservertypes.ErrInvalidChannel, - }, - } - - for _, tc := range cases { - tc := tc - path = ibctesting.NewPath(suite.chainA, suite.chainB) - path.SetupClients() - - suite.Require().NoError(path.EndpointA.CreateChannel()) - - signer := path.EndpointA.Chain.SenderAccount.GetAddress().String() - msg = packetservertypes.NewMsgProvideCounterparty(path.EndpointA.ChannelID, path.EndpointB.ChannelID, signer) - - tc.malleate() - - ctx := suite.chainA.GetContext() - resp, err := suite.chainA.App.GetIBCKeeper().ProvideCounterparty(ctx, msg) - - expPass := tc.expError == nil - if expPass { - suite.Require().NotNil(resp) - suite.Require().Nil(err) - - // Assert counterparty channel id filled in and creator deleted - channel, found := suite.chainA.App.GetIBCKeeper().PacketServerKeeper.GetChannel(suite.chainA.GetContext(), path.EndpointA.ChannelID) - suite.Require().True(found) - suite.Require().Equal(channel.CounterpartyChannelId, path.EndpointB.ChannelID) - - _, found = suite.chainA.App.GetIBCKeeper().PacketServerKeeper.GetCreator(suite.chainA.GetContext(), path.EndpointA.ClientID) - suite.Require().False(found) - } else { - suite.Require().Nil(resp) - suite.Require().Error(err) - suite.Require().ErrorIs(err, tc.expError) - } - } -} - func (suite *KeeperTestSuite) TestUpgradeClient() { var ( path *ibctesting.Path diff --git a/modules/core/module.go b/modules/core/module.go index 29c1d2d8d04..c312604d7f3 100644 --- a/modules/core/module.go +++ b/modules/core/module.go @@ -28,8 +28,6 @@ import ( "github.com/cosmos/ibc-go/v9/modules/core/client/cli" "github.com/cosmos/ibc-go/v9/modules/core/exported" "github.com/cosmos/ibc-go/v9/modules/core/keeper" - packetserverkeeper "github.com/cosmos/ibc-go/v9/modules/core/packet-server/keeper" - packetservertypes "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types" "github.com/cosmos/ibc-go/v9/modules/core/simulation" "github.com/cosmos/ibc-go/v9/modules/core/types" ) @@ -94,7 +92,6 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *r if err != nil { panic(err) } - err = packetservertypes.RegisterQueryHandlerClient(context.Background(), mux, packetservertypes.NewQueryClient(clientCtx)) if err != nil { panic(err) } @@ -140,12 +137,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { channeltypes.RegisterMsgServer(cfg.MsgServer(), am.keeper) channeltypes.RegisterPacketMsgServer(cfg.MsgServer(), am.keeper) channeltypesv2.RegisterMsgServer(cfg.MsgServer(), am.keeper.ChannelKeeperV2) - packetservertypes.RegisterMsgServer(cfg.MsgServer(), am.keeper) clienttypes.RegisterQueryServer(cfg.QueryServer(), clientkeeper.NewQueryServer(am.keeper.ClientKeeper)) connectiontypes.RegisterQueryServer(cfg.QueryServer(), connectionkeeper.NewQueryServer(am.keeper.ConnectionKeeper)) channeltypes.RegisterQueryServer(cfg.QueryServer(), channelkeeper.NewQueryServer(am.keeper.ChannelKeeper)) - packetservertypes.RegisterQueryServer(cfg.QueryServer(), packetserverkeeper.NewQueryServer(am.keeper.PacketServerKeeper)) clientMigrator := clientkeeper.NewMigrator(am.keeper.ClientKeeper) if err := cfg.RegisterMigration(exported.ModuleName, 2, clientMigrator.Migrate2to3); err != nil { diff --git a/modules/core/packet-server/keeper/events.go b/modules/core/packet-server/keeper/events.go deleted file mode 100644 index 64f5c023205..00000000000 --- a/modules/core/packet-server/keeper/events.go +++ /dev/null @@ -1,25 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types" -) - -// EmitCreateChannelEvent emits a channel create event. -func EmitCreateChannelEvent(ctx context.Context, channelID string) { - sdkCtx := sdk.UnwrapSDKContext(ctx) - - sdkCtx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeCreateChannel, - sdk.NewAttribute(types.AttributeKeyChannelID, channelID), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) -} diff --git a/modules/core/packet-server/keeper/keeper.go b/modules/core/packet-server/keeper/keeper.go index b862b3e0ed5..eeeeec5aa3e 100644 --- a/modules/core/packet-server/keeper/keeper.go +++ b/modules/core/packet-server/keeper/keeper.go @@ -66,26 +66,3 @@ func (k *Keeper) GetChannel(ctx context.Context, clientID string) (types.Channel k.cdc.MustUnmarshal(bz, &channel) return channel, true } - -// GetCreator returns the creator of the client. -func (k *Keeper) GetCreator(ctx context.Context, clientID string) (string, bool) { - sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 - bz := k.ChannelStore(sdkCtx, clientID).Get([]byte(types.CreatorKey)) - if len(bz) == 0 { - return "", false - } - - return string(bz), true -} - -// SetCreator sets the creator of the client. -func (k *Keeper) SetCreator(ctx context.Context, clientID, creator string) { - sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 - k.ChannelStore(sdkCtx, clientID).Set([]byte(types.CreatorKey), []byte(creator)) -} - -// DeleteCreator deletes the creator associated with the client. -func (k *Keeper) DeleteCreator(ctx context.Context, clientID string) { - sdkCtx := sdk.UnwrapSDKContext(ctx) // TODO: https://github.com/cosmos/ibc-go/issues/5917 - k.ChannelStore(sdkCtx, clientID).Delete([]byte(types.CreatorKey)) -} diff --git a/modules/core/packet-server/keeper/keeper_test.go b/modules/core/packet-server/keeper/keeper_test.go deleted file mode 100644 index 3c95dc45e0e..00000000000 --- a/modules/core/packet-server/keeper/keeper_test.go +++ /dev/null @@ -1,53 +0,0 @@ -package keeper_test - -import ( - commitmenttypes "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types" - "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types" - ibctesting "github.com/cosmos/ibc-go/v9/testing" -) - -const testClientID = "tendermint-0" - -func (suite *KeeperTestSuite) TestSetChannel() { - merklePathPrefix := commitmenttypes.NewMerklePath([]byte("ibc"), []byte("")) - channel := types.Channel{ - ClientId: testClientID, - MerklePathPrefix: merklePathPrefix, - } - suite.chainA.App.GetIBCKeeper().PacketServerKeeper.SetChannel(suite.chainA.GetContext(), testClientID, channel) - - retrievedChannel, found := suite.chainA.App.GetIBCKeeper().PacketServerKeeper.GetChannel(suite.chainA.GetContext(), testClientID) - suite.Require().True(found, "GetChannel does not return channel") - suite.Require().Equal(channel, retrievedChannel, "Channel retrieved not equal") - - // Channel not yet stored for another client. - retrievedChannel, found = suite.chainA.App.GetIBCKeeper().PacketServerKeeper.GetChannel(suite.chainA.GetContext(), ibctesting.SecondClientID) - suite.Require().False(found, "GetChannel unexpectedly returned a channel") - suite.Require().Equal(types.Channel{}, retrievedChannel, "Channel retrieved not empty") -} - -func (suite *KeeperTestSuite) TestSetCreator() { - clientID := ibctesting.FirstClientID - expectedCreator := "test-creator" - - // Set the creator for the client - suite.chainA.App.GetIBCKeeper().PacketServerKeeper.SetCreator(suite.chainA.GetContext(), clientID, expectedCreator) - - // Retrieve the creator from the store - retrievedCreator, found := suite.chainA.App.GetIBCKeeper().PacketServerKeeper.GetCreator(suite.chainA.GetContext(), clientID) - - // 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 non stored creator is not found - retrievedCreator, found = suite.chainA.App.GetIBCKeeper().PacketServerKeeper.GetCreator(suite.chainA.GetContext(), ibctesting.SecondClientID) - suite.Require().False(found, "GetCreator unexpectedly returned a creator") - suite.Require().Empty(retrievedCreator, "Creator is not empty") - - // Verify that the creator is deleted from the store - suite.chainA.App.GetIBCKeeper().PacketServerKeeper.DeleteCreator(suite.chainA.GetContext(), clientID) - retrievedCreator, found = suite.chainA.App.GetIBCKeeper().PacketServerKeeper.GetCreator(suite.chainA.GetContext(), clientID) - suite.Require().False(found, "GetCreator unexpectedly returned a creator") - suite.Require().Empty(retrievedCreator, "Creator is not empty") -} diff --git a/modules/core/packet-server/keeper/relay.go b/modules/core/packet-server/keeper/relay.go index 9ad03fb70c8..40c279fa94d 100644 --- a/modules/core/packet-server/keeper/relay.go +++ b/modules/core/packet-server/keeper/relay.go @@ -12,6 +12,7 @@ import ( clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" channelkeeper "github.com/cosmos/ibc-go/v9/modules/core/04-channel/keeper" channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" + channeltypesv2 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" host "github.com/cosmos/ibc-go/v9/modules/core/24-host" "github.com/cosmos/ibc-go/v9/modules/core/exported" "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types" @@ -159,7 +160,7 @@ func (k Keeper) RecvPacket( } path := host.PacketCommitmentKey(packet.SourcePort, packet.SourceChannel, packet.Sequence) - merklePath := types.BuildMerklePath(channel.MerklePathPrefix, path) + merklePath := channeltypesv2.BuildMerklePath(channel.MerklePathPrefix, path) commitment := channeltypes.CommitPacket(packet) @@ -290,7 +291,7 @@ func (k Keeper) AcknowledgePacket( } path := host.PacketAcknowledgementKey(packet.DestinationPort, packet.DestinationChannel, packet.Sequence) - merklePath := types.BuildMerklePath(channel.MerklePathPrefix, path) + merklePath := channeltypesv2.BuildMerklePath(channel.MerklePathPrefix, path) if err := k.ClientKeeper.VerifyMembership( ctx, @@ -373,7 +374,7 @@ func (k Keeper) TimeoutPacket( // verify packet receipt absence path := host.PacketReceiptKey(packet.DestinationPort, packet.DestinationChannel, packet.Sequence) - merklePath := types.BuildMerklePath(channel.MerklePathPrefix, path) + merklePath := channeltypesv2.BuildMerklePath(channel.MerklePathPrefix, path) if err := k.ClientKeeper.VerifyNonMembership( ctx, diff --git a/modules/core/packet-server/types/codec.go b/modules/core/packet-server/types/codec.go deleted file mode 100644 index 1c0bd85c7c2..00000000000 --- a/modules/core/packet-server/types/codec.go +++ /dev/null @@ -1,15 +0,0 @@ -package types - -import ( - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// RegisterInterfaces registers the client interfaces to protobuf Any. -func RegisterInterfaces(registry codectypes.InterfaceRegistry) { - registry.RegisterImplementations( - (*sdk.Msg)(nil), - &MsgProvideCounterparty{}, - &MsgCreateChannel{}, - ) -} diff --git a/modules/core/packet-server/types/keys.go b/modules/core/packet-server/types/keys.go index fcbeb56d5e4..d1426569d57 100644 --- a/modules/core/packet-server/types/keys.go +++ b/modules/core/packet-server/types/keys.go @@ -8,9 +8,4 @@ const ( // the channel key is imported from types instead of host because // the channel key is not a part of the ics-24 host specification ChannelKey = "channel" - - // CreatorKey is the key used to store the client creator in the client store - // the creator key is imported from types instead of host because - // the creator key is not a part of the ics-24 host specification - CreatorKey = "creator" ) diff --git a/modules/core/packet-server/types/msgs.go b/modules/core/packet-server/types/msgs.go deleted file mode 100644 index a291f62ab2d..00000000000 --- a/modules/core/packet-server/types/msgs.go +++ /dev/null @@ -1,68 +0,0 @@ -package types - -import ( - errorsmod "cosmossdk.io/errors" - - sdk "github.com/cosmos/cosmos-sdk/types" - - commitmenttypes "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" -) - -var ( - _ sdk.Msg = (*MsgProvideCounterparty)(nil) - _ sdk.HasValidateBasic = (*MsgProvideCounterparty)(nil) -) - -// NewMsgProvideCounterparty creates a new MsgProvideCounterparty instance -func NewMsgProvideCounterparty(channelID, counterpartyChannelID string, signer string) *MsgProvideCounterparty { - return &MsgProvideCounterparty{ - Signer: signer, - ChannelId: channelID, - CounterpartyChannelId: counterpartyChannelID, - } -} - -// ValidateBasic performs basic checks on a MsgProvideCounterparty. -func (msg *MsgProvideCounterparty) 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 -} - -// NewMsgCreateChannel creates a new MsgCreateChannel instance -func NewMsgCreateChannel(clientID string, merklePathPrefix commitmenttypes.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 -} diff --git a/modules/core/packet-server/types/tx.pb.go b/modules/core/packet-server/types/tx.pb.go deleted file mode 100644 index 22b052db787..00000000000 --- a/modules/core/packet-server/types/tx.pb.go +++ /dev/null @@ -1,1091 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ibc/core/packetserver/v1/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - 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" - 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 - -// MsgProvideCounterparty defines the message used to provide the counterparty client -// identifier. Can only be invoked one time by the signer of MsgCreateClient if the counterparty -// client identifier was not provided in the initial MsgCreateClient message. -type MsgProvideCounterparty 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 *MsgProvideCounterparty) Reset() { *m = MsgProvideCounterparty{} } -func (m *MsgProvideCounterparty) String() string { return proto.CompactTextString(m) } -func (*MsgProvideCounterparty) ProtoMessage() {} -func (*MsgProvideCounterparty) Descriptor() ([]byte, []int) { - return fileDescriptor_3c556aec8b7966db, []int{0} -} -func (m *MsgProvideCounterparty) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgProvideCounterparty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgProvideCounterparty.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 *MsgProvideCounterparty) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgProvideCounterparty.Merge(m, src) -} -func (m *MsgProvideCounterparty) XXX_Size() int { - return m.Size() -} -func (m *MsgProvideCounterparty) XXX_DiscardUnknown() { - xxx_messageInfo_MsgProvideCounterparty.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgProvideCounterparty proto.InternalMessageInfo - -// MsgProvideCounterpartyResponse defines the Msg/ProvideCounterparty response type. -type MsgProvideCounterpartyResponse struct { -} - -func (m *MsgProvideCounterpartyResponse) Reset() { *m = MsgProvideCounterpartyResponse{} } -func (m *MsgProvideCounterpartyResponse) String() string { return proto.CompactTextString(m) } -func (*MsgProvideCounterpartyResponse) ProtoMessage() {} -func (*MsgProvideCounterpartyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3c556aec8b7966db, []int{1} -} -func (m *MsgProvideCounterpartyResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgProvideCounterpartyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgProvideCounterpartyResponse.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 *MsgProvideCounterpartyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgProvideCounterpartyResponse.Merge(m, src) -} -func (m *MsgProvideCounterpartyResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgProvideCounterpartyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgProvideCounterpartyResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgProvideCounterpartyResponse proto.InternalMessageInfo - -// 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_3c556aec8b7966db, []int{2} -} -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_3c556aec8b7966db, []int{3} -} -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 - -func init() { - proto.RegisterType((*MsgProvideCounterparty)(nil), "ibc.core.packetserver.v1.MsgProvideCounterparty") - proto.RegisterType((*MsgProvideCounterpartyResponse)(nil), "ibc.core.packetserver.v1.MsgProvideCounterpartyResponse") - proto.RegisterType((*MsgCreateChannel)(nil), "ibc.core.packetserver.v1.MsgCreateChannel") - proto.RegisterType((*MsgCreateChannelResponse)(nil), "ibc.core.packetserver.v1.MsgCreateChannelResponse") -} - -func init() { proto.RegisterFile("ibc/core/packetserver/v1/tx.proto", fileDescriptor_3c556aec8b7966db) } - -var fileDescriptor_3c556aec8b7966db = []byte{ - // 468 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x31, 0x6f, 0xd3, 0x40, - 0x14, 0xc7, 0x7d, 0x6d, 0xa9, 0xc8, 0x21, 0x44, 0x65, 0xa0, 0x8d, 0x8c, 0x70, 0x4b, 0x16, 0x50, - 0xa4, 0xde, 0x51, 0x23, 0x21, 0xa8, 0x90, 0x90, 0x9a, 0xa9, 0x43, 0xa4, 0x28, 0x43, 0x07, 0x96, - 0xc8, 0x3e, 0x3f, 0x2e, 0xa7, 0xfa, 0x7c, 0xd6, 0xdd, 0xc5, 0x6a, 0x37, 0xca, 0xc4, 0xc8, 0xc8, - 0xc8, 0x47, 0xc8, 0xc7, 0xe8, 0xd8, 0x91, 0x09, 0xa1, 0x64, 0xe8, 0xd7, 0x40, 0x76, 0x5c, 0x63, - 0xaa, 0x00, 0x65, 0xf3, 0xbd, 0xf7, 0x7b, 0xef, 0xfd, 0xdf, 0xf3, 0x7b, 0xf8, 0x89, 0x88, 0x18, - 0x65, 0x4a, 0x03, 0xcd, 0x42, 0x76, 0x0c, 0xd6, 0x80, 0xce, 0x41, 0x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x76, 0x3c, 0xca, 0x34, 0xbc, 0x17, 0x27, 0xa5, 0xde, 0x3b, 0x41, 0x87, 0xd4, 0xd3, - 0x6f, 0xcc, 0x2f, 0x0f, 0x48, 0xbf, 0x8c, 0x18, 0x84, 0x76, 0x7c, 0xb0, 0x76, 0xfe, 0x7d, 0xdb, - 0x19, 0x6e, 0xc8, 0xda, 0x32, 0x28, 0x33, 0xdc, 0xbc, 0xa9, 0xb7, 0xb8, 0x7d, 0x5d, 0xf1, 0x55, - 0x3b, 0xff, 0x18, 0xf8, 0xfe, 0x5a, 0x91, 0x2b, 0x38, 0x5b, 0xc1, 0xab, 0x7d, 0xc3, 0x5d, 0x85, - 0xef, 0xfe, 0xde, 0x77, 0x97, 0xfc, 0x69, 0x79, 0xc8, 0xf5, 0x8a, 0x5e, 0x70, 0x73, 0xb6, 0x56, - 0x77, 0x86, 0xf0, 0xfd, 0x65, 0x6b, 0xf2, 0xfc, 0xaf, 0xb9, 0x96, 0x44, 0x78, 0xaf, 0xfe, 0x37, - 0xe2, 0x4a, 0x83, 0x77, 0xeb, 0xc3, 0xe5, 0xb4, 0x8b, 0x0e, 0x8e, 0xce, 0x67, 0x3e, 0xba, 0x98, - 0xf9, 0xe8, 0xc7, 0xcc, 0x47, 0x9f, 0xe7, 0xbe, 0x73, 0x31, 0xf7, 0x9d, 0x6f, 0x73, 0xdf, 0x79, - 0xf7, 0x86, 0x0b, 0x3b, 0x9e, 0x44, 0xc5, 0x0f, 0xa4, 0xd5, 0xca, 0x8b, 0x88, 0xed, 0x72, 0x45, - 0xf3, 0xd7, 0x54, 0xaa, 0x78, 0x92, 0x80, 0x69, 0xde, 0xe0, 0x6e, 0x75, 0x84, 0xf6, 0x34, 0x03, - 0x13, 0xad, 0x97, 0x37, 0xf1, 0xe2, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x8b, 0x7a, 0x32, - 0xaa, 0x03, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// 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) - // ProvideCounterparty defines a rpc handler method for MsgProvideCounterparty. - ProvideCounterparty(ctx context.Context, in *MsgProvideCounterparty, opts ...grpc.CallOption) (*MsgProvideCounterpartyResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -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.packetserver.v1.Msg/CreateChannel", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ProvideCounterparty(ctx context.Context, in *MsgProvideCounterparty, opts ...grpc.CallOption) (*MsgProvideCounterpartyResponse, error) { - out := new(MsgProvideCounterpartyResponse) - err := c.cc.Invoke(ctx, "/ibc.core.packetserver.v1.Msg/ProvideCounterparty", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// 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) - // ProvideCounterparty defines a rpc handler method for MsgProvideCounterparty. - ProvideCounterparty(context.Context, *MsgProvideCounterparty) (*MsgProvideCounterpartyResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -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) ProvideCounterparty(ctx context.Context, req *MsgProvideCounterparty) (*MsgProvideCounterpartyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ProvideCounterparty not implemented") -} - -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.packetserver.v1.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_ProvideCounterparty_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgProvideCounterparty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ProvideCounterparty(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ibc.core.packetserver.v1.Msg/ProvideCounterparty", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ProvideCounterparty(ctx, req.(*MsgProvideCounterparty)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "ibc.core.packetserver.v1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateChannel", - Handler: _Msg_CreateChannel_Handler, - }, - { - MethodName: "ProvideCounterparty", - Handler: _Msg_ProvideCounterparty_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "ibc/core/packetserver/v1/tx.proto", -} - -func (m *MsgProvideCounterparty) 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 *MsgProvideCounterparty) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgProvideCounterparty) 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] = 0x1a - } - 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] = 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 - } - return len(dAtA) - i, nil -} - -func (m *MsgProvideCounterpartyResponse) 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 *MsgProvideCounterpartyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgProvideCounterpartyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgCreateChannel) 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 *MsgCreateChannel) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateChannel) 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] = 0x1a - } - { - size, err := m.MerklePathPrefix.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - 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))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgCreateChannelResponse) 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 *MsgCreateChannelResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateChannelResponse) 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))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgProvideCounterparty) 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 *MsgProvideCounterpartyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -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 sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgProvideCounterparty) 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: MsgProvideCounterparty: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgProvideCounterparty: 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 *MsgProvideCounterpartyResponse) 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: MsgProvideCounterpartyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgProvideCounterpartyResponse: 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 *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 skipTx(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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) diff --git a/modules/core/types/codec.go b/modules/core/types/codec.go index d805413f912..d704d725ea3 100644 --- a/modules/core/types/codec.go +++ b/modules/core/types/codec.go @@ -8,7 +8,6 @@ import ( channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" channeltypesv2 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" commitmenttypes "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types" - packetservertypes "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types" ) // RegisterInterfaces registers ibc types against interfaces using the global InterfaceRegistry. @@ -17,7 +16,6 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { clienttypes.RegisterInterfaces(registry) connectiontypes.RegisterInterfaces(registry) channeltypes.RegisterInterfaces(registry) - packetservertypes.RegisterInterfaces(registry) commitmenttypes.RegisterInterfaces(registry) channeltypesv2.RegisterInterfaces(registry) diff --git a/proto/ibc/core/packetserver/v1/query.proto b/proto/ibc/core/channel/v2/query.proto similarity index 80% rename from proto/ibc/core/packetserver/v1/query.proto rename to proto/ibc/core/channel/v2/query.proto index f429a185e87..072118099a8 100644 --- a/proto/ibc/core/packetserver/v1/query.proto +++ b/proto/ibc/core/channel/v2/query.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package ibc.core.packetserver.v1; +package ibc.core.channel.v2; -option go_package = "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types"; +option go_package = "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types"; -import "ibc/core/packetserver/v1/channel.proto"; +import "ibc/core/channel/v2/channel.proto"; import "google/api/annotations.proto"; import "gogoproto/gogo.proto"; diff --git a/proto/ibc/core/channel/v2/tx.proto b/proto/ibc/core/channel/v2/tx.proto index 771706b3efc..d72dbd9db2a 100644 --- a/proto/ibc/core/channel/v2/tx.proto +++ b/proto/ibc/core/channel/v2/tx.proto @@ -9,11 +9,18 @@ import "cosmos/msg/v1/msg.proto"; import "ibc/core/channel/v2/packet.proto"; import "ibc/core/channel/v1/tx.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); + + // ProvideCounterparty defines a rpc handler method for MsgProvideCounterparty. + rpc ProvideCounterparty(MsgProvideCounterparty) returns (MsgProvideCounterpartyResponse); + // SendPacket defines a rpc handler method for MsgSendPacket. rpc SendPacket(MsgSendPacket) returns (MsgSendPacketResponse); @@ -103,3 +110,44 @@ message MsgAcknowledgementResponse { ibc.core.channel.v1.ResponseResultType result = 1; } + +// MsgProvideCounterparty defines the message used to provide the counterparty client +// identifier. Can only be invoked one time by the signer of MsgCreateClient if the counterparty +// client identifier was not provided in the initial MsgCreateClient message. +message MsgProvideCounterparty { + 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; +} + +// MsgProvideCounterpartyResponse defines the Msg/ProvideCounterparty response type. +message MsgProvideCounterpartyResponse {} + +// 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; +} diff --git a/proto/ibc/core/packetserver/v1/tx.proto b/proto/ibc/core/packetserver/v1/tx.proto deleted file mode 100644 index c179e9ae25c..00000000000 --- a/proto/ibc/core/packetserver/v1/tx.proto +++ /dev/null @@ -1,62 +0,0 @@ - -syntax = "proto3"; - -package ibc.core.packetserver.v1; - -option go_package = "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types"; - -import "gogoproto/gogo.proto"; -import "ibc/core/commitment/v2/commitment.proto"; -import "cosmos/msg/v1/msg.proto"; - -// Msg defines the ibc/packetserver Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // CreateChannel defines a rpc handler method for MsgCreateChannel - rpc CreateChannel(MsgCreateChannel) returns (MsgCreateChannelResponse); - - // ProvideCounterparty defines a rpc handler method for MsgProvideCounterparty. - rpc ProvideCounterparty(MsgProvideCounterparty) returns (MsgProvideCounterpartyResponse); -} - -// MsgProvideCounterparty defines the message used to provide the counterparty client -// identifier. Can only be invoked one time by the signer of MsgCreateClient if the counterparty -// client identifier was not provided in the initial MsgCreateClient message. -message MsgProvideCounterparty { - 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; -} - -// MsgProvideCounterpartyResponse defines the Msg/ProvideCounterparty response type. -message MsgProvideCounterpartyResponse {} - -// 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; -} diff --git a/testing/endpoint.go b/testing/endpoint.go index 05ad6c1e654..82f735ae78e 100644 --- a/testing/endpoint.go +++ b/testing/endpoint.go @@ -16,10 +16,10 @@ import ( clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" connectiontypes "github.com/cosmos/ibc-go/v9/modules/core/03-connection/types" channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" + channeltypesv2 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" commitmenttypes "github.com/cosmos/ibc-go/v9/modules/core/23-commitment/types" host "github.com/cosmos/ibc-go/v9/modules/core/24-host" "github.com/cosmos/ibc-go/v9/modules/core/exported" - packetservertypes "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types" ibctm "github.com/cosmos/ibc-go/v9/modules/light-clients/07-tendermint" ) @@ -178,7 +178,7 @@ func (endpoint *Endpoint) FreezeClient() { // ProvideCounterparty will construct and execute a MsgProvideCounterparty on the associated endpoint. func (endpoint *Endpoint) ProvideCounterparty() (err error) { - msg := packetservertypes.NewMsgProvideCounterparty(endpoint.ChannelID, endpoint.Counterparty.ChannelID, endpoint.Chain.SenderAccount.GetAddress().String()) + msg := channeltypesv2.NewMsgProvideCounterparty(endpoint.ChannelID, endpoint.Counterparty.ChannelID, endpoint.Chain.SenderAccount.GetAddress().String()) // setup counterparty _, err = endpoint.Chain.SendMsgs(msg) @@ -188,7 +188,7 @@ func (endpoint *Endpoint) ProvideCounterparty() (err error) { // CreateChannel will construct and execute a new MsgCreateChannel on the associated endpoint. func (endpoint *Endpoint) CreateChannel() (err error) { - msg := packetservertypes.NewMsgCreateChannel(endpoint.ClientID, MerklePath, endpoint.Chain.SenderAccount.GetAddress().String()) + msg := channeltypesv2.NewMsgCreateChannel(endpoint.ClientID, MerklePath, endpoint.Chain.SenderAccount.GetAddress().String()) // create channel res, err := endpoint.Chain.SendMsgs(msg) diff --git a/testing/events.go b/testing/events.go index 0fa3cfafb73..a4caaf46a9e 100644 --- a/testing/events.go +++ b/testing/events.go @@ -14,7 +14,7 @@ import ( clienttypes "github.com/cosmos/ibc-go/v9/modules/core/02-client/types" connectiontypes "github.com/cosmos/ibc-go/v9/modules/core/03-connection/types" channeltypes "github.com/cosmos/ibc-go/v9/modules/core/04-channel/types" - packetservertypes "github.com/cosmos/ibc-go/v9/modules/core/packet-server/types" + channeltypesv2 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" ) // ParseClientIDFromEvents parses events emitted from a MsgCreateClient and returns the @@ -48,7 +48,7 @@ func ParseConnectionIDFromEvents(events []abci.Event) (string, error) { // MsgChannelOpenTry or a MsgCreateChannel and returns the channel identifier. func ParseChannelIDFromEvents(events []abci.Event) (string, error) { for _, ev := range events { - if ev.Type == packetservertypes.EventTypeCreateChannel || ev.Type == channeltypes.EventTypeChannelOpenInit || ev.Type == channeltypes.EventTypeChannelOpenTry { + if ev.Type == channeltypesv2.EventTypeCreateChannel || ev.Type == channeltypes.EventTypeChannelOpenInit || ev.Type == channeltypes.EventTypeChannelOpenTry { if attribute, found := attributeByKey(ev.Attributes, channeltypes.AttributeKeyChannelID); found { return attribute.Value, nil } From 4ed754356977133fbfff835d53d3b6473a00e2f5 Mon Sep 17 00:00:00 2001 From: Nikolas De Giorgis Date: Mon, 14 Oct 2024 11:30:17 +0100 Subject: [PATCH 2/3] chore: Add OnAcknowledgmentPacket to IBCModule V2 Interface (#7438) * Add OnAcknowledgmentPacket to IBCModule V2 Interface * chore: fix typo --- modules/core/api/module.go | 12 ++++++++++-- testing/mock/v2/ibc_app.go | 7 ++++--- testing/mock/v2/ibc_module.go | 14 ++++++-------- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/modules/core/api/module.go b/modules/core/api/module.go index f15dfad6611..8346d291663 100644 --- a/modules/core/api/module.go +++ b/modules/core/api/module.go @@ -31,8 +31,6 @@ type IBCModule interface { relayer sdk.AccAddress, ) channeltypesv2.RecvPacketResult - // OnAcknowledgementPacket - // OnTimeoutPacket is executed when a packet has timed out on the receiving chain. OnTimeoutPacket( ctx context.Context, @@ -41,4 +39,14 @@ type IBCModule interface { data channeltypesv2.PacketData, relayer sdk.AccAddress, ) error + + // OnAcknowledgementPacket is executed when a packet gets acknowledged + OnAcknowledgementPacket( + ctx context.Context, + sourceID string, + destinationID string, + data channeltypesv2.PacketData, + acknowledgement []byte, + relayer sdk.AccAddress, + ) error } diff --git a/testing/mock/v2/ibc_app.go b/testing/mock/v2/ibc_app.go index ddf4c67f115..21948faab3e 100644 --- a/testing/mock/v2/ibc_app.go +++ b/testing/mock/v2/ibc_app.go @@ -9,7 +9,8 @@ import ( ) type IBCApp struct { - OnSendPacket func(ctx context.Context, sourceID string, destinationID string, sequence uint64, data channeltypesv2.PacketData, signer sdk.AccAddress) error - OnRecvPacket func(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, relayer sdk.AccAddress) channeltypesv2.RecvPacketResult - OnTimeoutPacket func(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, relayer sdk.AccAddress) error + OnSendPacket func(ctx context.Context, sourceID string, destinationID string, sequence uint64, data channeltypesv2.PacketData, signer sdk.AccAddress) error + OnRecvPacket func(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, relayer sdk.AccAddress) channeltypesv2.RecvPacketResult + OnTimeoutPacket func(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, relayer sdk.AccAddress) error + OnAcknowledgementPacket func(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, acknowledgement []byte, relayer sdk.AccAddress) error } diff --git a/testing/mock/v2/ibc_module.go b/testing/mock/v2/ibc_module.go index 0e948daa471..cb797c592bc 100644 --- a/testing/mock/v2/ibc_module.go +++ b/testing/mock/v2/ibc_module.go @@ -49,14 +49,12 @@ func (im IBCModule) OnRecvPacket(ctx context.Context, sourceID string, destinati } } -// -// func (im IBCModule) OnAcknowledgementPacket() error { -// if im.IBCApp.OnAcknowledgementPacket != nil { -// return im.IBCApp.OnAcknowledgementPacket(...) -// } -// return nil -// } -// +func (im IBCModule) OnAcknowledgementPacket(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, acknowledgement []byte, relayer sdk.AccAddress) error { + if im.IBCApp.OnAcknowledgementPacket != nil { + return im.IBCApp.OnAcknowledgementPacket(ctx, sourceID, destinationID, data, acknowledgement, relayer) + } + return nil +} func (im IBCModule) OnTimeoutPacket(ctx context.Context, sourceID string, destinationID string, data channeltypesv2.PacketData, relayer sdk.AccAddress) error { if im.IBCApp.OnTimeoutPacket != nil { From a539936471e22b91da7e15fe8a359a95566a89c3 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Mon, 14 Oct 2024 12:32:04 +0200 Subject: [PATCH 3/3] nit: reorder proto msgs (#7446) --- modules/core/04-channel/v2/types/tx.pb.go | 1461 +++++++++++---------- proto/ibc/core/channel/v2/tx.proto | 82 +- 2 files changed, 772 insertions(+), 771 deletions(-) diff --git a/modules/core/04-channel/v2/types/tx.pb.go b/modules/core/04-channel/v2/types/tx.pb.go index b8b915f78bc..df9610f29a7 100644 --- a/modules/core/04-channel/v2/types/tx.pb.go +++ b/modules/core/04-channel/v2/types/tx.pb.go @@ -32,6 +32,170 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// 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 + +// MsgProvideCounterparty defines the message used to provide the counterparty client +// identifier. Can only be invoked one time by the signer of MsgCreateClient if the counterparty +// client identifier was not provided in the initial MsgCreateClient message. +type MsgProvideCounterparty 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 *MsgProvideCounterparty) Reset() { *m = MsgProvideCounterparty{} } +func (m *MsgProvideCounterparty) String() string { return proto.CompactTextString(m) } +func (*MsgProvideCounterparty) ProtoMessage() {} +func (*MsgProvideCounterparty) Descriptor() ([]byte, []int) { + return fileDescriptor_d421c7119e969b99, []int{2} +} +func (m *MsgProvideCounterparty) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgProvideCounterparty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgProvideCounterparty.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 *MsgProvideCounterparty) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgProvideCounterparty.Merge(m, src) +} +func (m *MsgProvideCounterparty) XXX_Size() int { + return m.Size() +} +func (m *MsgProvideCounterparty) XXX_DiscardUnknown() { + xxx_messageInfo_MsgProvideCounterparty.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgProvideCounterparty proto.InternalMessageInfo + +// MsgProvideCounterpartyResponse defines the Msg/ProvideCounterparty response type. +type MsgProvideCounterpartyResponse struct { +} + +func (m *MsgProvideCounterpartyResponse) Reset() { *m = MsgProvideCounterpartyResponse{} } +func (m *MsgProvideCounterpartyResponse) String() string { return proto.CompactTextString(m) } +func (*MsgProvideCounterpartyResponse) ProtoMessage() {} +func (*MsgProvideCounterpartyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d421c7119e969b99, []int{3} +} +func (m *MsgProvideCounterpartyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgProvideCounterpartyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgProvideCounterpartyResponse.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 *MsgProvideCounterpartyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgProvideCounterpartyResponse.Merge(m, src) +} +func (m *MsgProvideCounterpartyResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgProvideCounterpartyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgProvideCounterpartyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgProvideCounterpartyResponse proto.InternalMessageInfo + // MsgSendPacket sends an outgoing IBC packet. type MsgSendPacket struct { SourceChannel string `protobuf:"bytes,1,opt,name=source_channel,json=sourceChannel,proto3" json:"source_channel,omitempty"` @@ -44,7 +208,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{0} + return fileDescriptor_d421c7119e969b99, []int{4} } func (m *MsgSendPacket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -82,7 +246,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{1} + return fileDescriptor_d421c7119e969b99, []int{5} } func (m *MsgSendPacketResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -123,7 +287,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{2} + return fileDescriptor_d421c7119e969b99, []int{6} } func (m *MsgRecvPacket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -161,7 +325,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{3} + return fileDescriptor_d421c7119e969b99, []int{7} } func (m *MsgRecvPacketResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -203,7 +367,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{4} + return fileDescriptor_d421c7119e969b99, []int{8} } func (m *MsgTimeout) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -241,7 +405,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{5} + return fileDescriptor_d421c7119e969b99, []int{9} } func (m *MsgTimeoutResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -283,7 +447,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{6} + return fileDescriptor_d421c7119e969b99, []int{10} } func (m *MsgAcknowledgement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -300,199 +464,35 @@ func (m *MsgAcknowledgement) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *MsgAcknowledgement) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgAcknowledgement.Merge(m, src) -} -func (m *MsgAcknowledgement) XXX_Size() int { - return m.Size() -} -func (m *MsgAcknowledgement) XXX_DiscardUnknown() { - xxx_messageInfo_MsgAcknowledgement.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgAcknowledgement proto.InternalMessageInfo - -// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. -type MsgAcknowledgementResponse struct { - Result types1.ResponseResultType `protobuf:"varint,1,opt,name=result,proto3,enum=ibc.core.channel.v1.ResponseResultType" json:"result,omitempty"` -} - -func (m *MsgAcknowledgementResponse) Reset() { *m = MsgAcknowledgementResponse{} } -func (m *MsgAcknowledgementResponse) String() string { return proto.CompactTextString(m) } -func (*MsgAcknowledgementResponse) ProtoMessage() {} -func (*MsgAcknowledgementResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d421c7119e969b99, []int{7} -} -func (m *MsgAcknowledgementResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgAcknowledgementResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgAcknowledgementResponse.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 *MsgAcknowledgementResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgAcknowledgementResponse.Merge(m, src) -} -func (m *MsgAcknowledgementResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgAcknowledgementResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgAcknowledgementResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgAcknowledgementResponse proto.InternalMessageInfo - -// MsgProvideCounterparty defines the message used to provide the counterparty client -// identifier. Can only be invoked one time by the signer of MsgCreateClient if the counterparty -// client identifier was not provided in the initial MsgCreateClient message. -type MsgProvideCounterparty 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 *MsgProvideCounterparty) Reset() { *m = MsgProvideCounterparty{} } -func (m *MsgProvideCounterparty) String() string { return proto.CompactTextString(m) } -func (*MsgProvideCounterparty) ProtoMessage() {} -func (*MsgProvideCounterparty) Descriptor() ([]byte, []int) { - return fileDescriptor_d421c7119e969b99, []int{8} -} -func (m *MsgProvideCounterparty) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgProvideCounterparty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgProvideCounterparty.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 *MsgProvideCounterparty) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgProvideCounterparty.Merge(m, src) -} -func (m *MsgProvideCounterparty) XXX_Size() int { - return m.Size() -} -func (m *MsgProvideCounterparty) XXX_DiscardUnknown() { - xxx_messageInfo_MsgProvideCounterparty.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgProvideCounterparty proto.InternalMessageInfo - -// MsgProvideCounterpartyResponse defines the Msg/ProvideCounterparty response type. -type MsgProvideCounterpartyResponse struct { -} - -func (m *MsgProvideCounterpartyResponse) Reset() { *m = MsgProvideCounterpartyResponse{} } -func (m *MsgProvideCounterpartyResponse) String() string { return proto.CompactTextString(m) } -func (*MsgProvideCounterpartyResponse) ProtoMessage() {} -func (*MsgProvideCounterpartyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d421c7119e969b99, []int{9} -} -func (m *MsgProvideCounterpartyResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgProvideCounterpartyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgProvideCounterpartyResponse.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 *MsgProvideCounterpartyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgProvideCounterpartyResponse.Merge(m, src) -} -func (m *MsgProvideCounterpartyResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgProvideCounterpartyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgProvideCounterpartyResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgProvideCounterpartyResponse proto.InternalMessageInfo - -// 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{10} -} -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 *MsgAcknowledgement) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAcknowledgement.Merge(m, src) } -func (m *MsgCreateChannel) XXX_Size() int { +func (m *MsgAcknowledgement) XXX_Size() int { return m.Size() } -func (m *MsgCreateChannel) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateChannel.DiscardUnknown(m) +func (m *MsgAcknowledgement) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAcknowledgement.DiscardUnknown(m) } -var xxx_messageInfo_MsgCreateChannel proto.InternalMessageInfo +var xxx_messageInfo_MsgAcknowledgement 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"` +// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. +type MsgAcknowledgementResponse struct { + Result types1.ResponseResultType `protobuf:"varint,1,opt,name=result,proto3,enum=ibc.core.channel.v1.ResponseResultType" json:"result,omitempty"` } -func (m *MsgCreateChannelResponse) Reset() { *m = MsgCreateChannelResponse{} } -func (m *MsgCreateChannelResponse) String() string { return proto.CompactTextString(m) } -func (*MsgCreateChannelResponse) ProtoMessage() {} -func (*MsgCreateChannelResponse) Descriptor() ([]byte, []int) { +func (m *MsgAcknowledgementResponse) Reset() { *m = MsgAcknowledgementResponse{} } +func (m *MsgAcknowledgementResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAcknowledgementResponse) ProtoMessage() {} +func (*MsgAcknowledgementResponse) Descriptor() ([]byte, []int) { return fileDescriptor_d421c7119e969b99, []int{11} } -func (m *MsgCreateChannelResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgAcknowledgementResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgCreateChannelResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgAcknowledgementResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgCreateChannelResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgAcknowledgementResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -502,19 +502,23 @@ func (m *MsgCreateChannelResponse) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *MsgCreateChannelResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateChannelResponse.Merge(m, src) +func (m *MsgAcknowledgementResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAcknowledgementResponse.Merge(m, src) } -func (m *MsgCreateChannelResponse) XXX_Size() int { +func (m *MsgAcknowledgementResponse) XXX_Size() int { return m.Size() } -func (m *MsgCreateChannelResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateChannelResponse.DiscardUnknown(m) +func (m *MsgAcknowledgementResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAcknowledgementResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgCreateChannelResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgAcknowledgementResponse proto.InternalMessageInfo func init() { + proto.RegisterType((*MsgCreateChannel)(nil), "ibc.core.channel.v2.MsgCreateChannel") + proto.RegisterType((*MsgCreateChannelResponse)(nil), "ibc.core.channel.v2.MsgCreateChannelResponse") + proto.RegisterType((*MsgProvideCounterparty)(nil), "ibc.core.channel.v2.MsgProvideCounterparty") + proto.RegisterType((*MsgProvideCounterpartyResponse)(nil), "ibc.core.channel.v2.MsgProvideCounterpartyResponse") 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") @@ -523,18 +527,14 @@ func init() { proto.RegisterType((*MsgTimeoutResponse)(nil), "ibc.core.channel.v2.MsgTimeoutResponse") proto.RegisterType((*MsgAcknowledgement)(nil), "ibc.core.channel.v2.MsgAcknowledgement") proto.RegisterType((*MsgAcknowledgementResponse)(nil), "ibc.core.channel.v2.MsgAcknowledgementResponse") - proto.RegisterType((*MsgProvideCounterparty)(nil), "ibc.core.channel.v2.MsgProvideCounterparty") - proto.RegisterType((*MsgProvideCounterpartyResponse)(nil), "ibc.core.channel.v2.MsgProvideCounterpartyResponse") - proto.RegisterType((*MsgCreateChannel)(nil), "ibc.core.channel.v2.MsgCreateChannel") - proto.RegisterType((*MsgCreateChannelResponse)(nil), "ibc.core.channel.v2.MsgCreateChannelResponse") } func init() { proto.RegisterFile("ibc/core/channel/v2/tx.proto", fileDescriptor_d421c7119e969b99) } var fileDescriptor_d421c7119e969b99 = []byte{ - // 912 bytes of a gzipped FileDescriptorProto + // 914 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x41, 0x6f, 0xdc, 0x44, - 0x14, 0x8e, 0xb3, 0xdb, 0xd0, 0xbc, 0x4d, 0x9a, 0xc5, 0xa5, 0xed, 0xca, 0x85, 0xdd, 0xd5, 0x8a, + 0x14, 0x5e, 0x27, 0xdb, 0xd0, 0xbc, 0x4d, 0x9a, 0xc5, 0xa5, 0xed, 0xca, 0x85, 0xdd, 0xd5, 0x8a, 0x2a, 0x21, 0x25, 0x36, 0x71, 0x11, 0x52, 0x2a, 0xa4, 0xaa, 0x5d, 0x84, 0xe8, 0x61, 0xa5, 0xc8, 0x09, 0x3d, 0x00, 0xc2, 0xf2, 0xda, 0xaf, 0x5e, 0x2b, 0x6b, 0x8f, 0xf1, 0xcc, 0xba, 0xc9, 0x0d, 0x71, 0xe2, 0x84, 0x38, 0x72, 0xe4, 0x27, 0xe4, 0xc0, 0x8f, 0xe8, 0xb1, 0x07, 0x0e, 0x9c, 0x10, @@ -545,51 +545,52 @@ var fileDescriptor_d421c7119e969b99 = []byte{ 0x37, 0xb2, 0x37, 0x01, 0xd5, 0xee, 0xb8, 0x84, 0x86, 0x84, 0x1a, 0x21, 0xf5, 0x8d, 0x74, 0x3b, 0x7b, 0x48, 0x47, 0xb7, 0x2a, 0x43, 0xec, 0xb8, 0x07, 0xc8, 0x24, 0xa2, 0xa2, 0x86, 0xed, 0xbc, 0x06, 0xad, 0x53, 0x78, 0xc7, 0x01, 0x46, 0x2c, 0x73, 0x8a, 0x37, 0x09, 0x58, 0x2f, 0x00, 0x24, - 0x0c, 0x03, 0x16, 0x72, 0x90, 0x59, 0xfa, 0x12, 0xc0, 0xde, 0x9f, 0x0a, 0xac, 0x0e, 0xa8, 0xbf, - 0x87, 0x91, 0xb7, 0xcb, 0xf3, 0xab, 0xf7, 0xe0, 0x06, 0x25, 0x93, 0xc4, 0x45, 0x5b, 0x66, 0x6e, - 0x29, 0x5d, 0x65, 0x63, 0xd9, 0x5a, 0x15, 0xd6, 0xbe, 0x30, 0xaa, 0xf7, 0xe1, 0x5d, 0x16, 0x84, - 0x48, 0x26, 0xcc, 0xce, 0x9e, 0x94, 0x39, 0x61, 0xdc, 0x5a, 0xec, 0x2a, 0x1b, 0x75, 0xab, 0x29, - 0x1d, 0xfb, 0x53, 0xbb, 0xfa, 0x25, 0x34, 0x44, 0x77, 0xb6, 0xe7, 0x30, 0xa7, 0x55, 0xeb, 0xd6, - 0x36, 0x1a, 0x66, 0x47, 0xaf, 0x50, 0x52, 0x17, 0x55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0x69, 0x2b, 0xaf, 0x4e, 0xda, 0xca, 0x3f, 0x27, 0x6d, 0xe5, 0xd7, 0xd3, 0x76, + 0xed, 0xd5, 0x69, 0xbb, 0xf6, 0xd7, 0x69, 0xbb, 0xf6, 0xcd, 0xe7, 0x7e, 0xc0, 0x46, 0x93, 0x61, + 0x76, 0x91, 0x32, 0xe4, 0x3d, 0x32, 0x18, 0xba, 0x5b, 0x3e, 0x31, 0xd2, 0x1d, 0x23, 0x24, 0xde, + 0x64, 0x8c, 0x54, 0x5c, 0xf1, 0x3e, 0xf9, 0x74, 0xab, 0x7c, 0x51, 0x3d, 0x8a, 0x91, 0x0e, 0x97, + 0xf8, 0xf5, 0xee, 0xc1, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc7, 0xdf, 0x03, 0x0a, 0xcc, 0x0a, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -864,7 +865,7 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Metadata: "ibc/core/channel/v2/tx.proto", } -func (m *MsgSendPacket) Marshal() (dAtA []byte, err error) { +func (m *MsgCreateChannel) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -874,12 +875,12 @@ func (m *MsgSendPacket) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgSendPacket) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgCreateChannel) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgSendPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgCreateChannel) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -889,38 +890,29 @@ 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] = 0x1a } - if len(m.PacketData) > 0 { - for iNdEx := len(m.PacketData) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PacketData[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.MerklePathPrefix.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.SourceChannel) > 0 { - i -= len(m.SourceChannel) - copy(dAtA[i:], m.SourceChannel) - i = encodeVarintTx(dAtA, i, uint64(len(m.SourceChannel))) + 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))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MsgSendPacketResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgCreateChannelResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -930,25 +922,27 @@ func (m *MsgSendPacketResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgSendPacketResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgCreateChannelResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgSendPacketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgCreateChannelResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Sequence != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Sequence)) + 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] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MsgRecvPacket) Marshal() (dAtA []byte, err error) { +func (m *MsgProvideCounterparty) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -958,12 +952,12 @@ func (m *MsgRecvPacket) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgRecvPacket) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgProvideCounterparty) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgRecvPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgProvideCounterparty) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -973,39 +967,26 @@ func (m *MsgRecvPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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)) + dAtA[i] = 0x1a } - 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))) + 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] = 0x12 } - { - size, err := m.Packet.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) + 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 } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *MsgRecvPacketResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgProvideCounterpartyResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1015,25 +996,20 @@ func (m *MsgRecvPacketResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgRecvPacketResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgProvideCounterpartyResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgRecvPacketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgProvideCounterpartyResponse) 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) { +func (m *MsgSendPacket) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1043,12 +1019,12 @@ func (m *MsgTimeout) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgTimeout) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSendPacket) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgTimeout) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgSendPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1058,44 +1034,38 @@ func (m *MsgTimeout) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Signer) i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) i-- - dAtA[i] = 0x2a - } - if m.NextSequenceRecv != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.NextSequenceRecv)) - i-- - dAtA[i] = 0x20 + dAtA[i] = 0x22 } - { - size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.PacketData) > 0 { + for iNdEx := len(m.PacketData) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PacketData[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] = 0x1a - if len(m.ProofUnreceived) > 0 { - i -= len(m.ProofUnreceived) - copy(dAtA[i:], m.ProofUnreceived) - i = encodeVarintTx(dAtA, i, uint64(len(m.ProofUnreceived))) + if m.TimeoutTimestamp != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.TimeoutTimestamp)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } - { - size, err := m.Packet.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) + if len(m.SourceChannel) > 0 { + i -= len(m.SourceChannel) + copy(dAtA[i:], m.SourceChannel) + i = encodeVarintTx(dAtA, i, uint64(len(m.SourceChannel))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *MsgTimeoutResponse) 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]) @@ -1105,25 +1075,25 @@ func (m *MsgTimeoutResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgTimeoutResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgSendPacketResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgTimeoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgSendPacketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Result != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Result)) + if m.Sequence != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Sequence)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *MsgAcknowledgement) 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]) @@ -1133,12 +1103,12 @@ func (m *MsgAcknowledgement) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgAcknowledgement) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgRecvPacket) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgAcknowledgement) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgRecvPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1148,7 +1118,7 @@ func (m *MsgAcknowledgement) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Signer) i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x22 } { size, err := m.ProofHeight.MarshalToSizedBuffer(dAtA[:i]) @@ -1159,24 +1129,14 @@ func (m *MsgAcknowledgement) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 - if len(m.ProofAcked) > 0 { - i -= len(m.ProofAcked) - copy(dAtA[i:], m.ProofAcked) - i = encodeVarintTx(dAtA, i, uint64(len(m.ProofAcked))) + 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] = 0x1a - } - { - size, err := m.Acknowledgement.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 + dAtA[i] = 0x12 + } { size, err := m.Packet.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -1190,7 +1150,7 @@ func (m *MsgAcknowledgement) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgAcknowledgementResponse) 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]) @@ -1200,12 +1160,12 @@ func (m *MsgAcknowledgementResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgAcknowledgementResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgRecvPacketResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgAcknowledgementResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgRecvPacketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1218,7 +1178,7 @@ func (m *MsgAcknowledgementResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *MsgProvideCounterparty) 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]) @@ -1228,12 +1188,12 @@ func (m *MsgProvideCounterparty) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgProvideCounterparty) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgTimeout) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgProvideCounterparty) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgTimeout) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1243,26 +1203,44 @@ func (m *MsgProvideCounterparty) MarshalToSizedBuffer(dAtA []byte) (int, error) copy(dAtA[i:], m.Signer) i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x2a } - if len(m.CounterpartyChannelId) > 0 { - i -= len(m.CounterpartyChannelId) - copy(dAtA[i:], m.CounterpartyChannelId) - i = encodeVarintTx(dAtA, i, uint64(len(m.CounterpartyChannelId))) + if m.NextSequenceRecv != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.NextSequenceRecv)) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x20 } - if len(m.ChannelId) > 0 { - i -= len(m.ChannelId) - copy(dAtA[i:], m.ChannelId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ChannelId))) + { + 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] = 0xa + 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 *MsgProvideCounterpartyResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgTimeoutResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1272,20 +1250,25 @@ func (m *MsgProvideCounterpartyResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgProvideCounterpartyResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgTimeoutResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgProvideCounterpartyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgTimeoutResponse) 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 *MsgCreateChannel) Marshal() (dAtA []byte, err error) { +func (m *MsgAcknowledgement) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1295,12 +1278,12 @@ func (m *MsgCreateChannel) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgCreateChannel) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgAcknowledgement) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgCreateChannel) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgAcknowledgement) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1310,10 +1293,27 @@ func (m *MsgCreateChannel) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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] = 0x22 + if len(m.ProofAcked) > 0 { + i -= len(m.ProofAcked) + copy(dAtA[i:], m.ProofAcked) + i = encodeVarintTx(dAtA, i, uint64(len(m.ProofAcked))) + i-- dAtA[i] = 0x1a } { - size, err := m.MerklePathPrefix.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Acknowledgement.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1322,17 +1322,20 @@ func (m *MsgCreateChannel) MarshalToSizedBuffer(dAtA []byte) (int, error) { } 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))) - 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 *MsgCreateChannelResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgAcknowledgementResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1342,22 +1345,20 @@ func (m *MsgCreateChannelResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgCreateChannelResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgAcknowledgementResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgCreateChannelResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgAcknowledgementResponse) 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.Result != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Result)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } return len(dAtA) - i, nil } @@ -1373,25 +1374,18 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *MsgSendPacket) Size() (n int) { +func (m *MsgCreateChannel) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.SourceChannel) + l = len(m.ClientId) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.TimeoutTimestamp != 0 { - n += 1 + sovTx(uint64(m.TimeoutTimestamp)) - } - if len(m.PacketData) > 0 { - for _, e := range m.PacketData { - l = e.Size() - 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)) @@ -1399,32 +1393,33 @@ func (m *MsgSendPacket) Size() (n int) { return n } -func (m *MsgSendPacketResponse) Size() (n int) { +func (m *MsgCreateChannelResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Sequence != 0 { - n += 1 + sovTx(uint64(m.Sequence)) + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } return n } -func (m *MsgRecvPacket) Size() (n int) { +func (m *MsgProvideCounterparty) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.Packet.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.ProofCommitment) + 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 = m.ProofHeight.Size() - n += 1 + l + sovTx(uint64(l)) l = len(m.Signer) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -1432,34 +1427,33 @@ func (m *MsgRecvPacket) Size() (n int) { return n } -func (m *MsgRecvPacketResponse) Size() (n int) { +func (m *MsgProvideCounterpartyResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Result != 0 { - n += 1 + sovTx(uint64(m.Result)) - } return n } -func (m *MsgTimeout) Size() (n int) { +func (m *MsgSendPacket) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.Packet.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.ProofUnreceived) + l = len(m.SourceChannel) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = m.ProofHeight.Size() - n += 1 + l + sovTx(uint64(l)) - if m.NextSequenceRecv != 0 { - n += 1 + sovTx(uint64(m.NextSequenceRecv)) + if m.TimeoutTimestamp != 0 { + n += 1 + sovTx(uint64(m.TimeoutTimestamp)) + } + if len(m.PacketData) > 0 { + for _, e := range m.PacketData { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } } l = len(m.Signer) if l > 0 { @@ -1468,19 +1462,19 @@ func (m *MsgTimeout) Size() (n int) { return n } -func (m *MsgTimeoutResponse) Size() (n int) { +func (m *MsgSendPacketResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Result != 0 { - n += 1 + sovTx(uint64(m.Result)) + if m.Sequence != 0 { + n += 1 + sovTx(uint64(m.Sequence)) } return n } -func (m *MsgAcknowledgement) Size() (n int) { +func (m *MsgRecvPacket) Size() (n int) { if m == nil { return 0 } @@ -1488,9 +1482,7 @@ func (m *MsgAcknowledgement) Size() (n int) { _ = l l = m.Packet.Size() n += 1 + l + sovTx(uint64(l)) - l = m.Acknowledgement.Size() - n += 1 + l + sovTx(uint64(l)) - l = len(m.ProofAcked) + l = len(m.ProofCommitment) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -1503,7 +1495,7 @@ func (m *MsgAcknowledgement) Size() (n int) { return n } -func (m *MsgAcknowledgementResponse) Size() (n int) { +func (m *MsgRecvPacketResponse) Size() (n int) { if m == nil { return 0 } @@ -1515,19 +1507,22 @@ func (m *MsgAcknowledgementResponse) Size() (n int) { return n } -func (m *MsgProvideCounterparty) Size() (n int) { +func (m *MsgTimeout) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ChannelId) + l = m.Packet.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.ProofUnreceived) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.CounterpartyChannelId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + l = m.ProofHeight.Size() + n += 1 + l + sovTx(uint64(l)) + if m.NextSequenceRecv != 0 { + n += 1 + sovTx(uint64(m.NextSequenceRecv)) } l = len(m.Signer) if l > 0 { @@ -1536,26 +1531,33 @@ func (m *MsgProvideCounterparty) Size() (n int) { return n } -func (m *MsgProvideCounterpartyResponse) Size() (n int) { +func (m *MsgTimeoutResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l + if m.Result != 0 { + n += 1 + sovTx(uint64(m.Result)) + } return n } -func (m *MsgCreateChannel) Size() (n int) { +func (m *MsgAcknowledgement) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ClientId) + l = m.Packet.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.Acknowledgement.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.ProofAcked) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = m.MerklePathPrefix.Size() + l = m.ProofHeight.Size() n += 1 + l + sovTx(uint64(l)) l = len(m.Signer) if l > 0 { @@ -1564,15 +1566,14 @@ func (m *MsgCreateChannel) Size() (n int) { return n } -func (m *MsgCreateChannelResponse) Size() (n int) { +func (m *MsgAcknowledgementResponse) 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)) + if m.Result != 0 { + n += 1 + sovTx(uint64(m.Result)) } return n } @@ -1583,7 +1584,7 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MsgSendPacket) Unmarshal(dAtA []byte) error { +func (m *MsgCreateChannel) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1606,15 +1607,15 @@ func (m *MsgSendPacket) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSendPacket: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreateChannel: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSendPacket: illegal tag %d (wire type %d)", fieldNum, wire) + 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 SourceChannel", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1639,33 +1640,14 @@ func (m *MsgSendPacket) Unmarshal(dAtA []byte) error { if postIndex < 0 { return ErrInvalidLengthTx } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SourceChannel = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeoutTimestamp", wireType) - } - m.TimeoutTimestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TimeoutTimestamp |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: + 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 PacketData", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MerklePathPrefix", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1692,12 +1674,11 @@ func (m *MsgSendPacket) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.PacketData = append(m.PacketData, PacketData{}) - if err := m.PacketData[len(m.PacketData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.MerklePathPrefix.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -1750,7 +1731,7 @@ func (m *MsgSendPacket) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSendPacketResponse) Unmarshal(dAtA []byte) error { +func (m *MsgCreateChannelResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1773,17 +1754,17 @@ func (m *MsgSendPacketResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSendPacketResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreateChannelResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSendPacketResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCreateChannelResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) } - m.Sequence = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1793,11 +1774,24 @@ func (m *MsgSendPacketResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Sequence |= uint64(b&0x7F) << shift + 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:]) @@ -1819,7 +1813,7 @@ func (m *MsgSendPacketResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgRecvPacket) Unmarshal(dAtA []byte) error { +func (m *MsgProvideCounterparty) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1842,17 +1836,17 @@ func (m *MsgRecvPacket) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgRecvPacket: wiretype end group for non-group") + return fmt.Errorf("proto: MsgProvideCounterparty: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRecvPacket: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgProvideCounterparty: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Packet", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1862,30 +1856,29 @@ func (m *MsgRecvPacket) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Packet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ChannelId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofCommitment", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyChannelId", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1895,60 +1888,25 @@ func (m *MsgRecvPacket) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.ProofCommitment = append(m.ProofCommitment[:0], dAtA[iNdEx:postIndex]...) - if m.ProofCommitment == nil { - m.ProofCommitment = []byte{} - } + m.CounterpartyChannelId = string(dAtA[iNdEx:postIndex]) 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 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.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -2001,7 +1959,7 @@ func (m *MsgRecvPacket) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgRecvPacketResponse) Unmarshal(dAtA []byte) error { +func (m *MsgProvideCounterpartyResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2024,31 +1982,12 @@ func (m *MsgRecvPacketResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgRecvPacketResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgProvideCounterpartyResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRecvPacketResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgProvideCounterpartyResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) - } - m.Result = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Result |= types1.ResponseResultType(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -2070,7 +2009,7 @@ func (m *MsgRecvPacketResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgTimeout) Unmarshal(dAtA []byte) error { +func (m *MsgSendPacket) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2093,17 +2032,17 @@ func (m *MsgTimeout) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgTimeout: wiretype end group for non-group") + return fmt.Errorf("proto: MsgSendPacket: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgTimeout: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgSendPacket: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Packet", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SourceChannel", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2113,30 +2052,29 @@ func (m *MsgTimeout) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Packet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.SourceChannel = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofUnreceived", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutTimestamp", wireType) } - var byteLen int + m.TimeoutTimestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2146,29 +2084,14 @@ func (m *MsgTimeout) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + m.TimeoutTimestamp |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProofUnreceived = append(m.ProofUnreceived[:0], dAtA[iNdEx:postIndex]...) - if m.ProofUnreceived == nil { - m.ProofUnreceived = []byte{} - } - iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PacketData", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2195,30 +2118,12 @@ func (m *MsgTimeout) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.PacketData = append(m.PacketData, PacketData{}) + if err := m.PacketData[len(m.PacketData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NextSequenceRecv", wireType) - } - m.NextSequenceRecv = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NextSequenceRecv |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -2271,7 +2176,7 @@ func (m *MsgTimeout) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgTimeoutResponse) Unmarshal(dAtA []byte) error { +func (m *MsgSendPacketResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2294,17 +2199,17 @@ func (m *MsgTimeoutResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgTimeoutResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgSendPacketResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgTimeoutResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgSendPacketResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) } - m.Result = 0 + m.Sequence = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2314,7 +2219,7 @@ func (m *MsgTimeoutResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Result |= types1.ResponseResultType(b&0x7F) << shift + m.Sequence |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2340,7 +2245,7 @@ func (m *MsgTimeoutResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgAcknowledgement) Unmarshal(dAtA []byte) error { +func (m *MsgRecvPacket) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2363,48 +2268,15 @@ func (m *MsgAcknowledgement) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgAcknowledgement: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRecvPacket: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAcknowledgement: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRecvPacket: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Packet", 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.Packet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Acknowledgement", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Packet", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2431,13 +2303,13 @@ func (m *MsgAcknowledgement) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Acknowledgement.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Packet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofAcked", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProofCommitment", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -2464,12 +2336,12 @@ func (m *MsgAcknowledgement) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ProofAcked = append(m.ProofAcked[:0], dAtA[iNdEx:postIndex]...) - if m.ProofAcked == nil { - m.ProofAcked = []byte{} + m.ProofCommitment = append(m.ProofCommitment[:0], dAtA[iNdEx:postIndex]...) + if m.ProofCommitment == nil { + m.ProofCommitment = []byte{} } iNdEx = postIndex - case 4: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ProofHeight", wireType) } @@ -2502,7 +2374,7 @@ func (m *MsgAcknowledgement) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -2555,7 +2427,7 @@ func (m *MsgAcknowledgement) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgAcknowledgementResponse) Unmarshal(dAtA []byte) error { +func (m *MsgRecvPacketResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2578,10 +2450,10 @@ func (m *MsgAcknowledgementResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgAcknowledgementResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgRecvPacketResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgAcknowledgementResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgRecvPacketResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2624,7 +2496,7 @@ func (m *MsgAcknowledgementResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgProvideCounterparty) Unmarshal(dAtA []byte) error { +func (m *MsgTimeout) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2647,17 +2519,17 @@ func (m *MsgProvideCounterparty) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgProvideCounterparty: wiretype end group for non-group") + return fmt.Errorf("proto: MsgTimeout: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgProvideCounterparty: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgTimeout: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Packet", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2667,29 +2539,30 @@ func (m *MsgProvideCounterparty) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.ChannelId = string(dAtA[iNdEx:postIndex]) + if err := m.Packet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyChannelId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProofUnreceived", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2699,25 +2572,79 @@ func (m *MsgProvideCounterparty) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.CounterpartyChannelId = string(dAtA[iNdEx:postIndex]) + m.ProofUnreceived = append(m.ProofUnreceived[:0], dAtA[iNdEx:postIndex]...) + if m.ProofUnreceived == nil { + m.ProofUnreceived = []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 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.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NextSequenceRecv", wireType) + } + m.NextSequenceRecv = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NextSequenceRecv |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -2770,7 +2697,7 @@ func (m *MsgProvideCounterparty) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgProvideCounterpartyResponse) Unmarshal(dAtA []byte) error { +func (m *MsgTimeoutResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2793,12 +2720,31 @@ func (m *MsgProvideCounterpartyResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgProvideCounterpartyResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgTimeoutResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgProvideCounterpartyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgTimeoutResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + m.Result = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Result |= types1.ResponseResultType(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -2820,7 +2766,7 @@ func (m *MsgProvideCounterpartyResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgCreateChannel) Unmarshal(dAtA []byte) error { +func (m *MsgAcknowledgement) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2843,17 +2789,17 @@ func (m *MsgCreateChannel) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreateChannel: wiretype end group for non-group") + return fmt.Errorf("proto: MsgAcknowledgement: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateChannel: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgAcknowledgement: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Packet", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -2863,27 +2809,28 @@ func (m *MsgCreateChannel) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.ClientId = string(dAtA[iNdEx:postIndex]) + if err := m.Packet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MerklePathPrefix", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Acknowledgement", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2910,11 +2857,78 @@ func (m *MsgCreateChannel) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.MerklePathPrefix.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Acknowledgement.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProofAcked", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProofAcked = append(m.ProofAcked[:0], dAtA[iNdEx:postIndex]...) + if m.ProofAcked == nil { + m.ProofAcked = []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 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.ProofHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -2967,7 +2981,7 @@ func (m *MsgCreateChannel) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgCreateChannelResponse) Unmarshal(dAtA []byte) error { +func (m *MsgAcknowledgementResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2990,17 +3004,17 @@ func (m *MsgCreateChannelResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreateChannelResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgAcknowledgementResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateChannelResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgAcknowledgementResponse: 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) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) } - var stringLen uint64 + m.Result = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -3010,24 +3024,11 @@ func (m *MsgCreateChannelResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.Result |= types1.ResponseResultType(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:]) diff --git a/proto/ibc/core/channel/v2/tx.proto b/proto/ibc/core/channel/v2/tx.proto index d72dbd9db2a..bd660849b88 100644 --- a/proto/ibc/core/channel/v2/tx.proto +++ b/proto/ibc/core/channel/v2/tx.proto @@ -34,6 +34,47 @@ 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; +} + +// MsgProvideCounterparty defines the message used to provide the counterparty client +// identifier. Can only be invoked one time by the signer of MsgCreateClient if the counterparty +// client identifier was not provided in the initial MsgCreateClient message. +message MsgProvideCounterparty { + 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; +} + +// MsgProvideCounterpartyResponse defines the Msg/ProvideCounterparty response type. +message MsgProvideCounterpartyResponse {} + // MsgSendPacket sends an outgoing IBC packet. message MsgSendPacket { option (cosmos.msg.v1.signer) = "signer"; @@ -110,44 +151,3 @@ message MsgAcknowledgementResponse { ibc.core.channel.v1.ResponseResultType result = 1; } - -// MsgProvideCounterparty defines the message used to provide the counterparty client -// identifier. Can only be invoked one time by the signer of MsgCreateClient if the counterparty -// client identifier was not provided in the initial MsgCreateClient message. -message MsgProvideCounterparty { - 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; -} - -// MsgProvideCounterpartyResponse defines the Msg/ProvideCounterparty response type. -message MsgProvideCounterpartyResponse {} - -// 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; -}