test: fix mockgen version (#9127)

* setup: update mockgen

* Add expect ConsensusVersion in app_test

* fix ChainAnteDecorators tests

* remove types/handler.go from autogenerating mocks

* adding a note

* adding note

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
This commit is contained in:
Robert Zaremba
2021-05-25 09:18:59 +00:00
committed by GitHub
co-authored by Alessio Treglia Marko
parent 8669f0b4b9
commit 8c1fe4b166
13 changed files with 638 additions and 605 deletions
+12 -4
View File
@@ -30,10 +30,18 @@ func (s *handlerTestSuite) TestChainAnteDecorators() {
mockCtrl := gomock.NewController(s.T())
mockAnteDecorator1 := mocks.NewMockAnteDecorator(mockCtrl)
mockAnteDecorator1.EXPECT().AnteHandle(gomock.Eq(ctx), gomock.Eq(tx), true, gomock.Any()).Times(1)
sdk.ChainAnteDecorators(mockAnteDecorator1)(ctx, tx, true) //nolint:errcheck
_, err := sdk.ChainAnteDecorators(mockAnteDecorator1)(ctx, tx, true)
s.Require().NoError(err)
mockAnteDecorator2 := mocks.NewMockAnteDecorator(mockCtrl)
mockAnteDecorator1.EXPECT().AnteHandle(gomock.Eq(ctx), gomock.Eq(tx), true, mockAnteDecorator2).Times(1)
mockAnteDecorator2.EXPECT().AnteHandle(gomock.Eq(ctx), gomock.Eq(tx), true, nil).Times(1)
sdk.ChainAnteDecorators(mockAnteDecorator1, mockAnteDecorator2)
// NOTE: we can't check that mockAnteDecorator2 is passed as the last argument because
// ChainAnteDecorators wraps the decorators into closures, so each decorator is
// receving a closure.
mockAnteDecorator1.EXPECT().AnteHandle(gomock.Eq(ctx), gomock.Eq(tx), true, gomock.Any()).Times(1)
mockAnteDecorator2.EXPECT().AnteHandle(gomock.Eq(ctx), gomock.Eq(tx), true, gomock.Any()).Times(1)
_, err = sdk.ChainAnteDecorators(
mockAnteDecorator1,
mockAnteDecorator2)(ctx, tx, true)
s.Require().NoError(err)
}