From c66d1e273432506558f78fdae7ef780999753a8a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 17:05:38 +0300 Subject: [PATCH 1/2] build(deps): Bump go.uber.org/zap from 1.25.0 to 1.26.0 in /e2e (#4720) Bumps [go.uber.org/zap](https://github.com/uber-go/zap) from 1.25.0 to 1.26.0. - [Release notes](https://github.com/uber-go/zap/releases) - [Changelog](https://github.com/uber-go/zap/blob/master/CHANGELOG.md) - [Commits](https://github.com/uber-go/zap/compare/v1.25.0...v1.26.0) --- updated-dependencies: - dependency-name: go.uber.org/zap dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- e2e/go.mod | 3 +-- e2e/go.sum | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/e2e/go.mod b/e2e/go.mod index b8d87d09dfa..994f00ace1e 100644 --- a/e2e/go.mod +++ b/e2e/go.mod @@ -13,7 +13,7 @@ require ( github.com/docker/docker v24.0.6+incompatible github.com/strangelove-ventures/interchaintest/v8 v8.0.0-20230913202406-3e11bf474a3b github.com/stretchr/testify v1.8.4 - go.uber.org/zap v1.25.0 + go.uber.org/zap v1.26.0 golang.org/x/mod v0.12.0 google.golang.org/grpc v1.58.1 gopkg.in/yaml.v2 v2.4.0 @@ -44,7 +44,6 @@ require ( github.com/Microsoft/go-winio v0.6.0 // indirect github.com/avast/retry-go/v4 v4.5.0 // indirect github.com/aws/aws-sdk-go v1.44.224 // indirect - github.com/benbjohnson/clock v1.3.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect diff --git a/e2e/go.sum b/e2e/go.sum index 5be620ef1ae..966d0bde030 100644 --- a/e2e/go.sum +++ b/e2e/go.sum @@ -267,8 +267,6 @@ github.com/aws/aws-sdk-go v1.44.224 h1:09CiaaF35nRmxrzWZ2uRq5v6Ghg/d2RiPjZnSgtt+ github.com/aws/aws-sdk-go v1.44.224/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= -github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -1079,8 +1077,8 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= -go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= From cd25f8882b2d62b1692c84fd2e46279ac5bb59c9 Mon Sep 17 00:00:00 2001 From: dzmitry-lahoda Date: Tue, 19 Sep 2023 16:15:17 +0100 Subject: [PATCH 2/2] fix(query): get next send sequence for transfer packets (#4706) * feat(packet): get next send sequence for transfer packets * chore(channels): fixed tests for unordered sequence * Update modules/core/04-channel/keeper/grpc_query_test.go Co-authored-by: Carlos Rodriguez * chore: removed useless error handling --------- Co-authored-by: Carlos Rodriguez --- modules/core/04-channel/keeper/grpc_query.go | 17 ++--------------- .../core/04-channel/keeper/grpc_query_test.go | 6 ++++-- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/modules/core/04-channel/keeper/grpc_query.go b/modules/core/04-channel/keeper/grpc_query.go index 171c88d435f..1802b2f4a1e 100644 --- a/modules/core/04-channel/keeper/grpc_query.go +++ b/modules/core/04-channel/keeper/grpc_query.go @@ -555,26 +555,13 @@ func (k Keeper) NextSequenceSend(c context.Context, req *types.QueryNextSequence ctx := sdk.UnwrapSDKContext(c) - channel, found := k.GetChannel(ctx, req.PortId, req.ChannelId) + sequence, found := k.GetNextSequenceSend(ctx, req.PortId, req.ChannelId) if !found { return nil, status.Error( codes.NotFound, - errorsmod.Wrapf(types.ErrChannelNotFound, "port-id: %s, channel-id %s", req.PortId, req.ChannelId).Error(), + errorsmod.Wrapf(types.ErrSequenceSendNotFound, "port-id: %s, channel-id %s", req.PortId, req.ChannelId).Error(), ) } - - // Return the next sequence send for ordered channels. Unordered channels - // do not make use of the next sequence send. - var sequence uint64 - if channel.Ordering != types.UNORDERED { - sequence, found = k.GetNextSequenceSend(ctx, req.PortId, req.ChannelId) - if !found { - return nil, status.Error( - codes.NotFound, - errorsmod.Wrapf(types.ErrSequenceSendNotFound, "port-id: %s, channel-id %s", req.PortId, req.ChannelId).Error(), - ) - } - } selfHeight := clienttypes.GetSelfHeight(ctx) return types.NewQueryNextSequenceSendResponse(sequence, nil, selfHeight), nil } diff --git a/modules/core/04-channel/keeper/grpc_query_test.go b/modules/core/04-channel/keeper/grpc_query_test.go index 725b6d1655a..00937161d97 100644 --- a/modules/core/04-channel/keeper/grpc_query_test.go +++ b/modules/core/04-channel/keeper/grpc_query_test.go @@ -1620,12 +1620,14 @@ func (suite *KeeperTestSuite) TestQueryNextSequenceSend() { false, }, { - "basic success on unordered channel returns zero", + "basic success on unordered channel returns the set send sequence", func() { path := ibctesting.NewPath(suite.chainA, suite.chainB) suite.coordinator.Setup(path) - expSeq = 0 + expSeq = 42 + seq := uint64(42) + suite.chainA.App.GetIBCKeeper().ChannelKeeper.SetNextSequenceSend(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, seq) req = &types.QueryNextSequenceSendRequest{ PortId: path.EndpointA.ChannelConfig.PortID, ChannelId: path.EndpointA.ChannelID,