You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A mock used for testing isn't compatible with the latest interface.
The mock in question is the MockAppModule in tests/mocks/types_module_module.go, which implements BeginBlock() and EndBlock(), which aren't defined in the current AppModule. Unit tests use these methods, so make test will result in a compile error after generating the latest mock with make mocks.
$ make mocks
$ make test
...
# github.com/Finschia/finschia-sdk/types/module_test [github.com/Finschia/finschia-sdk/types/module.test]
types/module/module_test.go:255:26: mockAppModule1.EXPECT().BeginBlock undefined (type *mocks.MockAppModuleMockRecorder has no field or method BeginBlock)
types/module/module_test.go:256:26: mockAppModule2.EXPECT().BeginBlock undefined (type *mocks.MockAppModuleMockRecorder has no field or method BeginBlock)
types/module/module_test.go:274:26: mockAppModule1.EXPECT().EndBlock undefined (type *mocks.MockAppModuleMockRecorder has no field or method EndBlock)
types/module/module_test.go:275:26: mockAppModule2.EXPECT().EndBlock undefined (type *mocks.MockAppModuleMockRecorder has no field or method EndBlock)
types/module/module_test.go:280:26: mockAppModule1.EXPECT().EndBlock undefined (type *mocks.MockAppModuleMockRecorder has no field or method EndBlock)
types/module/module_test.go:281:26: mockAppModule2.EXPECT().EndBlock undefined (type *mocks.MockAppModuleMockRecorder has no field or method EndBlock)
This is why the AppModule definition was changed and merged without make mocks and the old definition mock is considered to be used.
This problem has been caused by cosmos/cosmos-sdk v0.46.x before Finschia/finschia-sdk, since finschia-sdk forked it as is, and appears to be fixed in cosmos-sdk v0.47.0. (Therefore, we can ignore this issue and forbid merging sources that have make mocks and wait to follow cosmos-sdk v0.47.0.)
Version
main, v0.47.0
Steps to Reproduce
By cloning this repository and running make mocks, an auto-generated mock is defined differently.
$ git clone https://github.com/Finschia/finschia-sdk.git
$ cd finschia-sdk
$ make mocks
$ git diff
Summary of Bug
A mock used for testing isn't compatible with the latest interface.
The mock in question is the
MockAppModule
intests/mocks/types_module_module.go
, which implementsBeginBlock()
andEndBlock()
, which aren't defined in the currentAppModule
. Unit tests use these methods, somake test
will result in a compile error after generating the latest mock withmake mocks
.This is why the
AppModule
definition was changed and merged withoutmake mocks
and the old definition mock is considered to be used.This problem has been caused by
cosmos/cosmos-sdk
v0.46.x beforeFinschia/finschia-sdk
, since finschia-sdk forked it as is, and appears to be fixed in cosmos-sdk v0.47.0. (Therefore, we can ignore this issue and forbid merging sources that havemake mocks
and wait to follow cosmos-sdk v0.47.0.)Version
main
,v0.47.0
Steps to Reproduce
By cloning this repository and running
make mocks
, an auto-generated mock is defined differently.$ git clone https://github.com/Finschia/finschia-sdk.git $ cd finschia-sdk $ make mocks $ git diff
The important difference is that the following
BeginBlock()
andEndBlock()
definitions have disappeared.Neither
BeginBlock()
norEndBlock()
is defined in the currentAppModule
interface from which isMockAppModule
is generated.For Admin Use
The text was updated successfully, but these errors were encountered: