Skip to content

Commit

Permalink
Generate expected keeper mocks with mockgen
Browse files Browse the repository at this point in the history
- Adds new makefile commands to install mockgen and to
generate expected keeper mocks for use in x/rollup
unit tests.
- Generates expected keeper mocks for the x/rollup module
  • Loading branch information
natebeauregard committed Aug 21, 2024
1 parent 6ca2243 commit 291f66b
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ install-go-test-coverage:
install-abi-gen:
go install github.com/ethereum/go-ethereum/cmd/[email protected]

.PHONY: install-mockgen
install-mockgen:
go install github.com/golang/mock/[email protected]

.PHONY: install-foundry
install-foundry:
${SCRIPTS_PATH}/install-foundry.sh
Expand All @@ -59,6 +63,10 @@ install-foundry:
gen-bindings:
${SCRIPTS_PATH}/generate-bindings.sh

.PHONY: gen-mocks
gen-mocks:
mockgen -source=x/rollup/types/expected_keepers.go -package testutil -destination x/rollup/testutil/expected_keepers_mocks.go

$(COVER_OUT):
go test -short ./... -coverprofile=$@ -covermode=atomic -coverpkg=./...

Expand Down
92 changes: 92 additions & 0 deletions x/rollup/testutil/expected_keepers_mocks.go

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

0 comments on commit 291f66b

Please sign in to comment.