Skip to content

Commit

Permalink
build(deps): Bump go.uber.org/mock from 0.4.0 to 0.5.0 (#6394)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthias <[email protected]>
  • Loading branch information
dependabot[bot] and fasmat committed Oct 18, 2024
1 parent f9069f1 commit 3ffdb8e
Show file tree
Hide file tree
Showing 43 changed files with 186 additions and 61 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
GOLANGCI_LINT_VERSION := v1.61.0
GOTESTSUM_VERSION := v1.12.0
GOSCALE_VERSION := v1.2.0
MOCKGEN_VERSION := v0.4.0
MOCKGEN_VERSION := v0.5.0

# Add an indicator to the branch name if dirty and use commithash if running in detached mode
ifeq ($(BRANCH),HEAD)
Expand Down
52 changes: 26 additions & 26 deletions activation/handler_v1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,8 @@ func TestHandlerV1_StoreAtx(t *testing.T) {
watx.Sign(sig)
atx := toAtx(t, watx)

atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx any) bool {
return atx.(*types.ActivationTx).ID() == watx.ID()
atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx *types.ActivationTx) bool {
return atx.ID() == watx.ID()
}))
atxHdlr.mtortoise.EXPECT().OnAtx(watx.PublishEpoch+1, watx.ID(), gomock.Any())
proof, err := atxHdlr.storeAtx(context.Background(), atx, watx)
Expand All @@ -556,16 +556,16 @@ func TestHandlerV1_StoreAtx(t *testing.T) {
watx.Sign(sig)
atx := toAtx(t, watx)

atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx any) bool {
return atx.(*types.ActivationTx).ID() == watx.ID()
atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx *types.ActivationTx) bool {
return atx.ID() == watx.ID()
}))
atxHdlr.mtortoise.EXPECT().OnAtx(watx.PublishEpoch+1, watx.ID(), gomock.Any())
proof, err := atxHdlr.storeAtx(context.Background(), atx, watx)
require.NoError(t, err)
require.Nil(t, proof)

atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx any) bool {
return atx.(*types.ActivationTx).ID() == watx.ID()
atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx *types.ActivationTx) bool {
return atx.ID() == watx.ID()
}))
// Note: tortoise is not informed about the same ATX again
proof, err = atxHdlr.storeAtx(context.Background(), atx, watx)
Expand All @@ -584,8 +584,8 @@ func TestHandlerV1_StoreAtx(t *testing.T) {
watx.Sign(sig)
atx := toAtx(t, watx)

atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx any) bool {
return atx.(*types.ActivationTx).ID() == watx.ID()
atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx *types.ActivationTx) bool {
return atx.ID() == watx.ID()
}))
atxHdlr.mtortoise.EXPECT().OnAtx(watx.PublishEpoch+1, watx.ID(), gomock.Any())
proof, err := atxHdlr.storeAtx(context.Background(), atx, watx)
Expand All @@ -605,8 +605,8 @@ func TestHandlerV1_StoreAtx(t *testing.T) {
watx0.Sign(sig)
atx0 := toAtx(t, watx0)

atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx any) bool {
return atx.(*types.ActivationTx).ID() == watx0.ID()
atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx *types.ActivationTx) bool {
return atx.ID() == watx0.ID()
}))
atxHdlr.mtortoise.EXPECT().OnAtx(watx0.PublishEpoch+1, watx0.ID(), gomock.Any())
proof, err := atxHdlr.storeAtx(context.Background(), atx0, watx0)
Expand All @@ -618,8 +618,8 @@ func TestHandlerV1_StoreAtx(t *testing.T) {
watx1.Sign(sig)
atx1 := toAtx(t, watx1)

atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx any) bool {
return atx.(*types.ActivationTx).ID() == watx1.ID()
atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx *types.ActivationTx) bool {
return atx.ID() == watx1.ID()
}))
atxHdlr.mtortoise.EXPECT().OnAtx(watx1.PublishEpoch+1, watx1.ID(), gomock.Any())
atxHdlr.mtortoise.EXPECT().OnMalfeasance(sig.NodeID())
Expand All @@ -646,8 +646,8 @@ func TestHandlerV1_StoreAtx(t *testing.T) {
watx0.Sign(sig)
atx0 := toAtx(t, watx0)

atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx any) bool {
return atx.(*types.ActivationTx).ID() == watx0.ID()
atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx *types.ActivationTx) bool {
return atx.ID() == watx0.ID()
}))
atxHdlr.mtortoise.EXPECT().OnAtx(watx0.PublishEpoch+1, watx0.ID(), gomock.Any())
proof, err := atxHdlr.storeAtx(context.Background(), atx0, watx0)
Expand Down Expand Up @@ -678,8 +678,8 @@ func TestHandlerV1_StoreAtx(t *testing.T) {
initialATX.Sign(sig)
wInitialATX := toAtx(t, initialATX)

atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx any) bool {
return atx.(*types.ActivationTx).ID() == initialATX.ID()
atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx *types.ActivationTx) bool {
return atx.ID() == initialATX.ID()
}))
atxHdlr.mtortoise.EXPECT().OnAtx(initialATX.PublishEpoch+1, initialATX.ID(), gomock.Any())
proof, err := atxHdlr.storeAtx(context.Background(), wInitialATX, initialATX)
Expand All @@ -691,8 +691,8 @@ func TestHandlerV1_StoreAtx(t *testing.T) {
watx1.Sign(sig)
atx1 := toAtx(t, watx1)

atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx any) bool {
return atx.(*types.ActivationTx).ID() == watx1.ID()
atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx *types.ActivationTx) bool {
return atx.ID() == watx1.ID()
}))
atxHdlr.mtortoise.EXPECT().OnAtx(watx1.PublishEpoch+1, watx1.ID(), gomock.Any())
proof, err = atxHdlr.storeAtx(context.Background(), atx1, watx1)
Expand All @@ -703,8 +703,8 @@ func TestHandlerV1_StoreAtx(t *testing.T) {
watx2.Sign(sig)
atx2 := toAtx(t, watx2)

atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx any) bool {
return atx.(*types.ActivationTx).ID() == watx2.ID()
atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx *types.ActivationTx) bool {
return atx.ID() == watx2.ID()
}))
atxHdlr.mtortoise.EXPECT().OnAtx(watx2.PublishEpoch+1, watx2.ID(), gomock.Any())
proof, err = atxHdlr.storeAtx(context.Background(), atx2, watx2)
Expand All @@ -717,8 +717,8 @@ func TestHandlerV1_StoreAtx(t *testing.T) {
watx3.Sign(sig)
atx3 := toAtx(t, watx3)

atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx any) bool {
return atx.(*types.ActivationTx).ID() == watx3.ID()
atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx *types.ActivationTx) bool {
return atx.ID() == watx3.ID()
}))
atxHdlr.mtortoise.EXPECT().OnAtx(watx3.PublishEpoch+1, watx3.ID(), gomock.Any())
atxHdlr.mtortoise.EXPECT().OnMalfeasance(sig.NodeID())
Expand All @@ -742,8 +742,8 @@ func TestHandlerV1_StoreAtx(t *testing.T) {
wInitialATX.Sign(sig)
initialAtx := toAtx(t, wInitialATX)

atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx any) bool {
return atx.(*types.ActivationTx).ID() == wInitialATX.ID()
atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx *types.ActivationTx) bool {
return atx.ID() == wInitialATX.ID()
}))
atxHdlr.mtortoise.EXPECT().OnAtx(wInitialATX.PublishEpoch+1, wInitialATX.ID(), gomock.Any())
proof, err := atxHdlr.storeAtx(context.Background(), initialAtx, wInitialATX)
Expand All @@ -755,8 +755,8 @@ func TestHandlerV1_StoreAtx(t *testing.T) {
watx1.Sign(sig)
atx1 := toAtx(t, watx1)

atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx any) bool {
return atx.(*types.ActivationTx).ID() == watx1.ID()
atxHdlr.mbeacon.EXPECT().OnAtx(gomock.Cond(func(atx *types.ActivationTx) bool {
return atx.ID() == watx1.ID()
}))
atxHdlr.mtortoise.EXPECT().OnAtx(watx1.PublishEpoch+1, watx1.ID(), gomock.Any())
proof, err = atxHdlr.storeAtx(context.Background(), atx1, watx1)
Expand Down
6 changes: 4 additions & 2 deletions activation/handler_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ func (h *handlerMocks) expectVerifyNIPoSTs(
}

func (h *handlerMocks) expectStoreAtxV2(atx *wire.ActivationTxV2) {
h.mbeacon.EXPECT().OnAtx(gomock.Cond(func(a any) bool { return a.(*types.ActivationTx).ID() == atx.ID() }))
h.mbeacon.EXPECT().OnAtx(gomock.Cond(func(a *types.ActivationTx) bool {
return a.ID() == atx.ID()
}))
h.mtortoise.EXPECT().OnAtx(atx.PublishEpoch+1, atx.ID(), gomock.Any())
h.mValidator.EXPECT().IsVerifyingFullPost().Return(false)
}
Expand Down Expand Up @@ -1652,7 +1654,7 @@ func Test_Marriages(t *testing.T) {
atxHandler.mMalPublish.EXPECT().Publish(
gomock.Any(),
sig.NodeID(),
gomock.Cond(func(data any) bool {
gomock.Cond(func(data wire.Proof) bool {
_, ok := data.(*wire.ProofDoubleMarry)
return ok
}),
Expand Down
19 changes: 19 additions & 0 deletions activation/mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions activation/mocks/subscription.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions activation/poet_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions api/grpcserver/grpcserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,14 +575,14 @@ func TestSmesherService(t *testing.T) {
c.smeshingProvider.EXPECT().StartSmeshing(gomock.Any()).Return(nil)
c.postSupervisor.EXPECT().Start(gomock.Any(),
gomock.All(
gomock.Cond(func(postOpts any) bool {
return postOpts.(activation.PostSetupOpts).DataDir == opts.DataDir
gomock.Cond(func(postOpts activation.PostSetupOpts) bool {
return postOpts.DataDir == opts.DataDir
}),
gomock.Cond(func(postOpts any) bool {
return postOpts.(activation.PostSetupOpts).NumUnits == opts.NumUnits
gomock.Cond(func(postOpts activation.PostSetupOpts) bool {
return postOpts.NumUnits == opts.NumUnits
}),
gomock.Cond(func(postOpts any) bool {
return postOpts.(activation.PostSetupOpts).MaxFileSize == opts.MaxFileSize
gomock.Cond(func(postOpts activation.PostSetupOpts) bool {
return postOpts.MaxFileSize == opts.MaxFileSize
}),
), sig).Return(nil)
c.grpcPostService.EXPECT().AllowConnections(true)
Expand Down
Loading

0 comments on commit 3ffdb8e

Please sign in to comment.