Repository navigation
Commit 2b7fdc6
authored
Record sei-cosmos mockgen commands as go:generate directives (#4622)
The mocks under `sei-cosmos/tests/mocks` are committed MockGen output
that tests still import, but the only record of how to regenerate them
was the `mocks` target in `sei-cosmos/Makefile`, which was deleted along
with the rest of that Makefile.
This adds `sei-cosmos/tests/mocks/generate.go` with `go:generate`
directives for the four source-mode mocks (account retriever, module,
invariant, router), pinned to the `golang/mock` version already in
`go.mod`, so `go generate ./sei-cosmos/tests/mocks/` rebuilds them.
Running it brought `types_module_module.go` up to date: `MockAppModule`
had stale hand-kept `BeginBlock`/`MidBlock` methods that `AppModule` no
longer declares, and `MockEndBlockAppModule` lacked `EndBlock`.
`TestManager_MidBlock` now uses `MockMidBlockAppModule`, which is what
`Manager.MidBlock` actually type-asserts on. The other three files only
change their `Source:` header line.
The handler mock is hand-edited to call the next ante handler and the
package-mode mocks (tm-db, gogo grpc, Tendermint logger) point at
upstream paths, so they are left as they are. Test-only change; the
`sei-cosmos/types`, `client` and `store/dbadapter` tests pass.1 parent fd0f570 commit 2b7fdc6
6 files changed
Lines changed: 26 additions & 31 deletions
File tree
- sei-cosmos
- tests/mocks
- types/module
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
281 | | - | |
| 280 | + | |
| 281 | + | |
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| |||
0 commit comments