From ab7efcb5c649ece4208013303498512ac9a747a0 Mon Sep 17 00:00:00 2001 From: Andrew Gouin Date: Tue, 4 Oct 2022 17:30:41 -0600 Subject: [PATCH 1/3] MsgTransferResponse add sequence (#2377) ## Description Returns sequence from `sendTransfer`, and returns it with the `MsgTransferResponse`. This is not an API breaking change. Retrieving the sequence at the time of creating the transfer is necessary in the packet forward middleware for correlation with multihop packet flows. https://github.com/strangelove-ventures/packet-forward-middleware/pull/33 https://github.com/strangelove-ventures/ibctest/pull/306 Closes #1969 --- - [x] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] Linked to Github issue with discussion and accepted design OR link to spec that describes this work. - [x] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/structure.md). - [x] Wrote unit and integration [tests](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#testing) Existing test coverage exercises this new method due to the re-routing of `SendTransfer` through `SendPacketTransfer` - [x] Updated relevant documentation (`docs/`) or specification (`x//spec/`) - [x] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code). - [x] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md` - [x] Re-reviewed `Files changed` in the Github PR explorer - [x] Review `Codecov Report` in the comment section below once CI passes (cherry picked from commit 33639176c35fa421c4affbbc26f7f6fab10cdfe3) # Conflicts: # CHANGELOG.md # modules/apps/transfer/keeper/msg_server.go # modules/apps/transfer/keeper/relay.go # modules/apps/transfer/types/tx.pb.go --- CHANGELOG.md | 103 ++++++++++++++++++ docs/ibc/proto-docs.md | 5 + modules/apps/transfer/keeper/msg_server.go | 9 +- .../apps/transfer/keeper/msg_server_test.go | 1 + modules/apps/transfer/keeper/relay.go | 50 +++++++-- modules/apps/transfer/types/tx.pb.go | 72 ++++++++++++ proto/ibc/applications/transfer/v1/tx.proto | 5 +- 7 files changed, 233 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a38758f4f44..6e1c54d584c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,109 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Dependencies +<<<<<<< HEAD +======= +* [\#2458](https://github.com/cosmos/ibc-go/pull/2458) Bump Cosmos SDK to v0.46.2 + +### API Breaking + +* (apps/29-fee) [\#2395](https://github.com/cosmos/ibc-go/pull/2395) Remove param space from ics29 NewKeeper function. The field was unused. +* (apps/27-interchain-accounts) [\#2133](https://github.com/cosmos/ibc-go/pull/2133) Generates genesis protos in a separate directory to avoid circular import errors. The protobuf package name has changed for the genesis types. +* (light-clients/tendermint)[\#1768](https://github.com/cosmos/ibc-go/pull/1768) Removed `AllowUpdateAfterExpiry`, `AllowUpdateAfterMisbehaviour` booleans as they are deprecated (see ADR026) +* (06-solomachine) [\#1679](https://github.com/cosmos/ibc-go/pull/1679) Remove `types` sub-package from `06-solomachine` lightclient directory. +* (07-tendermint) [\#1677](https://github.com/cosmos/ibc-go/pull/1677) Remove `types` sub-package from `07-tendermint` lightclient directory. +* (06-solomachine) [\#1687](https://github.com/cosmos/ibc-go/pull/1687) Bump `06-solomachine` protobuf version from `v2` to `v3`. +* (06-solomachine) [\#1687](https://github.com/cosmos/ibc-go/pull/1687) Removed `DataType` enum and associated message types from `06-solomachine`. `DataType` has been removed from `SignBytes` and `SignatureAndData` in favour of `path`. +* (02-client) [\#598](https://github.com/cosmos/ibc-go/pull/598) The client state and consensus state return value has been removed from `VerifyUpgradeAndUpdateState`. Light client implementations must update the client state and consensus state after verifying a valid client upgrade. +* (06-solomachine) [\#1100](https://github.com/cosmos/ibc-go/pull/1100) Remove `GetClientID` function from 06-solomachine `Misbehaviour` type. +* (06-solomachine) [\#1100](https://github.com/cosmos/ibc-go/pull/1100) Deprecate `ClientId` field in 06-solomachine `Misbehaviour` type. +* (07-tendermint) [\#1097](https://github.com/cosmos/ibc-go/pull/1097) Remove `GetClientID` function from 07-tendermint `Misbehaviour` type. +* (07-tendermint) [\#1097](https://github.com/cosmos/ibc-go/pull/1097) Deprecate `ClientId` field in 07-tendermint `Misbehaviour` type. +* (modules/core/exported) [\#1107](https://github.com/cosmos/ibc-go/pull/1107) Merging the `Header` and `Misbehaviour` interfaces into a single `ClientMessage` type. +* (06-solomachine)[\#1906](https://github.com/cosmos/ibc-go/pull/1906/files) Removed `AllowUpdateAfterProposal` boolean as it has been deprecated (see 01_concepts of the solo machine spec for more details). +* (07-tendermint) [\#1896](https://github.com/cosmos/ibc-go/pull/1896) Remove error return from `IterateConsensusStateAscending` in `07-tendermint`. +* (apps/27-interchain-accounts) [\#2035](https://github.com/cosmos/ibc-go/pull/2035) Interchain accounts host and controller Keepers now expects a keeper which fulfills the expected `ScopedKeeper` interface for the capability keeper. +* (transfer) [\#2034](https://github.com/cosmos/ibc-go/pull/2034) Transfer Keeper now expects a keeper which fulfills the expected `ScopedKeeper` interface for the capability keeper. +* (05-port) [\#2025](https://github.com/cosmos/ibc-go/pull/2025) Port Keeper now expects a keeper which fulfills the expected `ScopedKeeper` interface for the capability keeper. +* (04-channel) [\#2024](https://github.com/cosmos/ibc-go/pull/2024) Channel Keeper now expects a keeper which fulfills the expected `ScopedKeeper` interface for the capability keeper. +* (modules/apps/27-interchain-accounts) [\#2433](https://github.com/cosmos/ibc-go/pull/2450) Renamed icatypes.PortPrefix to icatypes.ControllerPortPrefix & icatypes.PortID to icatypes.HostPortID + +### State Machine Breaking + +* (transfer) [\#2377](https://github.com/cosmos/ibc-go/pull/2377) Adding `sequence` to `MsgTransferResponse`. + +### Improvements + +* (modules/light-clients/07-tendermint) [\#1713](https://github.com/cosmos/ibc-go/pull/1713) Allow client upgrade proposals to update `TrustingPeriod`. See ADR-026 for context. +* (modules/core/02-client) [\#1188](https://github.com/cosmos/ibc-go/pull/1188/files) Routing `MsgSubmitMisbehaviour` to `UpdateClient` keeper function. Deprecating `SubmitMisbehaviour` endpoint. +* (modules/core/02-client) [\#1208](https://github.com/cosmos/ibc-go/pull/1208) Replace `CheckHeaderAndUpdateState` usage in 02-client with calls to `VerifyClientMessage`, `CheckForMisbehaviour`, `UpdateStateOnMisbehaviour` and `UpdateState`. +* (modules/light-clients/09-localhost) [\#1187](https://github.com/cosmos/ibc-go/pull/1187/) Removing localhost light client implementation as it is not functional. An upgrade handler is provided in `modules/migrations/v5` to prune `09-localhost` clients and consensus states from the store. +* [\#1186](https://github.com/cosmos/ibc-go/pull/1186/files) Removing `GetRoot` function from ConsensusState interface in `02-client`. `GetRoot` is unused by core IBC. +* (modules/core/02-client) [\#1196](https://github.com/cosmos/ibc-go/pull/1196) Adding VerifyClientMessage to ClientState interface. +* (modules/core/02-client) [\#1198](https://github.com/cosmos/ibc-go/pull/1198) Adding UpdateStateOnMisbehaviour to ClientState interface. +* (modules/core/02-client) [\#1170](https://github.com/cosmos/ibc-go/pull/1170) Updating `ClientUpdateProposal` to set client state in lightclient implementations `CheckSubstituteAndUpdateState` methods. +* (modules/core/02-client) [\#1197](https://github.com/cosmos/ibc-go/pull/1197) Adding `CheckForMisbehaviour` to `ClientState` interface. +* (modules/core/02-client) [\#1195](https://github.com/cosmos/ibc-go/pull/1210) Removing `CheckHeaderAndUpdateState` from `ClientState` interface & associated light client implementations. +* (modules/core/02-client) [\#1189](https://github.com/cosmos/ibc-go/pull/1212) Removing `CheckMisbehaviourAndUpdateState` from `ClientState` interface & associated light client implementations. +* (modules/core/exported) [\#1206](https://github.com/cosmos/ibc-go/pull/1206) Adding new method `UpdateState` to `ClientState` interface. +* (modules/core/02-client) [\#1741](https://github.com/cosmos/ibc-go/pull/1741) Emitting a new `upgrade_chain` event upon setting upgrade consensus state. +* (client) [\#724](https://github.com/cosmos/ibc-go/pull/724) `IsRevisionFormat` and `IsClientIDFormat` have been updated to disallow newlines before the dash used to separate the chainID and revision number, and the client type and client sequence. +* (02-client/cli) [\#897](https://github.com/cosmos/ibc-go/pull/897) Remove `GetClientID()` from `Misbehaviour` interface. Submit client misbehaviour cli command requires an explicit client id now. +* (06-solomachine) [\#1972](https://github.com/cosmos/ibc-go/pull/1972) Solo machine implementation of `ZeroCustomFields` fn now panics as the fn is only used for upgrades which solo machine does not support. +* (apps/27-interchain-accounts) [\#2102](https://github.com/cosmos/ibc-go/pull/2102) ICS27 controller middleware now supports a nil underlying application. This allows chains to make use of interchain accounts with existing auth mechanisms such as x/group and x/gov. +* (apps/27-interchain-accounts) [\#2146](https://github.com/cosmos/ibc-go/pull/2146) ICS27 controller now claims the channel capability passed via ibc core, and passes `nil` to the underlying app callback. The channel capability arg in `SendTx` is now ignored and looked up internally. +* (apps/27-interchain-accounts) [\#2134](https://github.com/cosmos/ibc-go/pull/2134) Adding upgrade handler to ICS27 `controller` submodule for migration of channel capabilities. This upgrade handler migrates ownership of channel capabilities from the underlying application to the ICS27 `controller` submodule. +* (apps/27-interchain-accounts) [\#2157](https://github.com/cosmos/ibc-go/pull/2157) Adding `IsMiddlewareEnabled` functionality to enforce calls to ICS27 msg server to *not* route to the underlying application. +* (apps/27-interchain-accounts) [\#2177](https://github.com/cosmos/ibc-go/pull/2177) Adding `IsMiddlewareEnabled` flag to interchain accounts `ActiveChannel` genesis type. +* (apps/27-interchain-accounts) [\#2140](https://github.com/cosmos/ibc-go/pull/2140) Adding migration handler to ICS27 `controller` submodule to assert ownership of channel capabilities and set middleware enabled flag for existing channels. The ICS27 module consensus version has been bumped from 1 to 2. +* (core/04-channel) [\#2304](https://github.com/cosmos/ibc-go/pull/2304) Adding `GetAllChannelsWithPortPrefix` function which filters channels based on a provided port prefix. +* (apps/27-interchain-accounts) [\#2290](https://github.com/cosmos/ibc-go/pull/2290) Changed `DefaultParams` function in `host` submodule to allow all messages by default. Defined a constant named `AllowAllHostMsgs` for `host` module to keep wildcard "*" string which allows all messages. +* (apps/27-interchain-accounts) [\#2248](https://github.com/cosmos/ibc-go/pull/2248) Adding call to underlying app in `OnChanCloseConfirm` callback of the controller submodule and adding relevant unit tests. +* (apps/27-interchain-accounts) [\#2251](https://github.com/cosmos/ibc-go/pull/2251) Adding `msgServer` struct to controller submodule that embeds the `Keeper` struct. +* (light-clients/06-solomachine) Moving `verifyMisbehaviour` function from update.go to misbehaviour_handle.go. +* (apps/27-interchain-accounts) [\#2297](https://github.com/cosmos/ibc-go/pull/2297) Adding cli command to generate ICS27 packet data. +* (modules/core/keeper) [\#1728](https://github.com/cosmos/ibc-go/pull/2399) Updated channel callback errors to include portID & channelID for better identification of errors. + +### Features + +* (apps/27-interchain-accounts) [\#2147](https://github.com/cosmos/ibc-go/pull/2147) Adding a `SubmitTx` gRPC endpoint for the ICS27 Controller module which allows owners of interchain accounts to submit transactions. This replaces the previously existing need for authentication modules to implement this standard functionality. +* (testing/simapp) [\#2190](https://github.com/cosmos/ibc-go/pull/2190) Adding the new `x/group` cosmos-sdk module to simapp. + +### Bug Fixes + +* (light-clients/solomachine) [#1839](https://github.com/cosmos/ibc-go/issues/1839) Fixed usage of the new diversifier in validation of changing diversifiers for the solo machine. The current diversifier must sign over the new diversifier. +* (light-clients/07-tendermint) [\#1674](https://github.com/cosmos/ibc-go/pull/1674) Submitted ClientState is zeroed out before checking the proof in order to prevent the proposal from containing information governance is not actually voting on. +* (modules/core/02-client)[\#1676](https://github.com/cosmos/ibc-go/pull/1676) ClientState must be zeroed out for `UpgradeProposals` to pass validation. This prevents a proposal containing information governance is not actually voting on. +* (modules/core/keeper) [\#2403](https://github.com/cosmos/ibc-go/pull/2403) Added a function in keeper to cater for blank pointers. + +## [v4.1.0](https://github.com/cosmos/ibc-go/releases/tag/v4.1.0) - 2022-09-20 + +### Dependencies + +* [\#2288](https://github.com/cosmos/ibc-go/pull/2288) Bump SDK version to v0.45.8 and Tendermint to v0.34.21. + +### Features + +* (apps/27-interchain-accounts) [\#2193](https://github.com/cosmos/ibc-go/pull/2193) Adding `InterchainAccount` gRPC query endpont to ICS27 `controller` submodule to allow users to retrieve registered interchain account addresses. + +### Bug Fixes + +* (27-interchain-accounts) [\#2308](https://github.com/cosmos/ibc-go/pull/2308) Nil checks have been added to ensure services are not registered for nil host or controller keepers. + +## [v4.0.1](https://github.com/cosmos/ibc-go/releases/tag/v4.0.1) - 2022-09-15 + +### Dependencies + +* [\#2287](https://github.com/cosmos/ibc-go/pull/2287) Bump SDK version to v0.45.8 and Tendermint to v0.34.21. + +## [v4.0.0](https://github.com/cosmos/ibc-go/releases/tag/v4.0.0) - 2022-08-12 + +### Dependencies + +* [\#1627](https://github.com/cosmos/ibc-go/pull/1627) Bump Go version to 1.18 +* [\#1905](https://github.com/cosmos/ibc-go/pull/1905) Bump SDK version to v0.45.7 + +>>>>>>> 3363917 (MsgTransferResponse add sequence (#2377)) ### API Breaking ### State Machine Breaking diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index c8e4c0a3ecf..4783369f4cc 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -897,6 +897,11 @@ state as a commitment, acknowledgement, or a receipt. | `data` | [bytes](#bytes) | | embedded data that represents packet state. | +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `sequence` | [uint64](#uint64) | | sequence number of the packet on the channel. | + + diff --git a/modules/apps/transfer/keeper/msg_server.go b/modules/apps/transfer/keeper/msg_server.go index d2688cc0163..9644a46ea71 100644 --- a/modules/apps/transfer/keeper/msg_server.go +++ b/modules/apps/transfer/keeper/msg_server.go @@ -18,9 +18,14 @@ func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types. return nil, err } +<<<<<<< HEAD if err := k.SendTransfer( +======= + sequence, err := k.sendTransfer( +>>>>>>> 3363917 (MsgTransferResponse add sequence (#2377)) ctx, msg.SourcePort, msg.SourceChannel, msg.Token, sender, msg.Receiver, msg.TimeoutHeight, msg.TimeoutTimestamp, - ); err != nil { + ) + if err != nil { return nil, err } @@ -38,5 +43,5 @@ func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types. ), }) - return &types.MsgTransferResponse{}, nil + return &types.MsgTransferResponse{Sequence: sequence}, nil } diff --git a/modules/apps/transfer/keeper/msg_server_test.go b/modules/apps/transfer/keeper/msg_server_test.go index ff043b8d5c6..f884413aa96 100644 --- a/modules/apps/transfer/keeper/msg_server_test.go +++ b/modules/apps/transfer/keeper/msg_server_test.go @@ -61,6 +61,7 @@ func (suite *KeeperTestSuite) TestMsgTransfer() { res, err := suite.chainA.GetSimApp().TransferKeeper.Transfer(sdk.WrapSDKContext(suite.chainA.GetContext()), msg) if tc.expPass { + suite.Require().NotEqual(res.Sequence, uint64(0)) suite.Require().NoError(err) suite.Require().NotNil(res) } else { diff --git a/modules/apps/transfer/keeper/relay.go b/modules/apps/transfer/keeper/relay.go index ba934c87e68..49ea79b523c 100644 --- a/modules/apps/transfer/keeper/relay.go +++ b/modules/apps/transfer/keeper/relay.go @@ -60,18 +60,45 @@ func (k Keeper) SendTransfer( timeoutHeight clienttypes.Height, timeoutTimestamp uint64, ) error { +<<<<<<< HEAD +======= + _, err := k.sendTransfer( + ctx, + sourcePort, + sourceChannel, + token, + sender, + receiver, + timeoutHeight, + timeoutTimestamp, + ) + return err +} + +// sendTransfer handles transfer sending logic. +func (k Keeper) sendTransfer( + ctx sdk.Context, + sourcePort, + sourceChannel string, + token sdk.Coin, + sender sdk.AccAddress, + receiver string, + timeoutHeight clienttypes.Height, + timeoutTimestamp uint64, +) (uint64, error) { +>>>>>>> 3363917 (MsgTransferResponse add sequence (#2377)) if !k.GetSendEnabled(ctx) { - return types.ErrSendDisabled + return 0, types.ErrSendDisabled } if k.bankKeeper.BlockedAddr(sender) { - return sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to send funds", sender) + return 0, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to send funds", sender) } sourceChannelEnd, found := k.channelKeeper.GetChannel(ctx, sourcePort, sourceChannel) if !found { - return sdkerrors.Wrapf(channeltypes.ErrChannelNotFound, "port ID (%s) channel ID (%s)", sourcePort, sourceChannel) + return 0, sdkerrors.Wrapf(channeltypes.ErrChannelNotFound, "port ID (%s) channel ID (%s)", sourcePort, sourceChannel) } destinationPort := sourceChannelEnd.GetCounterparty().GetPortID() @@ -80,7 +107,7 @@ func (k Keeper) SendTransfer( // get the next sequence sequence, found := k.channelKeeper.GetNextSequenceSend(ctx, sourcePort, sourceChannel) if !found { - return sdkerrors.Wrapf( + return 0, sdkerrors.Wrapf( channeltypes.ErrSequenceSendNotFound, "source port: %s, source channel: %s", sourcePort, sourceChannel, ) @@ -90,7 +117,7 @@ func (k Keeper) SendTransfer( // See spec for this logic: https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#packet-relay channelCap, ok := k.scopedKeeper.GetCapability(ctx, host.ChannelCapabilityPath(sourcePort, sourceChannel)) if !ok { - return sdkerrors.Wrap(channeltypes.ErrChannelCapabilityNotFound, "module does not own channel capability") + return 0, sdkerrors.Wrap(channeltypes.ErrChannelCapabilityNotFound, "module does not own channel capability") } // NOTE: denomination and hex hash correctness checked during msg.ValidateBasic @@ -103,7 +130,7 @@ func (k Keeper) SendTransfer( if strings.HasPrefix(token.Denom, "ibc/") { fullDenomPath, err = k.DenomPathFromHash(ctx, token.Denom) if err != nil { - return err + return 0, err } } @@ -126,7 +153,7 @@ func (k Keeper) SendTransfer( if err := k.bankKeeper.SendCoins( ctx, sender, escrowAddress, sdk.NewCoins(token), ); err != nil { - return err + return 0, err } } else { @@ -136,7 +163,7 @@ func (k Keeper) SendTransfer( if err := k.bankKeeper.SendCoinsFromAccountToModule( ctx, sender, types.ModuleName, sdk.NewCoins(token), ); err != nil { - return err + return 0, err } if err := k.bankKeeper.BurnCoins( @@ -164,8 +191,13 @@ func (k Keeper) SendTransfer( timeoutTimestamp, ) +<<<<<<< HEAD if err := k.channelKeeper.SendPacket(ctx, channelCap, packet); err != nil { return err +======= + if err := k.ics4Wrapper.SendPacket(ctx, channelCap, packet); err != nil { + return 0, err +>>>>>>> 3363917 (MsgTransferResponse add sequence (#2377)) } defer func() { @@ -184,7 +216,7 @@ func (k Keeper) SendTransfer( ) }() - return nil + return sequence, nil } // OnRecvPacket processes a cross chain fungible token transfer. If the diff --git a/modules/apps/transfer/types/tx.pb.go b/modules/apps/transfer/types/tx.pb.go index 9440631dd96..bf8fa16333b 100644 --- a/modules/apps/transfer/types/tx.pb.go +++ b/modules/apps/transfer/types/tx.pb.go @@ -87,6 +87,8 @@ var xxx_messageInfo_MsgTransfer proto.InternalMessageInfo // MsgTransferResponse defines the Msg/Transfer response type. type MsgTransferResponse struct { + // sequence number of the packet on the channel. + Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` } func (m *MsgTransferResponse) Reset() { *m = MsgTransferResponse{} } @@ -122,6 +124,13 @@ func (m *MsgTransferResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgTransferResponse proto.InternalMessageInfo +func (m *MsgTransferResponse) GetSequence() uint64 { + if m != nil { + return m.Sequence + } + return 0 +} + func init() { proto.RegisterType((*MsgTransfer)(nil), "ibc.applications.transfer.v1.MsgTransfer") proto.RegisterType((*MsgTransferResponse)(nil), "ibc.applications.transfer.v1.MsgTransferResponse") @@ -132,6 +141,7 @@ func init() { } var fileDescriptor_7401ed9bed2f8e09 = []byte{ +<<<<<<< HEAD // 495 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xc1, 0x6e, 0xd3, 0x4c, 0x10, 0xc7, 0xed, 0x2f, 0x69, 0xbe, 0xb0, 0x51, 0x2b, 0x30, 0xb4, 0x72, 0xa3, 0x62, 0x47, 0x96, @@ -164,6 +174,41 @@ var fileDescriptor_7401ed9bed2f8e09 = []byte{ 0xcc, 0x32, 0x4c, 0xa1, 0x20, 0x76, 0x35, 0x79, 0x46, 0x5f, 0xe4, 0x40, 0xaa, 0x11, 0x29, 0xe0, 0x7a, 0x36, 0x65, 0xca, 0x3c, 0x85, 0xad, 0x27, 0xa0, 0x6f, 0x4a, 0xa6, 0xb2, 0x4e, 0xbd, 0x8e, 0x2f, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x10, 0x10, 0xcc, 0xb9, 0x2c, 0x03, 0x00, 0x00, +======= + // 506 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0xc7, 0x6d, 0x92, 0x86, 0x70, 0x51, 0x2b, 0x30, 0x50, 0xb9, 0x51, 0xb1, 0x23, 0x4b, 0x48, + 0x61, 0xe0, 0x4e, 0x2e, 0x82, 0x4a, 0x9d, 0x50, 0xba, 0xc0, 0x50, 0x09, 0xac, 0x4e, 0x2c, 0xc5, + 0xbe, 0x3e, 0x9c, 0x13, 0xf1, 0x3d, 0xe3, 0xbb, 0x58, 0xf4, 0x1b, 0x30, 0xf2, 0x11, 0x3a, 0xf3, + 0x49, 0x3a, 0x76, 0x64, 0x8a, 0x50, 0xb2, 0x30, 0xe7, 0x13, 0xa0, 0xb3, 0x9d, 0x90, 0x2c, 0x88, + 0x29, 0xf7, 0xde, 0xfb, 0xbd, 0xfc, 0xfd, 0xbf, 0xf7, 0x8e, 0x3c, 0x15, 0x09, 0x67, 0x71, 0x9e, + 0x4f, 0x04, 0x8f, 0xb5, 0x40, 0xa9, 0x98, 0x2e, 0x62, 0xa9, 0x3e, 0x41, 0xc1, 0xca, 0x90, 0xe9, + 0xaf, 0x34, 0x2f, 0x50, 0xa3, 0x73, 0x28, 0x12, 0x4e, 0x37, 0x31, 0xba, 0xc2, 0x68, 0x19, 0xf6, + 0x1f, 0xa5, 0x98, 0x62, 0x05, 0x32, 0x73, 0xaa, 0x7b, 0xfa, 0x1e, 0x47, 0x95, 0xa1, 0x62, 0x49, + 0xac, 0x80, 0x95, 0x61, 0x02, 0x3a, 0x0e, 0x19, 0x47, 0x21, 0x9b, 0xba, 0x6f, 0xa4, 0x39, 0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20, 0xda, 0x6d, 0x12, 0x35, 0xed, 0xbc, 0x25, 0x0f, 0x56, 0x84, 0xf9, 0x55, 0x3a, + 0xce, 0x72, 0xf7, 0xee, 0xc0, 0x1e, 0xb6, 0x47, 0x87, 0xcb, 0x99, 0xef, 0x6e, 0xff, 0xc9, 0x1a, + 0x09, 0xa2, 0xfb, 0x4d, 0xee, 0x7c, 0x95, 0x3a, 0xe9, 0x7e, 0xbb, 0xf6, 0xad, 0xdf, 0xd7, 0xbe, + 0x15, 0x84, 0xe4, 0xe1, 0xc6, 0xac, 0x22, 0x50, 0x39, 0x4a, 0x05, 0xc6, 0xa9, 0x82, 0x2f, 0x53, + 0x90, 0x1c, 0xaa, 0x81, 0xb5, 0xa3, 0x75, 0x7c, 0x84, 0xa4, 0x75, 0xa6, 0x52, 0x67, 0x4c, 0xba, + 0xeb, 0x11, 0x3f, 0xa3, 0xff, 0x5a, 0x34, 0xba, 0xa1, 0xd0, 0x0f, 0xff, 0x1b, 0x5d, 0x7d, 0xcc, + 0xe8, 0xfd, 0xcd, 0xdc, 0xb3, 0x6f, 0xe7, 0x9e, 0xfd, 0x6b, 0xee, 0xd9, 0xdf, 0x17, 0x9e, 0x75, + 0xbb, 0xf0, 0xac, 0x9f, 0x0b, 0xcf, 0xfa, 0x70, 0x9c, 0x0a, 0x3d, 0x9e, 0x26, 0x94, 0x63, 0xc6, + 0x9a, 0xb5, 0x15, 0x09, 0x7f, 0x9e, 0x22, 0x2b, 0x5f, 0xb1, 0x0c, 0x2f, 0xa7, 0x13, 0x50, 0xe6, + 0x99, 0x6c, 0x3c, 0x0f, 0x7d, 0x95, 0x83, 0x4a, 0x3a, 0xd5, 0xaa, 0xbe, 0xf8, 0x13, 0x00, 0x00, + 0xff, 0xff, 0xca, 0x82, 0x70, 0x0f, 0x48, 0x03, 0x00, 0x00, +>>>>>>> 3363917 (MsgTransferResponse add sequence (#2377)) } // Reference imports to suppress errors if they are not otherwise used. @@ -344,6 +389,11 @@ func (m *MsgTransferResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Sequence != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x8 + } return len(dAtA) - i, nil } @@ -396,6 +446,9 @@ func (m *MsgTransferResponse) Size() (n int) { } var l int _ = l + if m.Sequence != 0 { + n += 1 + sovTx(uint64(m.Sequence)) + } return n } @@ -697,6 +750,25 @@ func (m *MsgTransferResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgTransferResponse: 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) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/proto/ibc/applications/transfer/v1/tx.proto b/proto/ibc/applications/transfer/v1/tx.proto index dfc480d07a4..d571d276a6c 100644 --- a/proto/ibc/applications/transfer/v1/tx.proto +++ b/proto/ibc/applications/transfer/v1/tx.proto @@ -41,4 +41,7 @@ message MsgTransfer { } // MsgTransferResponse defines the Msg/Transfer response type. -message MsgTransferResponse {} +message MsgTransferResponse { + // sequence number of the transfer packet sent + uint64 sequence = 1; +} From bb440e37ef82cafc8f932fa685c5b7c8294c16a3 Mon Sep 17 00:00:00 2001 From: crodriguezvega Date: Wed, 5 Oct 2022 10:18:38 +0200 Subject: [PATCH 2/3] fix conflicts --- CHANGELOG.md | 101 --------------------- docs/ibc/proto-docs.md | 10 +- modules/apps/transfer/keeper/msg_server.go | 4 - modules/apps/transfer/keeper/relay.go | 9 -- modules/apps/transfer/types/tx.pb.go | 101 +++++++-------------- 5 files changed, 38 insertions(+), 187 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e1c54d584c..e9ab5c1b778 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,115 +38,14 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Dependencies -<<<<<<< HEAD -======= -* [\#2458](https://github.com/cosmos/ibc-go/pull/2458) Bump Cosmos SDK to v0.46.2 - ### API Breaking -* (apps/29-fee) [\#2395](https://github.com/cosmos/ibc-go/pull/2395) Remove param space from ics29 NewKeeper function. The field was unused. -* (apps/27-interchain-accounts) [\#2133](https://github.com/cosmos/ibc-go/pull/2133) Generates genesis protos in a separate directory to avoid circular import errors. The protobuf package name has changed for the genesis types. -* (light-clients/tendermint)[\#1768](https://github.com/cosmos/ibc-go/pull/1768) Removed `AllowUpdateAfterExpiry`, `AllowUpdateAfterMisbehaviour` booleans as they are deprecated (see ADR026) -* (06-solomachine) [\#1679](https://github.com/cosmos/ibc-go/pull/1679) Remove `types` sub-package from `06-solomachine` lightclient directory. -* (07-tendermint) [\#1677](https://github.com/cosmos/ibc-go/pull/1677) Remove `types` sub-package from `07-tendermint` lightclient directory. -* (06-solomachine) [\#1687](https://github.com/cosmos/ibc-go/pull/1687) Bump `06-solomachine` protobuf version from `v2` to `v3`. -* (06-solomachine) [\#1687](https://github.com/cosmos/ibc-go/pull/1687) Removed `DataType` enum and associated message types from `06-solomachine`. `DataType` has been removed from `SignBytes` and `SignatureAndData` in favour of `path`. -* (02-client) [\#598](https://github.com/cosmos/ibc-go/pull/598) The client state and consensus state return value has been removed from `VerifyUpgradeAndUpdateState`. Light client implementations must update the client state and consensus state after verifying a valid client upgrade. -* (06-solomachine) [\#1100](https://github.com/cosmos/ibc-go/pull/1100) Remove `GetClientID` function from 06-solomachine `Misbehaviour` type. -* (06-solomachine) [\#1100](https://github.com/cosmos/ibc-go/pull/1100) Deprecate `ClientId` field in 06-solomachine `Misbehaviour` type. -* (07-tendermint) [\#1097](https://github.com/cosmos/ibc-go/pull/1097) Remove `GetClientID` function from 07-tendermint `Misbehaviour` type. -* (07-tendermint) [\#1097](https://github.com/cosmos/ibc-go/pull/1097) Deprecate `ClientId` field in 07-tendermint `Misbehaviour` type. -* (modules/core/exported) [\#1107](https://github.com/cosmos/ibc-go/pull/1107) Merging the `Header` and `Misbehaviour` interfaces into a single `ClientMessage` type. -* (06-solomachine)[\#1906](https://github.com/cosmos/ibc-go/pull/1906/files) Removed `AllowUpdateAfterProposal` boolean as it has been deprecated (see 01_concepts of the solo machine spec for more details). -* (07-tendermint) [\#1896](https://github.com/cosmos/ibc-go/pull/1896) Remove error return from `IterateConsensusStateAscending` in `07-tendermint`. -* (apps/27-interchain-accounts) [\#2035](https://github.com/cosmos/ibc-go/pull/2035) Interchain accounts host and controller Keepers now expects a keeper which fulfills the expected `ScopedKeeper` interface for the capability keeper. -* (transfer) [\#2034](https://github.com/cosmos/ibc-go/pull/2034) Transfer Keeper now expects a keeper which fulfills the expected `ScopedKeeper` interface for the capability keeper. -* (05-port) [\#2025](https://github.com/cosmos/ibc-go/pull/2025) Port Keeper now expects a keeper which fulfills the expected `ScopedKeeper` interface for the capability keeper. -* (04-channel) [\#2024](https://github.com/cosmos/ibc-go/pull/2024) Channel Keeper now expects a keeper which fulfills the expected `ScopedKeeper` interface for the capability keeper. -* (modules/apps/27-interchain-accounts) [\#2433](https://github.com/cosmos/ibc-go/pull/2450) Renamed icatypes.PortPrefix to icatypes.ControllerPortPrefix & icatypes.PortID to icatypes.HostPortID - ### State Machine Breaking * (transfer) [\#2377](https://github.com/cosmos/ibc-go/pull/2377) Adding `sequence` to `MsgTransferResponse`. ### Improvements -* (modules/light-clients/07-tendermint) [\#1713](https://github.com/cosmos/ibc-go/pull/1713) Allow client upgrade proposals to update `TrustingPeriod`. See ADR-026 for context. -* (modules/core/02-client) [\#1188](https://github.com/cosmos/ibc-go/pull/1188/files) Routing `MsgSubmitMisbehaviour` to `UpdateClient` keeper function. Deprecating `SubmitMisbehaviour` endpoint. -* (modules/core/02-client) [\#1208](https://github.com/cosmos/ibc-go/pull/1208) Replace `CheckHeaderAndUpdateState` usage in 02-client with calls to `VerifyClientMessage`, `CheckForMisbehaviour`, `UpdateStateOnMisbehaviour` and `UpdateState`. -* (modules/light-clients/09-localhost) [\#1187](https://github.com/cosmos/ibc-go/pull/1187/) Removing localhost light client implementation as it is not functional. An upgrade handler is provided in `modules/migrations/v5` to prune `09-localhost` clients and consensus states from the store. -* [\#1186](https://github.com/cosmos/ibc-go/pull/1186/files) Removing `GetRoot` function from ConsensusState interface in `02-client`. `GetRoot` is unused by core IBC. -* (modules/core/02-client) [\#1196](https://github.com/cosmos/ibc-go/pull/1196) Adding VerifyClientMessage to ClientState interface. -* (modules/core/02-client) [\#1198](https://github.com/cosmos/ibc-go/pull/1198) Adding UpdateStateOnMisbehaviour to ClientState interface. -* (modules/core/02-client) [\#1170](https://github.com/cosmos/ibc-go/pull/1170) Updating `ClientUpdateProposal` to set client state in lightclient implementations `CheckSubstituteAndUpdateState` methods. -* (modules/core/02-client) [\#1197](https://github.com/cosmos/ibc-go/pull/1197) Adding `CheckForMisbehaviour` to `ClientState` interface. -* (modules/core/02-client) [\#1195](https://github.com/cosmos/ibc-go/pull/1210) Removing `CheckHeaderAndUpdateState` from `ClientState` interface & associated light client implementations. -* (modules/core/02-client) [\#1189](https://github.com/cosmos/ibc-go/pull/1212) Removing `CheckMisbehaviourAndUpdateState` from `ClientState` interface & associated light client implementations. -* (modules/core/exported) [\#1206](https://github.com/cosmos/ibc-go/pull/1206) Adding new method `UpdateState` to `ClientState` interface. -* (modules/core/02-client) [\#1741](https://github.com/cosmos/ibc-go/pull/1741) Emitting a new `upgrade_chain` event upon setting upgrade consensus state. -* (client) [\#724](https://github.com/cosmos/ibc-go/pull/724) `IsRevisionFormat` and `IsClientIDFormat` have been updated to disallow newlines before the dash used to separate the chainID and revision number, and the client type and client sequence. -* (02-client/cli) [\#897](https://github.com/cosmos/ibc-go/pull/897) Remove `GetClientID()` from `Misbehaviour` interface. Submit client misbehaviour cli command requires an explicit client id now. -* (06-solomachine) [\#1972](https://github.com/cosmos/ibc-go/pull/1972) Solo machine implementation of `ZeroCustomFields` fn now panics as the fn is only used for upgrades which solo machine does not support. -* (apps/27-interchain-accounts) [\#2102](https://github.com/cosmos/ibc-go/pull/2102) ICS27 controller middleware now supports a nil underlying application. This allows chains to make use of interchain accounts with existing auth mechanisms such as x/group and x/gov. -* (apps/27-interchain-accounts) [\#2146](https://github.com/cosmos/ibc-go/pull/2146) ICS27 controller now claims the channel capability passed via ibc core, and passes `nil` to the underlying app callback. The channel capability arg in `SendTx` is now ignored and looked up internally. -* (apps/27-interchain-accounts) [\#2134](https://github.com/cosmos/ibc-go/pull/2134) Adding upgrade handler to ICS27 `controller` submodule for migration of channel capabilities. This upgrade handler migrates ownership of channel capabilities from the underlying application to the ICS27 `controller` submodule. -* (apps/27-interchain-accounts) [\#2157](https://github.com/cosmos/ibc-go/pull/2157) Adding `IsMiddlewareEnabled` functionality to enforce calls to ICS27 msg server to *not* route to the underlying application. -* (apps/27-interchain-accounts) [\#2177](https://github.com/cosmos/ibc-go/pull/2177) Adding `IsMiddlewareEnabled` flag to interchain accounts `ActiveChannel` genesis type. -* (apps/27-interchain-accounts) [\#2140](https://github.com/cosmos/ibc-go/pull/2140) Adding migration handler to ICS27 `controller` submodule to assert ownership of channel capabilities and set middleware enabled flag for existing channels. The ICS27 module consensus version has been bumped from 1 to 2. -* (core/04-channel) [\#2304](https://github.com/cosmos/ibc-go/pull/2304) Adding `GetAllChannelsWithPortPrefix` function which filters channels based on a provided port prefix. -* (apps/27-interchain-accounts) [\#2290](https://github.com/cosmos/ibc-go/pull/2290) Changed `DefaultParams` function in `host` submodule to allow all messages by default. Defined a constant named `AllowAllHostMsgs` for `host` module to keep wildcard "*" string which allows all messages. -* (apps/27-interchain-accounts) [\#2248](https://github.com/cosmos/ibc-go/pull/2248) Adding call to underlying app in `OnChanCloseConfirm` callback of the controller submodule and adding relevant unit tests. -* (apps/27-interchain-accounts) [\#2251](https://github.com/cosmos/ibc-go/pull/2251) Adding `msgServer` struct to controller submodule that embeds the `Keeper` struct. -* (light-clients/06-solomachine) Moving `verifyMisbehaviour` function from update.go to misbehaviour_handle.go. -* (apps/27-interchain-accounts) [\#2297](https://github.com/cosmos/ibc-go/pull/2297) Adding cli command to generate ICS27 packet data. -* (modules/core/keeper) [\#1728](https://github.com/cosmos/ibc-go/pull/2399) Updated channel callback errors to include portID & channelID for better identification of errors. - -### Features - -* (apps/27-interchain-accounts) [\#2147](https://github.com/cosmos/ibc-go/pull/2147) Adding a `SubmitTx` gRPC endpoint for the ICS27 Controller module which allows owners of interchain accounts to submit transactions. This replaces the previously existing need for authentication modules to implement this standard functionality. -* (testing/simapp) [\#2190](https://github.com/cosmos/ibc-go/pull/2190) Adding the new `x/group` cosmos-sdk module to simapp. - -### Bug Fixes - -* (light-clients/solomachine) [#1839](https://github.com/cosmos/ibc-go/issues/1839) Fixed usage of the new diversifier in validation of changing diversifiers for the solo machine. The current diversifier must sign over the new diversifier. -* (light-clients/07-tendermint) [\#1674](https://github.com/cosmos/ibc-go/pull/1674) Submitted ClientState is zeroed out before checking the proof in order to prevent the proposal from containing information governance is not actually voting on. -* (modules/core/02-client)[\#1676](https://github.com/cosmos/ibc-go/pull/1676) ClientState must be zeroed out for `UpgradeProposals` to pass validation. This prevents a proposal containing information governance is not actually voting on. -* (modules/core/keeper) [\#2403](https://github.com/cosmos/ibc-go/pull/2403) Added a function in keeper to cater for blank pointers. - -## [v4.1.0](https://github.com/cosmos/ibc-go/releases/tag/v4.1.0) - 2022-09-20 - -### Dependencies - -* [\#2288](https://github.com/cosmos/ibc-go/pull/2288) Bump SDK version to v0.45.8 and Tendermint to v0.34.21. - -### Features - -* (apps/27-interchain-accounts) [\#2193](https://github.com/cosmos/ibc-go/pull/2193) Adding `InterchainAccount` gRPC query endpont to ICS27 `controller` submodule to allow users to retrieve registered interchain account addresses. - -### Bug Fixes - -* (27-interchain-accounts) [\#2308](https://github.com/cosmos/ibc-go/pull/2308) Nil checks have been added to ensure services are not registered for nil host or controller keepers. - -## [v4.0.1](https://github.com/cosmos/ibc-go/releases/tag/v4.0.1) - 2022-09-15 - -### Dependencies - -* [\#2287](https://github.com/cosmos/ibc-go/pull/2287) Bump SDK version to v0.45.8 and Tendermint to v0.34.21. - -## [v4.0.0](https://github.com/cosmos/ibc-go/releases/tag/v4.0.0) - 2022-08-12 - -### Dependencies - -* [\#1627](https://github.com/cosmos/ibc-go/pull/1627) Bump Go version to 1.18 -* [\#1905](https://github.com/cosmos/ibc-go/pull/1905) Bump SDK version to v0.45.7 - ->>>>>>> 3363917 (MsgTransferResponse add sequence (#2377)) -### API Breaking - -### State Machine Breaking - -### Improvements - ### Features ### Bug Fixes diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index 4783369f4cc..5aaf1fd55f4 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -711,6 +711,11 @@ https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transf MsgTransferResponse defines the Msg/Transfer response type. +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `sequence` | [uint64](#uint64) | | sequence number of the transfer packet sent | + + @@ -897,11 +902,6 @@ state as a commitment, acknowledgement, or a receipt. | `data` | [bytes](#bytes) | | embedded data that represents packet state. | -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `sequence` | [uint64](#uint64) | | sequence number of the packet on the channel. | - - diff --git a/modules/apps/transfer/keeper/msg_server.go b/modules/apps/transfer/keeper/msg_server.go index 9644a46ea71..84c4c6d59ce 100644 --- a/modules/apps/transfer/keeper/msg_server.go +++ b/modules/apps/transfer/keeper/msg_server.go @@ -18,11 +18,7 @@ func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types. return nil, err } -<<<<<<< HEAD - if err := k.SendTransfer( -======= sequence, err := k.sendTransfer( ->>>>>>> 3363917 (MsgTransferResponse add sequence (#2377)) ctx, msg.SourcePort, msg.SourceChannel, msg.Token, sender, msg.Receiver, msg.TimeoutHeight, msg.TimeoutTimestamp, ) if err != nil { diff --git a/modules/apps/transfer/keeper/relay.go b/modules/apps/transfer/keeper/relay.go index 49ea79b523c..a0abb89d122 100644 --- a/modules/apps/transfer/keeper/relay.go +++ b/modules/apps/transfer/keeper/relay.go @@ -60,9 +60,6 @@ func (k Keeper) SendTransfer( timeoutHeight clienttypes.Height, timeoutTimestamp uint64, ) error { -<<<<<<< HEAD - -======= _, err := k.sendTransfer( ctx, sourcePort, @@ -87,7 +84,6 @@ func (k Keeper) sendTransfer( timeoutHeight clienttypes.Height, timeoutTimestamp uint64, ) (uint64, error) { ->>>>>>> 3363917 (MsgTransferResponse add sequence (#2377)) if !k.GetSendEnabled(ctx) { return 0, types.ErrSendDisabled } @@ -191,13 +187,8 @@ func (k Keeper) sendTransfer( timeoutTimestamp, ) -<<<<<<< HEAD - if err := k.channelKeeper.SendPacket(ctx, channelCap, packet); err != nil { - return err -======= if err := k.ics4Wrapper.SendPacket(ctx, channelCap, packet); err != nil { return 0, err ->>>>>>> 3363917 (MsgTransferResponse add sequence (#2377)) } defer func() { diff --git a/modules/apps/transfer/types/tx.pb.go b/modules/apps/transfer/types/tx.pb.go index bf8fa16333b..ba9f0397b36 100644 --- a/modules/apps/transfer/types/tx.pb.go +++ b/modules/apps/transfer/types/tx.pb.go @@ -87,7 +87,7 @@ var xxx_messageInfo_MsgTransfer proto.InternalMessageInfo // MsgTransferResponse defines the Msg/Transfer response type. type MsgTransferResponse struct { - // sequence number of the packet on the channel. + // sequence number of the transfer packet sent Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` } @@ -141,74 +141,39 @@ func init() { } var fileDescriptor_7401ed9bed2f8e09 = []byte{ -<<<<<<< HEAD - // 495 bytes of a gzipped FileDescriptorProto + // 508 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xc1, 0x6e, 0xd3, 0x4c, - 0x10, 0xc7, 0xed, 0x2f, 0x69, 0xbe, 0xb0, 0x51, 0x2b, 0x30, 0xb4, 0x72, 0xa3, 0x62, 0x47, 0x96, - 0x90, 0xc2, 0x81, 0x5d, 0x39, 0x08, 0x55, 0xea, 0x09, 0xa5, 0x17, 0x38, 0x54, 0x02, 0xab, 0x27, - 0x2e, 0xc5, 0xde, 0x2e, 0xce, 0x8a, 0x78, 0xc7, 0xda, 0xdd, 0x58, 0xf4, 0x0d, 0x38, 0xf2, 0x08, - 0x3d, 0xf3, 0x24, 0x3d, 0xf6, 0xc8, 0x29, 0x42, 0xc9, 0x85, 0x73, 0x9e, 0x00, 0xad, 0xbd, 0x09, - 0xc9, 0x05, 0x71, 0xb2, 0x67, 0xfe, 0xbf, 0xd9, 0xbf, 0x66, 0x67, 0x16, 0x3d, 0xe3, 0x19, 0x25, - 0x69, 0x59, 0x4e, 0x39, 0x4d, 0x35, 0x07, 0xa1, 0x88, 0x96, 0xa9, 0x50, 0x9f, 0x98, 0x24, 0x55, - 0x4c, 0xf4, 0x17, 0x5c, 0x4a, 0xd0, 0xe0, 0x9d, 0xf0, 0x8c, 0xe2, 0x6d, 0x0c, 0xaf, 0x31, 0x5c, - 0xc5, 0xfd, 0x27, 0x39, 0xe4, 0x50, 0x83, 0xc4, 0xfc, 0x35, 0x35, 0xfd, 0x80, 0x82, 0x2a, 0x40, - 0x91, 0x2c, 0x55, 0x8c, 0x54, 0x71, 0xc6, 0x74, 0x1a, 0x13, 0x0a, 0x5c, 0x58, 0x3d, 0x34, 0xd6, - 0x14, 0x24, 0x23, 0x74, 0xca, 0x99, 0xd0, 0xc6, 0xb0, 0xf9, 0x6b, 0x80, 0xe8, 0x7b, 0x0b, 0xf5, - 0x2e, 0x54, 0x7e, 0x69, 0x9d, 0xbc, 0x53, 0xd4, 0x53, 0x30, 0x93, 0x94, 0x5d, 0x95, 0x20, 0xb5, - 0xef, 0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, 0xb4, 0xb9, 0xcb, 0x75, 0xea, 0xac, 0xfb, 0xf5, 0x36, 0x74, 0x7e, 0xdd, - 0x86, 0x4e, 0x74, 0x88, 0x1e, 0x6f, 0xcd, 0x2a, 0x61, 0xaa, 0x04, 0xa1, 0xd8, 0x08, 0x50, 0xeb, - 0x42, 0xe5, 0xde, 0x04, 0x75, 0x37, 0x63, 0x7c, 0x8e, 0xff, 0xb6, 0x4c, 0x78, 0xeb, 0x94, 0x7e, - 0xfc, 0xcf, 0xe8, 0xda, 0x70, 0xfc, 0xfe, 0x6e, 0x11, 0xb8, 0xf7, 0x8b, 0xc0, 0xfd, 0xb9, 0x08, - 0xdc, 0x6f, 0xcb, 0xc0, 0xb9, 0x5f, 0x06, 0xce, 0x8f, 0x65, 0xe0, 0x7c, 0x38, 0xcd, 0xb9, 0x9e, - 0xcc, 0x32, 0x4c, 0xa1, 0x20, 0x76, 0x35, 0x79, 0x46, 0x5f, 0xe4, 0x40, 0xaa, 0x11, 0x29, 0xe0, - 0x7a, 0x36, 0x65, 0xca, 0x3c, 0x85, 0xad, 0x27, 0xa0, 0x6f, 0x4a, 0xa6, 0xb2, 0x4e, 0xbd, 0x8e, - 0x2f, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x10, 0x10, 0xcc, 0xb9, 0x2c, 0x03, 0x00, 0x00, -======= - // 506 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x31, 0x6f, 0xd3, 0x40, - 0x14, 0xc7, 0x6d, 0x92, 0x86, 0x70, 0x51, 0x2b, 0x30, 0x50, 0xb9, 0x51, 0xb1, 0x23, 0x4b, 0x48, - 0x61, 0xe0, 0x4e, 0x2e, 0x82, 0x4a, 0x9d, 0x50, 0xba, 0xc0, 0x50, 0x09, 0xac, 0x4e, 0x2c, 0xc5, - 0xbe, 0x3e, 0x9c, 0x13, 0xf1, 0x3d, 0xe3, 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3f, 0xa3, 0xff, 0x5a, 0x34, 0xba, 0xa1, 0xd0, 0x0f, 0xff, 0x1b, 0x5d, 0x7d, 0xcc, - 0xe8, 0xfd, 0xcd, 0xdc, 0xb3, 0x6f, 0xe7, 0x9e, 0xfd, 0x6b, 0xee, 0xd9, 0xdf, 0x17, 0x9e, 0x75, - 0xbb, 0xf0, 0xac, 0x9f, 0x0b, 0xcf, 0xfa, 0x70, 0x9c, 0x0a, 0x3d, 0x9e, 0x26, 0x94, 0x63, 0xc6, - 0x9a, 0xb5, 0x15, 0x09, 0x7f, 0x9e, 0x22, 0x2b, 0x5f, 0xb1, 0x0c, 0x2f, 0xa7, 0x13, 0x50, 0xe6, - 0x99, 0x6c, 0x3c, 0x0f, 0x7d, 0x95, 0x83, 0x4a, 0x3a, 0xd5, 0xaa, 0xbe, 0xf8, 0x13, 0x00, 0x00, - 0xff, 0xff, 0xca, 0x82, 0x70, 0x0f, 0x48, 0x03, 0x00, 0x00, ->>>>>>> 3363917 (MsgTransferResponse add sequence (#2377)) + 0x10, 0xc7, 0xed, 0x2f, 0x69, 0xbe, 0xb0, 0x51, 0x2b, 0x30, 0x50, 0xb9, 0x51, 0xb1, 0x23, 0x4b, + 0x48, 0xe1, 0xc0, 0xae, 0x1c, 0x84, 0x2a, 0xf5, 0x84, 0xd2, 0x0b, 0x1c, 0x2a, 0x81, 0xd5, 0x13, + 0x97, 0x62, 0x6f, 0x07, 0x67, 0x45, 0xbc, 0x63, 0xbc, 0x1b, 0x8b, 0xbe, 0x01, 0x47, 0x1e, 0xa1, + 0x67, 0x9e, 0xa4, 0xc7, 0x1e, 0x39, 0x45, 0x28, 0xb9, 0x70, 0xce, 0x13, 0xa0, 0xb5, 0x9d, 0x90, + 0x5c, 0x10, 0xa7, 0xec, 0xcc, 0xfc, 0x26, 0x7f, 0xff, 0x77, 0x66, 0xc9, 0x53, 0x91, 0x70, 0x16, + 0xe7, 0xf9, 0x54, 0xf0, 0x58, 0x0b, 0x94, 0x8a, 0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 0xf0, 0xe7, 0x29, 0xb2, 0x72, 0xc4, 0x32, 0xbc, 0x9a, 0x4d, 0x41, + 0x99, 0x67, 0xb2, 0xf5, 0x3c, 0xf4, 0x75, 0x0e, 0x2a, 0xe9, 0x54, 0xab, 0xfa, 0xe2, 0x77, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x75, 0xd4, 0x23, 0x61, 0x48, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. From 3e9c1ae395eff41703a98a675cfec478e07b4c87 Mon Sep 17 00:00:00 2001 From: crodriguezvega Date: Wed, 5 Oct 2022 10:30:39 +0200 Subject: [PATCH 3/3] fix tests --- modules/apps/transfer/keeper/relay.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/apps/transfer/keeper/relay.go b/modules/apps/transfer/keeper/relay.go index a0abb89d122..3716d7cccb3 100644 --- a/modules/apps/transfer/keeper/relay.go +++ b/modules/apps/transfer/keeper/relay.go @@ -187,7 +187,7 @@ func (k Keeper) sendTransfer( timeoutTimestamp, ) - if err := k.ics4Wrapper.SendPacket(ctx, channelCap, packet); err != nil { + if err := k.channelKeeper.SendPacket(ctx, channelCap, packet); err != nil { return 0, err }