Skip to content

Switch mocking library from golang/mock to go.uber.org/mock #797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ doc-predicate: ## Generate markdown documentation for all the predicates (module
.PHONY: mock
mock: ## Generate all the mocks (for tests)
@echo "${COLOR_CYAN} 🧱 Generating all the mocks${COLOR_RESET}"
@go install github.com/golang/mock/mockgen@v1.6.0
@go install go.uber.org/mock@v0.5.0
@mockgen -source=x/mint/types/expected_keepers.go -package testutil -destination x/mint/testutil/expected_keepers_mocks.go
@mockgen -source=x/vesting/types/expected_keepers.go -package testutil -destination x/vesting/testutil/expected_keepers_mocks.go
@mockgen -source=x/logic/types/expected_keepers.go -package testutil -destination x/logic/testutil/expected_keepers_mocks.go
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ require (
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
github.com/wk8/go-ordered-map/v2 v2.1.8
go.uber.org/mock v0.5.0
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0
golang.org/x/net v0.30.0
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142
Expand Down Expand Up @@ -288,14 +289,14 @@ require (
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/mod v0.18.0 // indirect
golang.org/x/oauth2 v0.22.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/term v0.25.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
golang.org/x/tools v0.22.0 // indirect
google.golang.org/api v0.171.0 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
Expand Down
3 changes: 1 addition & 2 deletions x/logic/fs/composite/fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import (
"testing"
"time"

"github.com/golang/mock/gomock"

. "github.com/smartystreets/goconvey/convey"
"go.uber.org/mock/gomock"

"github.com/axone-protocol/axoned/v10/x/logic/fs/wasm"
"github.com/axone-protocol/axoned/v10/x/logic/testutil"
Expand Down
2 changes: 1 addition & 1 deletion x/logic/fs/filtered/fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"testing"
"time"

"github.com/golang/mock/gomock"
"github.com/samber/lo"
"go.uber.org/mock/gomock"

. "github.com/smartystreets/goconvey/convey"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/fs/wasm/fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"

dbm "github.com/cosmos/cosmos-db"
"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"

. "github.com/smartystreets/goconvey/convey"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/keeper/features_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (

"dario.cat/mergo"
"github.com/cucumber/godog"
"github.com/golang/mock/gomock"
"github.com/sergi/go-diff/diffmatchpatch"
"github.com/smartystreets/goconvey/convey/reporting"
"go.uber.org/mock/gomock"
"gopkg.in/yaml.v3"

. "github.com/smartystreets/goconvey/convey"
Expand Down
2 changes: 1 addition & 1 deletion x/logic/keeper/grpc_query_ask_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"io/fs"
"testing"

"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"

. "github.com/smartystreets/goconvey/convey"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/keeper/grpc_query_params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io/fs"
"testing"

"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"

. "github.com/smartystreets/goconvey/convey"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io/fs"
"testing"

"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"

. "github.com/smartystreets/goconvey/convey"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/meter/weighted_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"math"
"testing"

"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"

. "github.com/smartystreets/goconvey/convey"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/bank_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/axone-protocol/prolog/engine"
dbm "github.com/cosmos/cosmos-db"
"github.com/golang/mock/gomock"
"github.com/samber/lo"
"go.uber.org/mock/gomock"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/builtin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/axone-protocol/prolog/engine"
dbm "github.com/cosmos/cosmos-db"
"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"

. "github.com/smartystreets/goconvey/convey"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/predicate/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

dbm "github.com/cosmos/cosmos-db"
"github.com/golang/mock/gomock"
"go.uber.org/mock/gomock"

. "github.com/smartystreets/goconvey/convey"

Expand Down
2 changes: 1 addition & 1 deletion x/logic/testutil/expected_keepers_mocks.go

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

2 changes: 1 addition & 1 deletion x/logic/testutil/fs_mocks.go

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

2 changes: 1 addition & 1 deletion x/logic/testutil/gas_mocks.go

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

2 changes: 1 addition & 1 deletion x/logic/testutil/interface_registry_mocks.go

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

2 changes: 1 addition & 1 deletion x/logic/testutil/keeper_mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"strconv"

"github.com/golang/mock/gomock"
"github.com/samber/lo"
"go.uber.org/mock/gomock"

codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
2 changes: 1 addition & 1 deletion x/logic/testutil/read_file_fs_mocks.go

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

2 changes: 1 addition & 1 deletion x/mint/keeper/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package keeper_test
import (
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/suite"
"go.uber.org/mock/gomock"

"cosmossdk.io/collections"
"cosmossdk.io/math"
Expand Down
2 changes: 1 addition & 1 deletion x/mint/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
gocontext "context"
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/suite"
"go.uber.org/mock/gomock"

storetypes "cosmossdk.io/store/types"

Expand Down
2 changes: 1 addition & 1 deletion x/mint/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package keeper_test
import (
"testing"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/suite"
"go.uber.org/mock/gomock"

"cosmossdk.io/math"
storetypes "cosmossdk.io/store/types"
Expand Down
2 changes: 1 addition & 1 deletion x/mint/testutil/expected_keepers_mocks.go

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

2 changes: 1 addition & 1 deletion x/vesting/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"testing"
"time"

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/suite"
"go.uber.org/mock/gomock"

cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
cmttime "github.com/cometbft/cometbft/types/time"
Expand Down
2 changes: 1 addition & 1 deletion x/vesting/testutil/expected_keepers_mocks.go

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

Loading