diff --git a/Makefile b/Makefile index ec0b15ee2bd..a0760e03ce8 100644 --- a/Makefile +++ b/Makefile @@ -144,15 +144,16 @@ cosmovisor: .PHONY: build build-linux build-simd-all build-simd-linux cosmovisor +mockgen_cmd=go run github.com/golang/mock/mockgen + mocks: $(MOCKS_DIR) - mockgen -source=client/account_retriever.go -package mocks -destination tests/mocks/account_retriever.go - mockgen -package mocks -destination tests/mocks/tendermint_tm_db_DB.go github.com/tendermint/tm-db DB - mockgen -source=types/module/module.go -package mocks -destination tests/mocks/types_module_module.go - mockgen -source=types/invariant.go -package mocks -destination tests/mocks/types_invariant.go - mockgen -source=types/router.go -package mocks -destination tests/mocks/types_router.go - mockgen -source=types/handler.go -package mocks -destination tests/mocks/types_handler.go - mockgen -package mocks -destination tests/mocks/grpc_server.go github.com/gogo/protobuf/grpc Server - mockgen -package mocks -destination tests/mocks/tendermint_tendermint_libs_log_DB.go github.com/tendermint/tendermint/libs/log Logger + $(mockgen_cmd) -source=client/account_retriever.go -package mocks -destination tests/mocks/account_retriever.go + $(mockgen_cmd) -package mocks -destination tests/mocks/tendermint_tm_db_DB.go github.com/tendermint/tm-db DB + $(mockgen_cmd) -source=types/module/module.go -package mocks -destination tests/mocks/types_module_module.go + $(mockgen_cmd) -source=types/invariant.go -package mocks -destination tests/mocks/types_invariant.go + $(mockgen_cmd) -source=types/router.go -package mocks -destination tests/mocks/types_router.go + $(mockgen_cmd) -package mocks -destination tests/mocks/grpc_server.go github.com/gogo/protobuf/grpc Server + $(mockgen_cmd) -package mocks -destination tests/mocks/tendermint_tendermint_libs_log_DB.go github.com/tendermint/tendermint/libs/log Logger .PHONY: mocks $(MOCKS_DIR): diff --git a/go.mod b/go.mod index d7ceea8bef9..a620e7f7a5a 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25 github.com/gogo/gateway v1.1.0 github.com/gogo/protobuf v1.3.3 - github.com/golang/mock v1.4.4 + github.com/golang/mock v1.5.0 github.com/golang/protobuf v1.5.2 github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 diff --git a/go.sum b/go.sum index e5f34ed0d95..5a77e4cf5f3 100644 --- a/go.sum +++ b/go.sum @@ -249,6 +249,8 @@ github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -783,6 +785,7 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -913,6 +916,7 @@ golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/simapp/app_test.go b/simapp/app_test.go index 4d25f11cb48..56c6dc1485a 100644 --- a/simapp/app_test.go +++ b/simapp/app_test.go @@ -210,6 +210,7 @@ func TestInitGenesisOnMigration(t *testing.T) { mockDefaultGenesis := json.RawMessage(`{"key": "value"}`) mockModule.EXPECT().DefaultGenesis(gomock.Eq(app.appCodec)).Times(1).Return(mockDefaultGenesis) mockModule.EXPECT().InitGenesis(gomock.Eq(ctx), gomock.Eq(app.appCodec), gomock.Eq(mockDefaultGenesis)).Times(1).Return(nil) + mockModule.EXPECT().ConsensusVersion().Times(1).Return(uint64(0)) app.mm.Modules["mock"] = mockModule diff --git a/tests/mocks/account_retriever.go b/tests/mocks/account_retriever.go index 37fa1aa64da..c75e1d059b0 100644 --- a/tests/mocks/account_retriever.go +++ b/tests/mocks/account_retriever.go @@ -5,79 +5,80 @@ package mocks import ( + reflect "reflect" + client "github.com/cosmos/cosmos-sdk/client" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/crypto/types" + types0 "github.com/cosmos/cosmos-sdk/types" gomock "github.com/golang/mock/gomock" - reflect "reflect" ) -// MockAccount is a mock of Account interface +// MockAccount is a mock of Account interface. type MockAccount struct { ctrl *gomock.Controller recorder *MockAccountMockRecorder } -// MockAccountMockRecorder is the mock recorder for MockAccount +// MockAccountMockRecorder is the mock recorder for MockAccount. type MockAccountMockRecorder struct { mock *MockAccount } -// NewMockAccount creates a new mock instance +// NewMockAccount creates a new mock instance. func NewMockAccount(ctrl *gomock.Controller) *MockAccount { mock := &MockAccount{ctrl: ctrl} mock.recorder = &MockAccountMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockAccount) EXPECT() *MockAccountMockRecorder { return m.recorder } -// GetAddress mocks base method -func (m *MockAccount) GetAddress() types.AccAddress { +// GetAccountNumber mocks base method. +func (m *MockAccount) GetAccountNumber() uint64 { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAddress") - ret0, _ := ret[0].(types.AccAddress) + ret := m.ctrl.Call(m, "GetAccountNumber") + ret0, _ := ret[0].(uint64) return ret0 } -// GetAddress indicates an expected call of GetAddress -func (mr *MockAccountMockRecorder) GetAddress() *gomock.Call { +// GetAccountNumber indicates an expected call of GetAccountNumber. +func (mr *MockAccountMockRecorder) GetAccountNumber() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAddress", reflect.TypeOf((*MockAccount)(nil).GetAddress)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccountNumber", reflect.TypeOf((*MockAccount)(nil).GetAccountNumber)) } -// GetPubKey mocks base method -func (m *MockAccount) GetPubKey() cryptotypes.PubKey { +// GetAddress mocks base method. +func (m *MockAccount) GetAddress() types0.AccAddress { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetPubKey") - ret0, _ := ret[0].(cryptotypes.PubKey) + ret := m.ctrl.Call(m, "GetAddress") + ret0, _ := ret[0].(types0.AccAddress) return ret0 } -// GetPubKey indicates an expected call of GetPubKey -func (mr *MockAccountMockRecorder) GetPubKey() *gomock.Call { +// GetAddress indicates an expected call of GetAddress. +func (mr *MockAccountMockRecorder) GetAddress() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPubKey", reflect.TypeOf((*MockAccount)(nil).GetPubKey)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAddress", reflect.TypeOf((*MockAccount)(nil).GetAddress)) } -// GetAccountNumber mocks base method -func (m *MockAccount) GetAccountNumber() uint64 { +// GetPubKey mocks base method. +func (m *MockAccount) GetPubKey() types.PubKey { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAccountNumber") - ret0, _ := ret[0].(uint64) + ret := m.ctrl.Call(m, "GetPubKey") + ret0, _ := ret[0].(types.PubKey) return ret0 } -// GetAccountNumber indicates an expected call of GetAccountNumber -func (mr *MockAccountMockRecorder) GetAccountNumber() *gomock.Call { +// GetPubKey indicates an expected call of GetPubKey. +func (mr *MockAccountMockRecorder) GetPubKey() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccountNumber", reflect.TypeOf((*MockAccount)(nil).GetAccountNumber)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPubKey", reflect.TypeOf((*MockAccount)(nil).GetPubKey)) } -// GetSequence mocks base method +// GetSequence mocks base method. func (m *MockAccount) GetSequence() uint64 { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetSequence") @@ -85,37 +86,51 @@ func (m *MockAccount) GetSequence() uint64 { return ret0 } -// GetSequence indicates an expected call of GetSequence +// GetSequence indicates an expected call of GetSequence. func (mr *MockAccountMockRecorder) GetSequence() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSequence", reflect.TypeOf((*MockAccount)(nil).GetSequence)) } -// MockAccountRetriever is a mock of AccountRetriever interface +// MockAccountRetriever is a mock of AccountRetriever interface. type MockAccountRetriever struct { ctrl *gomock.Controller recorder *MockAccountRetrieverMockRecorder } -// MockAccountRetrieverMockRecorder is the mock recorder for MockAccountRetriever +// MockAccountRetrieverMockRecorder is the mock recorder for MockAccountRetriever. type MockAccountRetrieverMockRecorder struct { mock *MockAccountRetriever } -// NewMockAccountRetriever creates a new mock instance +// NewMockAccountRetriever creates a new mock instance. func NewMockAccountRetriever(ctrl *gomock.Controller) *MockAccountRetriever { mock := &MockAccountRetriever{ctrl: ctrl} mock.recorder = &MockAccountRetrieverMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockAccountRetriever) EXPECT() *MockAccountRetrieverMockRecorder { return m.recorder } -// GetAccount mocks base method -func (m *MockAccountRetriever) GetAccount(clientCtx client.Context, addr types.AccAddress) (client.Account, error) { +// EnsureExists mocks base method. +func (m *MockAccountRetriever) EnsureExists(clientCtx client.Context, addr types0.AccAddress) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EnsureExists", clientCtx, addr) + ret0, _ := ret[0].(error) + return ret0 +} + +// EnsureExists indicates an expected call of EnsureExists. +func (mr *MockAccountRetrieverMockRecorder) EnsureExists(clientCtx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureExists", reflect.TypeOf((*MockAccountRetriever)(nil).EnsureExists), clientCtx, addr) +} + +// GetAccount mocks base method. +func (m *MockAccountRetriever) GetAccount(clientCtx client.Context, addr types0.AccAddress) (client.Account, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAccount", clientCtx, addr) ret0, _ := ret[0].(client.Account) @@ -123,54 +138,40 @@ func (m *MockAccountRetriever) GetAccount(clientCtx client.Context, addr types.A return ret0, ret1 } -// GetAccount indicates an expected call of GetAccount +// GetAccount indicates an expected call of GetAccount. func (mr *MockAccountRetrieverMockRecorder) GetAccount(clientCtx, addr interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountRetriever)(nil).GetAccount), clientCtx, addr) } -// GetAccountWithHeight mocks base method -func (m *MockAccountRetriever) GetAccountWithHeight(clientCtx client.Context, addr types.AccAddress) (client.Account, int64, error) { +// GetAccountNumberSequence mocks base method. +func (m *MockAccountRetriever) GetAccountNumberSequence(clientCtx client.Context, addr types0.AccAddress) (uint64, uint64, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAccountWithHeight", clientCtx, addr) - ret0, _ := ret[0].(client.Account) - ret1, _ := ret[1].(int64) + ret := m.ctrl.Call(m, "GetAccountNumberSequence", clientCtx, addr) + ret0, _ := ret[0].(uint64) + ret1, _ := ret[1].(uint64) ret2, _ := ret[2].(error) return ret0, ret1, ret2 } -// GetAccountWithHeight indicates an expected call of GetAccountWithHeight -func (mr *MockAccountRetrieverMockRecorder) GetAccountWithHeight(clientCtx, addr interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccountWithHeight", reflect.TypeOf((*MockAccountRetriever)(nil).GetAccountWithHeight), clientCtx, addr) -} - -// EnsureExists mocks base method -func (m *MockAccountRetriever) EnsureExists(clientCtx client.Context, addr types.AccAddress) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "EnsureExists", clientCtx, addr) - ret0, _ := ret[0].(error) - return ret0 -} - -// EnsureExists indicates an expected call of EnsureExists -func (mr *MockAccountRetrieverMockRecorder) EnsureExists(clientCtx, addr interface{}) *gomock.Call { +// GetAccountNumberSequence indicates an expected call of GetAccountNumberSequence. +func (mr *MockAccountRetrieverMockRecorder) GetAccountNumberSequence(clientCtx, addr interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureExists", reflect.TypeOf((*MockAccountRetriever)(nil).EnsureExists), clientCtx, addr) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccountNumberSequence", reflect.TypeOf((*MockAccountRetriever)(nil).GetAccountNumberSequence), clientCtx, addr) } -// GetAccountNumberSequence mocks base method -func (m *MockAccountRetriever) GetAccountNumberSequence(clientCtx client.Context, addr types.AccAddress) (uint64, uint64, error) { +// GetAccountWithHeight mocks base method. +func (m *MockAccountRetriever) GetAccountWithHeight(clientCtx client.Context, addr types0.AccAddress) (client.Account, int64, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAccountNumberSequence", clientCtx, addr) - ret0, _ := ret[0].(uint64) - ret1, _ := ret[1].(uint64) + ret := m.ctrl.Call(m, "GetAccountWithHeight", clientCtx, addr) + ret0, _ := ret[0].(client.Account) + ret1, _ := ret[1].(int64) ret2, _ := ret[2].(error) return ret0, ret1, ret2 } -// GetAccountNumberSequence indicates an expected call of GetAccountNumberSequence -func (mr *MockAccountRetrieverMockRecorder) GetAccountNumberSequence(clientCtx, addr interface{}) *gomock.Call { +// GetAccountWithHeight indicates an expected call of GetAccountWithHeight. +func (mr *MockAccountRetrieverMockRecorder) GetAccountWithHeight(clientCtx, addr interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccountNumberSequence", reflect.TypeOf((*MockAccountRetriever)(nil).GetAccountNumberSequence), clientCtx, addr) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccountWithHeight", reflect.TypeOf((*MockAccountRetriever)(nil).GetAccountWithHeight), clientCtx, addr) } diff --git a/tests/mocks/grpc_server.go b/tests/mocks/grpc_server.go index 91fedb7ae56..df4372c4bc9 100644 --- a/tests/mocks/grpc_server.go +++ b/tests/mocks/grpc_server.go @@ -5,41 +5,42 @@ package mocks import ( + reflect "reflect" + gomock "github.com/golang/mock/gomock" grpc "google.golang.org/grpc" - reflect "reflect" ) -// MockServer is a mock of Server interface +// MockServer is a mock of Server interface. type MockServer struct { ctrl *gomock.Controller recorder *MockServerMockRecorder } -// MockServerMockRecorder is the mock recorder for MockServer +// MockServerMockRecorder is the mock recorder for MockServer. type MockServerMockRecorder struct { mock *MockServer } -// NewMockServer creates a new mock instance +// NewMockServer creates a new mock instance. func NewMockServer(ctrl *gomock.Controller) *MockServer { mock := &MockServer{ctrl: ctrl} mock.recorder = &MockServerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockServer) EXPECT() *MockServerMockRecorder { return m.recorder } -// RegisterService mocks base method +// RegisterService mocks base method. func (m *MockServer) RegisterService(arg0 *grpc.ServiceDesc, arg1 interface{}) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterService", arg0, arg1) } -// RegisterService indicates an expected call of RegisterService +// RegisterService indicates an expected call of RegisterService. func (mr *MockServerMockRecorder) RegisterService(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterService", reflect.TypeOf((*MockServer)(nil).RegisterService), arg0, arg1) diff --git a/tests/mocks/tendermint_tendermint_libs_log_DB.go b/tests/mocks/tendermint_tendermint_libs_log_DB.go index 454fd9c7600..929ab059b56 100644 --- a/tests/mocks/tendermint_tendermint_libs_log_DB.go +++ b/tests/mocks/tendermint_tendermint_libs_log_DB.go @@ -5,35 +5,36 @@ package mocks import ( + reflect "reflect" + gomock "github.com/golang/mock/gomock" log "github.com/tendermint/tendermint/libs/log" - reflect "reflect" ) -// MockLogger is a mock of Logger interface +// MockLogger is a mock of Logger interface. type MockLogger struct { ctrl *gomock.Controller recorder *MockLoggerMockRecorder } -// MockLoggerMockRecorder is the mock recorder for MockLogger +// MockLoggerMockRecorder is the mock recorder for MockLogger. type MockLoggerMockRecorder struct { mock *MockLogger } -// NewMockLogger creates a new mock instance +// NewMockLogger creates a new mock instance. func NewMockLogger(ctrl *gomock.Controller) *MockLogger { mock := &MockLogger{ctrl: ctrl} mock.recorder = &MockLoggerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockLogger) EXPECT() *MockLoggerMockRecorder { return m.recorder } -// Debug mocks base method +// Debug mocks base method. func (m *MockLogger) Debug(arg0 string, arg1 ...interface{}) { m.ctrl.T.Helper() varargs := []interface{}{arg0} @@ -43,14 +44,14 @@ func (m *MockLogger) Debug(arg0 string, arg1 ...interface{}) { m.ctrl.Call(m, "Debug", varargs...) } -// Debug indicates an expected call of Debug +// Debug indicates an expected call of Debug. func (mr *MockLoggerMockRecorder) Debug(arg0 interface{}, arg1 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Debug", reflect.TypeOf((*MockLogger)(nil).Debug), varargs...) } -// Error mocks base method +// Error mocks base method. func (m *MockLogger) Error(arg0 string, arg1 ...interface{}) { m.ctrl.T.Helper() varargs := []interface{}{arg0} @@ -60,14 +61,14 @@ func (m *MockLogger) Error(arg0 string, arg1 ...interface{}) { m.ctrl.Call(m, "Error", varargs...) } -// Error indicates an expected call of Error +// Error indicates an expected call of Error. func (mr *MockLoggerMockRecorder) Error(arg0 interface{}, arg1 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Error", reflect.TypeOf((*MockLogger)(nil).Error), varargs...) } -// Info mocks base method +// Info mocks base method. func (m *MockLogger) Info(arg0 string, arg1 ...interface{}) { m.ctrl.T.Helper() varargs := []interface{}{arg0} @@ -77,14 +78,14 @@ func (m *MockLogger) Info(arg0 string, arg1 ...interface{}) { m.ctrl.Call(m, "Info", varargs...) } -// Info indicates an expected call of Info +// Info indicates an expected call of Info. func (mr *MockLoggerMockRecorder) Info(arg0 interface{}, arg1 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0}, arg1...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockLogger)(nil).Info), varargs...) } -// With mocks base method +// With mocks base method. func (m *MockLogger) With(arg0 ...interface{}) log.Logger { m.ctrl.T.Helper() varargs := []interface{}{} @@ -96,7 +97,7 @@ func (m *MockLogger) With(arg0 ...interface{}) log.Logger { return ret0 } -// With indicates an expected call of With +// With indicates an expected call of With. func (mr *MockLoggerMockRecorder) With(arg0 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "With", reflect.TypeOf((*MockLogger)(nil).With), arg0...) diff --git a/tests/mocks/tendermint_tm_db_DB.go b/tests/mocks/tendermint_tm_db_DB.go index cdf5e5ab0a2..db0e7b0aee7 100644 --- a/tests/mocks/tendermint_tm_db_DB.go +++ b/tests/mocks/tendermint_tm_db_DB.go @@ -5,35 +5,36 @@ package mocks import ( + reflect "reflect" + gomock "github.com/golang/mock/gomock" db "github.com/tendermint/tm-db" - reflect "reflect" ) -// MockDB is a mock of DB interface +// MockDB is a mock of DB interface. type MockDB struct { ctrl *gomock.Controller recorder *MockDBMockRecorder } -// MockDBMockRecorder is the mock recorder for MockDB +// MockDBMockRecorder is the mock recorder for MockDB. type MockDBMockRecorder struct { mock *MockDB } -// NewMockDB creates a new mock instance +// NewMockDB creates a new mock instance. func NewMockDB(ctrl *gomock.Controller) *MockDB { mock := &MockDB{ctrl: ctrl} mock.recorder = &MockDBMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockDB) EXPECT() *MockDBMockRecorder { return m.recorder } -// Close mocks base method +// Close mocks base method. func (m *MockDB) Close() error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Close") @@ -41,13 +42,13 @@ func (m *MockDB) Close() error { return ret0 } -// Close indicates an expected call of Close +// Close indicates an expected call of Close. func (mr *MockDBMockRecorder) Close() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockDB)(nil).Close)) } -// Delete mocks base method +// Delete mocks base method. func (m *MockDB) Delete(arg0 []byte) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Delete", arg0) @@ -55,13 +56,13 @@ func (m *MockDB) Delete(arg0 []byte) error { return ret0 } -// Delete indicates an expected call of Delete +// Delete indicates an expected call of Delete. func (mr *MockDBMockRecorder) Delete(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockDB)(nil).Delete), arg0) } -// DeleteSync mocks base method +// DeleteSync mocks base method. func (m *MockDB) DeleteSync(arg0 []byte) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeleteSync", arg0) @@ -69,13 +70,13 @@ func (m *MockDB) DeleteSync(arg0 []byte) error { return ret0 } -// DeleteSync indicates an expected call of DeleteSync +// DeleteSync indicates an expected call of DeleteSync. func (mr *MockDBMockRecorder) DeleteSync(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteSync", reflect.TypeOf((*MockDB)(nil).DeleteSync), arg0) } -// Get mocks base method +// Get mocks base method. func (m *MockDB) Get(arg0 []byte) ([]byte, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Get", arg0) @@ -84,13 +85,13 @@ func (m *MockDB) Get(arg0 []byte) ([]byte, error) { return ret0, ret1 } -// Get indicates an expected call of Get +// Get indicates an expected call of Get. func (mr *MockDBMockRecorder) Get(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockDB)(nil).Get), arg0) } -// Has mocks base method +// Has mocks base method. func (m *MockDB) Has(arg0 []byte) (bool, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Has", arg0) @@ -99,13 +100,13 @@ func (m *MockDB) Has(arg0 []byte) (bool, error) { return ret0, ret1 } -// Has indicates an expected call of Has +// Has indicates an expected call of Has. func (mr *MockDBMockRecorder) Has(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Has", reflect.TypeOf((*MockDB)(nil).Has), arg0) } -// Iterator mocks base method +// Iterator mocks base method. func (m *MockDB) Iterator(arg0, arg1 []byte) (db.Iterator, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Iterator", arg0, arg1) @@ -114,13 +115,13 @@ func (m *MockDB) Iterator(arg0, arg1 []byte) (db.Iterator, error) { return ret0, ret1 } -// Iterator indicates an expected call of Iterator +// Iterator indicates an expected call of Iterator. func (mr *MockDBMockRecorder) Iterator(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Iterator", reflect.TypeOf((*MockDB)(nil).Iterator), arg0, arg1) } -// NewBatch mocks base method +// NewBatch mocks base method. func (m *MockDB) NewBatch() db.Batch { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "NewBatch") @@ -128,13 +129,13 @@ func (m *MockDB) NewBatch() db.Batch { return ret0 } -// NewBatch indicates an expected call of NewBatch +// NewBatch indicates an expected call of NewBatch. func (mr *MockDBMockRecorder) NewBatch() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewBatch", reflect.TypeOf((*MockDB)(nil).NewBatch)) } -// Print mocks base method +// Print mocks base method. func (m *MockDB) Print() error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Print") @@ -142,13 +143,13 @@ func (m *MockDB) Print() error { return ret0 } -// Print indicates an expected call of Print +// Print indicates an expected call of Print. func (mr *MockDBMockRecorder) Print() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Print", reflect.TypeOf((*MockDB)(nil).Print)) } -// ReverseIterator mocks base method +// ReverseIterator mocks base method. func (m *MockDB) ReverseIterator(arg0, arg1 []byte) (db.Iterator, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ReverseIterator", arg0, arg1) @@ -157,13 +158,13 @@ func (m *MockDB) ReverseIterator(arg0, arg1 []byte) (db.Iterator, error) { return ret0, ret1 } -// ReverseIterator indicates an expected call of ReverseIterator +// ReverseIterator indicates an expected call of ReverseIterator. func (mr *MockDBMockRecorder) ReverseIterator(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReverseIterator", reflect.TypeOf((*MockDB)(nil).ReverseIterator), arg0, arg1) } -// Set mocks base method +// Set mocks base method. func (m *MockDB) Set(arg0, arg1 []byte) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Set", arg0, arg1) @@ -171,13 +172,13 @@ func (m *MockDB) Set(arg0, arg1 []byte) error { return ret0 } -// Set indicates an expected call of Set +// Set indicates an expected call of Set. func (mr *MockDBMockRecorder) Set(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Set", reflect.TypeOf((*MockDB)(nil).Set), arg0, arg1) } -// SetSync mocks base method +// SetSync mocks base method. func (m *MockDB) SetSync(arg0, arg1 []byte) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SetSync", arg0, arg1) @@ -185,13 +186,13 @@ func (m *MockDB) SetSync(arg0, arg1 []byte) error { return ret0 } -// SetSync indicates an expected call of SetSync +// SetSync indicates an expected call of SetSync. func (mr *MockDBMockRecorder) SetSync(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetSync", reflect.TypeOf((*MockDB)(nil).SetSync), arg0, arg1) } -// Stats mocks base method +// Stats mocks base method. func (m *MockDB) Stats() map[string]string { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Stats") @@ -199,7 +200,7 @@ func (m *MockDB) Stats() map[string]string { return ret0 } -// Stats indicates an expected call of Stats +// Stats indicates an expected call of Stats. func (mr *MockDBMockRecorder) Stats() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stats", reflect.TypeOf((*MockDB)(nil).Stats)) diff --git a/tests/mocks/types_handler.go b/tests/mocks/types_handler.go index da80614ae88..1be212dcf2e 100644 --- a/tests/mocks/types_handler.go +++ b/tests/mocks/types_handler.go @@ -1,48 +1,50 @@ -// Code generated by MockGen. DO NOT EDIT. +// Code generated by MockGen. // Source: types/handler.go +// Chanes: +// + AnteHandler(...): calling `next` at the end of the function to run all anthe handler chain. // Package mocks is a generated GoMock package. package mocks import ( + reflect "reflect" + types "github.com/cosmos/cosmos-sdk/types" gomock "github.com/golang/mock/gomock" - reflect "reflect" ) -// MockAnteDecorator is a mock of AnteDecorator interface +// MockAnteDecorator is a mock of AnteDecorator interface. type MockAnteDecorator struct { ctrl *gomock.Controller recorder *MockAnteDecoratorMockRecorder } -// MockAnteDecoratorMockRecorder is the mock recorder for MockAnteDecorator +// MockAnteDecoratorMockRecorder is the mock recorder for MockAnteDecorator. type MockAnteDecoratorMockRecorder struct { mock *MockAnteDecorator } -// NewMockAnteDecorator creates a new mock instance +// NewMockAnteDecorator creates a new mock instance. func NewMockAnteDecorator(ctrl *gomock.Controller) *MockAnteDecorator { mock := &MockAnteDecorator{ctrl: ctrl} mock.recorder = &MockAnteDecoratorMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockAnteDecorator) EXPECT() *MockAnteDecoratorMockRecorder { return m.recorder } -// AnteHandle mocks base method +// AnteHandle mocks base method. func (m *MockAnteDecorator) AnteHandle(ctx types.Context, tx types.Tx, simulate bool, next types.AnteHandler) (types.Context, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "AnteHandle", ctx, tx, simulate, next) - ret0, _ := ret[0].(types.Context) - ret1, _ := ret[1].(error) - return ret0, ret1 + m.ctrl.Call(m, "AnteHandle", ctx, tx, simulate, next) + // NOTE: we need to edit a generated code to call the "next handler" + return next(ctx, tx, simulate) } -// AnteHandle indicates an expected call of AnteHandle +// AnteHandle indicates an expected call of AnteHandle. func (mr *MockAnteDecoratorMockRecorder) AnteHandle(ctx, tx, simulate, next interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AnteHandle", reflect.TypeOf((*MockAnteDecorator)(nil).AnteHandle), ctx, tx, simulate, next) diff --git a/tests/mocks/types_invariant.go b/tests/mocks/types_invariant.go index 325b108b20b..c6b9fe94d11 100644 --- a/tests/mocks/types_invariant.go +++ b/tests/mocks/types_invariant.go @@ -5,41 +5,42 @@ package mocks import ( + reflect "reflect" + types "github.com/cosmos/cosmos-sdk/types" gomock "github.com/golang/mock/gomock" - reflect "reflect" ) -// MockInvariantRegistry is a mock of InvariantRegistry interface +// MockInvariantRegistry is a mock of InvariantRegistry interface. type MockInvariantRegistry struct { ctrl *gomock.Controller recorder *MockInvariantRegistryMockRecorder } -// MockInvariantRegistryMockRecorder is the mock recorder for MockInvariantRegistry +// MockInvariantRegistryMockRecorder is the mock recorder for MockInvariantRegistry. type MockInvariantRegistryMockRecorder struct { mock *MockInvariantRegistry } -// NewMockInvariantRegistry creates a new mock instance +// NewMockInvariantRegistry creates a new mock instance. func NewMockInvariantRegistry(ctrl *gomock.Controller) *MockInvariantRegistry { mock := &MockInvariantRegistry{ctrl: ctrl} mock.recorder = &MockInvariantRegistryMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockInvariantRegistry) EXPECT() *MockInvariantRegistryMockRecorder { return m.recorder } -// RegisterRoute mocks base method +// RegisterRoute mocks base method. func (m *MockInvariantRegistry) RegisterRoute(moduleName, route string, invar types.Invariant) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterRoute", moduleName, route, invar) } -// RegisterRoute indicates an expected call of RegisterRoute +// RegisterRoute indicates an expected call of RegisterRoute. func (mr *MockInvariantRegistryMockRecorder) RegisterRoute(moduleName, route, invar interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterRoute", reflect.TypeOf((*MockInvariantRegistry)(nil).RegisterRoute), moduleName, route, invar) diff --git a/tests/mocks/types_module_module.go b/tests/mocks/types_module_module.go index 974ec1f17ab..772dc5de6eb 100644 --- a/tests/mocks/types_module_module.go +++ b/tests/mocks/types_module_module.go @@ -20,378 +20,366 @@ import ( types1 "github.com/tendermint/tendermint/abci/types" ) -// MockAppModuleBasic is a mock of AppModuleBasic interface +// MockAppModuleBasic is a mock of AppModuleBasic interface. type MockAppModuleBasic struct { ctrl *gomock.Controller recorder *MockAppModuleBasicMockRecorder } -// MockAppModuleBasicMockRecorder is the mock recorder for MockAppModuleBasic +// MockAppModuleBasicMockRecorder is the mock recorder for MockAppModuleBasic. type MockAppModuleBasicMockRecorder struct { mock *MockAppModuleBasic } -// NewMockAppModuleBasic creates a new mock instance +// NewMockAppModuleBasic creates a new mock instance. func NewMockAppModuleBasic(ctrl *gomock.Controller) *MockAppModuleBasic { mock := &MockAppModuleBasic{ctrl: ctrl} mock.recorder = &MockAppModuleBasicMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockAppModuleBasic) EXPECT() *MockAppModuleBasicMockRecorder { return m.recorder } -// Name mocks base method -func (m *MockAppModuleBasic) Name() string { +// DefaultGenesis mocks base method. +func (m *MockAppModuleBasic) DefaultGenesis(arg0 codec.JSONCodec) json.RawMessage { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Name") - ret0, _ := ret[0].(string) + ret := m.ctrl.Call(m, "DefaultGenesis", arg0) + ret0, _ := ret[0].(json.RawMessage) return ret0 } -// Name indicates an expected call of Name -func (mr *MockAppModuleBasicMockRecorder) Name() *gomock.Call { +// DefaultGenesis indicates an expected call of DefaultGenesis. +func (mr *MockAppModuleBasicMockRecorder) DefaultGenesis(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockAppModuleBasic)(nil).Name)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DefaultGenesis", reflect.TypeOf((*MockAppModuleBasic)(nil).DefaultGenesis), arg0) } -// RegisterLegacyAminoCodec mocks base method -func (m *MockAppModuleBasic) RegisterLegacyAminoCodec(arg0 *codec.LegacyAmino) { +// GetQueryCmd mocks base method. +func (m *MockAppModuleBasic) GetQueryCmd() *cobra.Command { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterLegacyAminoCodec", arg0) + ret := m.ctrl.Call(m, "GetQueryCmd") + ret0, _ := ret[0].(*cobra.Command) + return ret0 } -// RegisterLegacyAminoCodec indicates an expected call of RegisterLegacyAminoCodec -func (mr *MockAppModuleBasicMockRecorder) RegisterLegacyAminoCodec(arg0 interface{}) *gomock.Call { +// GetQueryCmd indicates an expected call of GetQueryCmd. +func (mr *MockAppModuleBasicMockRecorder) GetQueryCmd() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLegacyAminoCodec", reflect.TypeOf((*MockAppModuleBasic)(nil).RegisterLegacyAminoCodec), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModuleBasic)(nil).GetQueryCmd)) } -// RegisterInterfaces mocks base method -func (m *MockAppModuleBasic) RegisterInterfaces(arg0 types.InterfaceRegistry) { +// GetTxCmd mocks base method. +func (m *MockAppModuleBasic) GetTxCmd() *cobra.Command { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterInterfaces", arg0) + ret := m.ctrl.Call(m, "GetTxCmd") + ret0, _ := ret[0].(*cobra.Command) + return ret0 } -// RegisterInterfaces indicates an expected call of RegisterInterfaces -func (mr *MockAppModuleBasicMockRecorder) RegisterInterfaces(arg0 interface{}) *gomock.Call { +// GetTxCmd indicates an expected call of GetTxCmd. +func (mr *MockAppModuleBasicMockRecorder) GetTxCmd() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockAppModuleBasic)(nil).RegisterInterfaces), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockAppModuleBasic)(nil).GetTxCmd)) } -// DefaultGenesis mocks base method -func (m *MockAppModuleBasic) DefaultGenesis(arg0 codec.JSONCodec) json.RawMessage { +// Name mocks base method. +func (m *MockAppModuleBasic) Name() string { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DefaultGenesis", arg0) - ret0, _ := ret[0].(json.RawMessage) + ret := m.ctrl.Call(m, "Name") + ret0, _ := ret[0].(string) return ret0 } -// DefaultGenesis indicates an expected call of DefaultGenesis -func (mr *MockAppModuleBasicMockRecorder) DefaultGenesis(arg0 interface{}) *gomock.Call { +// Name indicates an expected call of Name. +func (mr *MockAppModuleBasicMockRecorder) Name() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DefaultGenesis", reflect.TypeOf((*MockAppModuleBasic)(nil).DefaultGenesis), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockAppModuleBasic)(nil).Name)) } -// ValidateGenesis mocks base method -func (m *MockAppModuleBasic) ValidateGenesis(arg0 codec.JSONCodec, arg1 client.TxEncodingConfig, arg2 json.RawMessage) error { +// RegisterGRPCGatewayRoutes mocks base method. +func (m *MockAppModuleBasic) RegisterGRPCGatewayRoutes(arg0 client.Context, arg1 *runtime.ServeMux) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ValidateGenesis", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 + m.ctrl.Call(m, "RegisterGRPCGatewayRoutes", arg0, arg1) } -// ValidateGenesis indicates an expected call of ValidateGenesis -func (mr *MockAppModuleBasicMockRecorder) ValidateGenesis(arg0, arg1, arg2 interface{}) *gomock.Call { +// RegisterGRPCGatewayRoutes indicates an expected call of RegisterGRPCGatewayRoutes. +func (mr *MockAppModuleBasicMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateGenesis", reflect.TypeOf((*MockAppModuleBasic)(nil).ValidateGenesis), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockAppModuleBasic)(nil).RegisterGRPCGatewayRoutes), arg0, arg1) } -// RegisterRESTRoutes mocks base method -func (m *MockAppModuleBasic) RegisterRESTRoutes(arg0 client.Context, arg1 *mux.Router) { +// RegisterInterfaces mocks base method. +func (m *MockAppModuleBasic) RegisterInterfaces(arg0 types.InterfaceRegistry) { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterRESTRoutes", arg0, arg1) + m.ctrl.Call(m, "RegisterInterfaces", arg0) } -// RegisterRESTRoutes indicates an expected call of RegisterRESTRoutes -func (mr *MockAppModuleBasicMockRecorder) RegisterRESTRoutes(arg0, arg1 interface{}) *gomock.Call { +// RegisterInterfaces indicates an expected call of RegisterInterfaces. +func (mr *MockAppModuleBasicMockRecorder) RegisterInterfaces(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterRESTRoutes", reflect.TypeOf((*MockAppModuleBasic)(nil).RegisterRESTRoutes), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockAppModuleBasic)(nil).RegisterInterfaces), arg0) } -// RegisterGRPCGatewayRoutes mocks base method -func (m *MockAppModuleBasic) RegisterGRPCGatewayRoutes(arg0 client.Context, arg1 *runtime.ServeMux) { +// RegisterLegacyAminoCodec mocks base method. +func (m *MockAppModuleBasic) RegisterLegacyAminoCodec(arg0 *codec.LegacyAmino) { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterGRPCGatewayRoutes", arg0, arg1) + m.ctrl.Call(m, "RegisterLegacyAminoCodec", arg0) } -// RegisterGRPCGatewayRoutes indicates an expected call of RegisterGRPCGatewayRoutes -func (mr *MockAppModuleBasicMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 interface{}) *gomock.Call { +// RegisterLegacyAminoCodec indicates an expected call of RegisterLegacyAminoCodec. +func (mr *MockAppModuleBasicMockRecorder) RegisterLegacyAminoCodec(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockAppModuleBasic)(nil).RegisterGRPCGatewayRoutes), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLegacyAminoCodec", reflect.TypeOf((*MockAppModuleBasic)(nil).RegisterLegacyAminoCodec), arg0) } -// GetTxCmd mocks base method -func (m *MockAppModuleBasic) GetTxCmd() *cobra.Command { +// RegisterRESTRoutes mocks base method. +func (m *MockAppModuleBasic) RegisterRESTRoutes(arg0 client.Context, arg1 *mux.Router) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTxCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 + m.ctrl.Call(m, "RegisterRESTRoutes", arg0, arg1) } -// GetTxCmd indicates an expected call of GetTxCmd -func (mr *MockAppModuleBasicMockRecorder) GetTxCmd() *gomock.Call { +// RegisterRESTRoutes indicates an expected call of RegisterRESTRoutes. +func (mr *MockAppModuleBasicMockRecorder) RegisterRESTRoutes(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockAppModuleBasic)(nil).GetTxCmd)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterRESTRoutes", reflect.TypeOf((*MockAppModuleBasic)(nil).RegisterRESTRoutes), arg0, arg1) } -// GetQueryCmd mocks base method -func (m *MockAppModuleBasic) GetQueryCmd() *cobra.Command { +// ValidateGenesis mocks base method. +func (m *MockAppModuleBasic) ValidateGenesis(arg0 codec.JSONCodec, arg1 client.TxEncodingConfig, arg2 json.RawMessage) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetQueryCmd") - ret0, _ := ret[0].(*cobra.Command) + ret := m.ctrl.Call(m, "ValidateGenesis", arg0, arg1, arg2) + ret0, _ := ret[0].(error) return ret0 } -// GetQueryCmd indicates an expected call of GetQueryCmd -func (mr *MockAppModuleBasicMockRecorder) GetQueryCmd() *gomock.Call { +// ValidateGenesis indicates an expected call of ValidateGenesis. +func (mr *MockAppModuleBasicMockRecorder) ValidateGenesis(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModuleBasic)(nil).GetQueryCmd)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateGenesis", reflect.TypeOf((*MockAppModuleBasic)(nil).ValidateGenesis), arg0, arg1, arg2) } -// MockAppModuleGenesis is a mock of AppModuleGenesis interface +// MockAppModuleGenesis is a mock of AppModuleGenesis interface. type MockAppModuleGenesis struct { ctrl *gomock.Controller recorder *MockAppModuleGenesisMockRecorder } -// MockAppModuleGenesisMockRecorder is the mock recorder for MockAppModuleGenesis +// MockAppModuleGenesisMockRecorder is the mock recorder for MockAppModuleGenesis. type MockAppModuleGenesisMockRecorder struct { mock *MockAppModuleGenesis } -// NewMockAppModuleGenesis creates a new mock instance +// NewMockAppModuleGenesis creates a new mock instance. func NewMockAppModuleGenesis(ctrl *gomock.Controller) *MockAppModuleGenesis { mock := &MockAppModuleGenesis{ctrl: ctrl} mock.recorder = &MockAppModuleGenesisMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockAppModuleGenesis) EXPECT() *MockAppModuleGenesisMockRecorder { return m.recorder } -// Name mocks base method -func (m *MockAppModuleGenesis) Name() string { +// DefaultGenesis mocks base method. +func (m *MockAppModuleGenesis) DefaultGenesis(arg0 codec.JSONCodec) json.RawMessage { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Name") - ret0, _ := ret[0].(string) + ret := m.ctrl.Call(m, "DefaultGenesis", arg0) + ret0, _ := ret[0].(json.RawMessage) return ret0 } -// Name indicates an expected call of Name -func (mr *MockAppModuleGenesisMockRecorder) Name() *gomock.Call { +// DefaultGenesis indicates an expected call of DefaultGenesis. +func (mr *MockAppModuleGenesisMockRecorder) DefaultGenesis(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockAppModuleGenesis)(nil).Name)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DefaultGenesis", reflect.TypeOf((*MockAppModuleGenesis)(nil).DefaultGenesis), arg0) } -// RegisterLegacyAminoCodec mocks base method -func (m *MockAppModuleGenesis) RegisterLegacyAminoCodec(arg0 *codec.LegacyAmino) { +// ExportGenesis mocks base method. +func (m *MockAppModuleGenesis) ExportGenesis(arg0 types0.Context, arg1 codec.JSONCodec) json.RawMessage { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterLegacyAminoCodec", arg0) + ret := m.ctrl.Call(m, "ExportGenesis", arg0, arg1) + ret0, _ := ret[0].(json.RawMessage) + return ret0 } -// RegisterLegacyAminoCodec indicates an expected call of RegisterLegacyAminoCodec -func (mr *MockAppModuleGenesisMockRecorder) RegisterLegacyAminoCodec(arg0 interface{}) *gomock.Call { +// ExportGenesis indicates an expected call of ExportGenesis. +func (mr *MockAppModuleGenesisMockRecorder) ExportGenesis(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLegacyAminoCodec", reflect.TypeOf((*MockAppModuleGenesis)(nil).RegisterLegacyAminoCodec), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportGenesis", reflect.TypeOf((*MockAppModuleGenesis)(nil).ExportGenesis), arg0, arg1) } -// RegisterInterfaces mocks base method -func (m *MockAppModuleGenesis) RegisterInterfaces(arg0 types.InterfaceRegistry) { +// GetQueryCmd mocks base method. +func (m *MockAppModuleGenesis) GetQueryCmd() *cobra.Command { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterInterfaces", arg0) + ret := m.ctrl.Call(m, "GetQueryCmd") + ret0, _ := ret[0].(*cobra.Command) + return ret0 } -// RegisterInterfaces indicates an expected call of RegisterInterfaces -func (mr *MockAppModuleGenesisMockRecorder) RegisterInterfaces(arg0 interface{}) *gomock.Call { +// GetQueryCmd indicates an expected call of GetQueryCmd. +func (mr *MockAppModuleGenesisMockRecorder) GetQueryCmd() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockAppModuleGenesis)(nil).RegisterInterfaces), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModuleGenesis)(nil).GetQueryCmd)) } -// DefaultGenesis mocks base method -func (m *MockAppModuleGenesis) DefaultGenesis(arg0 codec.JSONCodec) json.RawMessage { +// GetTxCmd mocks base method. +func (m *MockAppModuleGenesis) GetTxCmd() *cobra.Command { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DefaultGenesis", arg0) - ret0, _ := ret[0].(json.RawMessage) + ret := m.ctrl.Call(m, "GetTxCmd") + ret0, _ := ret[0].(*cobra.Command) return ret0 } -// DefaultGenesis indicates an expected call of DefaultGenesis -func (mr *MockAppModuleGenesisMockRecorder) DefaultGenesis(arg0 interface{}) *gomock.Call { +// GetTxCmd indicates an expected call of GetTxCmd. +func (mr *MockAppModuleGenesisMockRecorder) GetTxCmd() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DefaultGenesis", reflect.TypeOf((*MockAppModuleGenesis)(nil).DefaultGenesis), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockAppModuleGenesis)(nil).GetTxCmd)) } -// ValidateGenesis mocks base method -func (m *MockAppModuleGenesis) ValidateGenesis(arg0 codec.JSONCodec, arg1 client.TxEncodingConfig, arg2 json.RawMessage) error { +// InitGenesis mocks base method. +func (m *MockAppModuleGenesis) InitGenesis(arg0 types0.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) []types1.ValidatorUpdate { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ValidateGenesis", arg0, arg1, arg2) - ret0, _ := ret[0].(error) + ret := m.ctrl.Call(m, "InitGenesis", arg0, arg1, arg2) + ret0, _ := ret[0].([]types1.ValidatorUpdate) return ret0 } -// ValidateGenesis indicates an expected call of ValidateGenesis -func (mr *MockAppModuleGenesisMockRecorder) ValidateGenesis(arg0, arg1, arg2 interface{}) *gomock.Call { +// InitGenesis indicates an expected call of InitGenesis. +func (mr *MockAppModuleGenesisMockRecorder) InitGenesis(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateGenesis", reflect.TypeOf((*MockAppModuleGenesis)(nil).ValidateGenesis), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitGenesis", reflect.TypeOf((*MockAppModuleGenesis)(nil).InitGenesis), arg0, arg1, arg2) } -// RegisterRESTRoutes mocks base method -func (m *MockAppModuleGenesis) RegisterRESTRoutes(arg0 client.Context, arg1 *mux.Router) { +// Name mocks base method. +func (m *MockAppModuleGenesis) Name() string { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterRESTRoutes", arg0, arg1) + ret := m.ctrl.Call(m, "Name") + ret0, _ := ret[0].(string) + return ret0 } -// RegisterRESTRoutes indicates an expected call of RegisterRESTRoutes -func (mr *MockAppModuleGenesisMockRecorder) RegisterRESTRoutes(arg0, arg1 interface{}) *gomock.Call { +// Name indicates an expected call of Name. +func (mr *MockAppModuleGenesisMockRecorder) Name() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterRESTRoutes", reflect.TypeOf((*MockAppModuleGenesis)(nil).RegisterRESTRoutes), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockAppModuleGenesis)(nil).Name)) } -// RegisterGRPCGatewayRoutes mocks base method +// RegisterGRPCGatewayRoutes mocks base method. func (m *MockAppModuleGenesis) RegisterGRPCGatewayRoutes(arg0 client.Context, arg1 *runtime.ServeMux) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterGRPCGatewayRoutes", arg0, arg1) } -// RegisterGRPCGatewayRoutes indicates an expected call of RegisterGRPCGatewayRoutes +// RegisterGRPCGatewayRoutes indicates an expected call of RegisterGRPCGatewayRoutes. func (mr *MockAppModuleGenesisMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockAppModuleGenesis)(nil).RegisterGRPCGatewayRoutes), arg0, arg1) } -// GetTxCmd mocks base method -func (m *MockAppModuleGenesis) GetTxCmd() *cobra.Command { +// RegisterInterfaces mocks base method. +func (m *MockAppModuleGenesis) RegisterInterfaces(arg0 types.InterfaceRegistry) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTxCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 + m.ctrl.Call(m, "RegisterInterfaces", arg0) } -// GetTxCmd indicates an expected call of GetTxCmd -func (mr *MockAppModuleGenesisMockRecorder) GetTxCmd() *gomock.Call { +// RegisterInterfaces indicates an expected call of RegisterInterfaces. +func (mr *MockAppModuleGenesisMockRecorder) RegisterInterfaces(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockAppModuleGenesis)(nil).GetTxCmd)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockAppModuleGenesis)(nil).RegisterInterfaces), arg0) } -// GetQueryCmd mocks base method -func (m *MockAppModuleGenesis) GetQueryCmd() *cobra.Command { +// RegisterLegacyAminoCodec mocks base method. +func (m *MockAppModuleGenesis) RegisterLegacyAminoCodec(arg0 *codec.LegacyAmino) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetQueryCmd") - ret0, _ := ret[0].(*cobra.Command) - return ret0 + m.ctrl.Call(m, "RegisterLegacyAminoCodec", arg0) } -// GetQueryCmd indicates an expected call of GetQueryCmd -func (mr *MockAppModuleGenesisMockRecorder) GetQueryCmd() *gomock.Call { +// RegisterLegacyAminoCodec indicates an expected call of RegisterLegacyAminoCodec. +func (mr *MockAppModuleGenesisMockRecorder) RegisterLegacyAminoCodec(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModuleGenesis)(nil).GetQueryCmd)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLegacyAminoCodec", reflect.TypeOf((*MockAppModuleGenesis)(nil).RegisterLegacyAminoCodec), arg0) } -// InitGenesis mocks base method -func (m *MockAppModuleGenesis) InitGenesis(arg0 types0.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) []types1.ValidatorUpdate { +// RegisterRESTRoutes mocks base method. +func (m *MockAppModuleGenesis) RegisterRESTRoutes(arg0 client.Context, arg1 *mux.Router) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "InitGenesis", arg0, arg1, arg2) - ret0, _ := ret[0].([]types1.ValidatorUpdate) - return ret0 + m.ctrl.Call(m, "RegisterRESTRoutes", arg0, arg1) } -// InitGenesis indicates an expected call of InitGenesis -func (mr *MockAppModuleGenesisMockRecorder) InitGenesis(arg0, arg1, arg2 interface{}) *gomock.Call { +// RegisterRESTRoutes indicates an expected call of RegisterRESTRoutes. +func (mr *MockAppModuleGenesisMockRecorder) RegisterRESTRoutes(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitGenesis", reflect.TypeOf((*MockAppModuleGenesis)(nil).InitGenesis), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterRESTRoutes", reflect.TypeOf((*MockAppModuleGenesis)(nil).RegisterRESTRoutes), arg0, arg1) } -// ExportGenesis mocks base method -func (m *MockAppModuleGenesis) ExportGenesis(arg0 types0.Context, arg1 codec.JSONCodec) json.RawMessage { +// ValidateGenesis mocks base method. +func (m *MockAppModuleGenesis) ValidateGenesis(arg0 codec.JSONCodec, arg1 client.TxEncodingConfig, arg2 json.RawMessage) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ExportGenesis", arg0, arg1) - ret0, _ := ret[0].(json.RawMessage) + ret := m.ctrl.Call(m, "ValidateGenesis", arg0, arg1, arg2) + ret0, _ := ret[0].(error) return ret0 } -// ExportGenesis indicates an expected call of ExportGenesis -func (mr *MockAppModuleGenesisMockRecorder) ExportGenesis(arg0, arg1 interface{}) *gomock.Call { +// ValidateGenesis indicates an expected call of ValidateGenesis. +func (mr *MockAppModuleGenesisMockRecorder) ValidateGenesis(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportGenesis", reflect.TypeOf((*MockAppModuleGenesis)(nil).ExportGenesis), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateGenesis", reflect.TypeOf((*MockAppModuleGenesis)(nil).ValidateGenesis), arg0, arg1, arg2) } -// MockAppModule is a mock of AppModule interface +// MockAppModule is a mock of AppModule interface. type MockAppModule struct { ctrl *gomock.Controller recorder *MockAppModuleMockRecorder } -// MockAppModuleMockRecorder is the mock recorder for MockAppModule +// MockAppModuleMockRecorder is the mock recorder for MockAppModule. type MockAppModuleMockRecorder struct { mock *MockAppModule } -// NewMockAppModule creates a new mock instance +// NewMockAppModule creates a new mock instance. func NewMockAppModule(ctrl *gomock.Controller) *MockAppModule { mock := &MockAppModule{ctrl: ctrl} mock.recorder = &MockAppModuleMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockAppModule) EXPECT() *MockAppModuleMockRecorder { return m.recorder } -// Name mocks base method -func (m *MockAppModule) Name() string { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Name") - ret0, _ := ret[0].(string) - return ret0 -} - -// Name indicates an expected call of Name -func (mr *MockAppModuleMockRecorder) Name() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockAppModule)(nil).Name)) -} - -// RegisterLegacyAminoCodec mocks base method -func (m *MockAppModule) RegisterLegacyAminoCodec(arg0 *codec.LegacyAmino) { +// BeginBlock mocks base method. +func (m *MockAppModule) BeginBlock(arg0 types0.Context, arg1 types1.RequestBeginBlock) { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterLegacyAminoCodec", arg0) + m.ctrl.Call(m, "BeginBlock", arg0, arg1) } -// RegisterLegacyAminoCodec indicates an expected call of RegisterLegacyAminoCodec -func (mr *MockAppModuleMockRecorder) RegisterLegacyAminoCodec(arg0 interface{}) *gomock.Call { +// BeginBlock indicates an expected call of BeginBlock. +func (mr *MockAppModuleMockRecorder) BeginBlock(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLegacyAminoCodec", reflect.TypeOf((*MockAppModule)(nil).RegisterLegacyAminoCodec), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeginBlock", reflect.TypeOf((*MockAppModule)(nil).BeginBlock), arg0, arg1) } -// RegisterInterfaces mocks base method -func (m *MockAppModule) RegisterInterfaces(arg0 types.InterfaceRegistry) { +// ConsensusVersion mocks base method. +func (m *MockAppModule) ConsensusVersion() uint64 { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterInterfaces", arg0) + ret := m.ctrl.Call(m, "ConsensusVersion") + ret0, _ := ret[0].(uint64) + return ret0 } -// RegisterInterfaces indicates an expected call of RegisterInterfaces -func (mr *MockAppModuleMockRecorder) RegisterInterfaces(arg0 interface{}) *gomock.Call { +// ConsensusVersion indicates an expected call of ConsensusVersion. +func (mr *MockAppModuleMockRecorder) ConsensusVersion() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockAppModule)(nil).RegisterInterfaces), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConsensusVersion", reflect.TypeOf((*MockAppModule)(nil).ConsensusVersion)) } -// DefaultGenesis mocks base method +// DefaultGenesis mocks base method. func (m *MockAppModule) DefaultGenesis(arg0 codec.JSONCodec) json.RawMessage { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DefaultGenesis", arg0) @@ -399,51 +387,55 @@ func (m *MockAppModule) DefaultGenesis(arg0 codec.JSONCodec) json.RawMessage { return ret0 } -// DefaultGenesis indicates an expected call of DefaultGenesis +// DefaultGenesis indicates an expected call of DefaultGenesis. func (mr *MockAppModuleMockRecorder) DefaultGenesis(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DefaultGenesis", reflect.TypeOf((*MockAppModule)(nil).DefaultGenesis), arg0) } -// ValidateGenesis mocks base method -func (m *MockAppModule) ValidateGenesis(arg0 codec.JSONCodec, arg1 client.TxEncodingConfig, arg2 json.RawMessage) error { +// EndBlock mocks base method. +func (m *MockAppModule) EndBlock(arg0 types0.Context, arg1 types1.RequestEndBlock) []types1.ValidatorUpdate { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ValidateGenesis", arg0, arg1, arg2) - ret0, _ := ret[0].(error) + ret := m.ctrl.Call(m, "EndBlock", arg0, arg1) + ret0, _ := ret[0].([]types1.ValidatorUpdate) return ret0 } -// ValidateGenesis indicates an expected call of ValidateGenesis -func (mr *MockAppModuleMockRecorder) ValidateGenesis(arg0, arg1, arg2 interface{}) *gomock.Call { +// EndBlock indicates an expected call of EndBlock. +func (mr *MockAppModuleMockRecorder) EndBlock(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateGenesis", reflect.TypeOf((*MockAppModule)(nil).ValidateGenesis), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EndBlock", reflect.TypeOf((*MockAppModule)(nil).EndBlock), arg0, arg1) } -// RegisterRESTRoutes mocks base method -func (m *MockAppModule) RegisterRESTRoutes(arg0 client.Context, arg1 *mux.Router) { +// ExportGenesis mocks base method. +func (m *MockAppModule) ExportGenesis(arg0 types0.Context, arg1 codec.JSONCodec) json.RawMessage { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterRESTRoutes", arg0, arg1) + ret := m.ctrl.Call(m, "ExportGenesis", arg0, arg1) + ret0, _ := ret[0].(json.RawMessage) + return ret0 } -// RegisterRESTRoutes indicates an expected call of RegisterRESTRoutes -func (mr *MockAppModuleMockRecorder) RegisterRESTRoutes(arg0, arg1 interface{}) *gomock.Call { +// ExportGenesis indicates an expected call of ExportGenesis. +func (mr *MockAppModuleMockRecorder) ExportGenesis(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterRESTRoutes", reflect.TypeOf((*MockAppModule)(nil).RegisterRESTRoutes), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportGenesis", reflect.TypeOf((*MockAppModule)(nil).ExportGenesis), arg0, arg1) } -// RegisterGRPCGatewayRoutes mocks base method -func (m *MockAppModule) RegisterGRPCGatewayRoutes(arg0 client.Context, arg1 *runtime.ServeMux) { +// GetQueryCmd mocks base method. +func (m *MockAppModule) GetQueryCmd() *cobra.Command { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterGRPCGatewayRoutes", arg0, arg1) + ret := m.ctrl.Call(m, "GetQueryCmd") + ret0, _ := ret[0].(*cobra.Command) + return ret0 } -// RegisterGRPCGatewayRoutes indicates an expected call of RegisterGRPCGatewayRoutes -func (mr *MockAppModuleMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 interface{}) *gomock.Call { +// GetQueryCmd indicates an expected call of GetQueryCmd. +func (mr *MockAppModuleMockRecorder) GetQueryCmd() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockAppModule)(nil).RegisterGRPCGatewayRoutes), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModule)(nil).GetQueryCmd)) } -// GetTxCmd mocks base method +// GetTxCmd mocks base method. func (m *MockAppModule) GetTxCmd() *cobra.Command { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetTxCmd") @@ -451,145 +443,164 @@ func (m *MockAppModule) GetTxCmd() *cobra.Command { return ret0 } -// GetTxCmd indicates an expected call of GetTxCmd +// GetTxCmd indicates an expected call of GetTxCmd. func (mr *MockAppModuleMockRecorder) GetTxCmd() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockAppModule)(nil).GetTxCmd)) } -// GetQueryCmd mocks base method -func (m *MockAppModule) GetQueryCmd() *cobra.Command { +// InitGenesis mocks base method. +func (m *MockAppModule) InitGenesis(arg0 types0.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) []types1.ValidatorUpdate { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetQueryCmd") - ret0, _ := ret[0].(*cobra.Command) + ret := m.ctrl.Call(m, "InitGenesis", arg0, arg1, arg2) + ret0, _ := ret[0].([]types1.ValidatorUpdate) return ret0 } -// GetQueryCmd indicates an expected call of GetQueryCmd -func (mr *MockAppModuleMockRecorder) GetQueryCmd() *gomock.Call { +// InitGenesis indicates an expected call of InitGenesis. +func (mr *MockAppModuleMockRecorder) InitGenesis(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModule)(nil).GetQueryCmd)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitGenesis", reflect.TypeOf((*MockAppModule)(nil).InitGenesis), arg0, arg1, arg2) } -// InitGenesis mocks base method -func (m *MockAppModule) InitGenesis(arg0 types0.Context, arg1 codec.JSONCodec, arg2 json.RawMessage) []types1.ValidatorUpdate { +// LegacyQuerierHandler mocks base method. +func (m *MockAppModule) LegacyQuerierHandler(arg0 *codec.LegacyAmino) types0.Querier { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "InitGenesis", arg0, arg1, arg2) - ret0, _ := ret[0].([]types1.ValidatorUpdate) + ret := m.ctrl.Call(m, "LegacyQuerierHandler", arg0) + ret0, _ := ret[0].(types0.Querier) return ret0 } -// InitGenesis indicates an expected call of InitGenesis -func (mr *MockAppModuleMockRecorder) InitGenesis(arg0, arg1, arg2 interface{}) *gomock.Call { +// LegacyQuerierHandler indicates an expected call of LegacyQuerierHandler. +func (mr *MockAppModuleMockRecorder) LegacyQuerierHandler(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitGenesis", reflect.TypeOf((*MockAppModule)(nil).InitGenesis), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyQuerierHandler", reflect.TypeOf((*MockAppModule)(nil).LegacyQuerierHandler), arg0) } -// ExportGenesis mocks base method -func (m *MockAppModule) ExportGenesis(arg0 types0.Context, arg1 codec.JSONCodec) json.RawMessage { +// Name mocks base method. +func (m *MockAppModule) Name() string { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ExportGenesis", arg0, arg1) - ret0, _ := ret[0].(json.RawMessage) + ret := m.ctrl.Call(m, "Name") + ret0, _ := ret[0].(string) return ret0 } -// ConsensusVersion mocks base method -func (m *MockAppModule) ConsensusVersion() uint64 { return 1 } +// Name indicates an expected call of Name. +func (mr *MockAppModuleMockRecorder) Name() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Name", reflect.TypeOf((*MockAppModule)(nil).Name)) +} -// ExportGenesis indicates an expected call of ExportGenesis -func (mr *MockAppModuleMockRecorder) ExportGenesis(arg0, arg1 interface{}) *gomock.Call { +// QuerierRoute mocks base method. +func (m *MockAppModule) QuerierRoute() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "QuerierRoute") + ret0, _ := ret[0].(string) + return ret0 +} + +// QuerierRoute indicates an expected call of QuerierRoute. +func (mr *MockAppModuleMockRecorder) QuerierRoute() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportGenesis", reflect.TypeOf((*MockAppModule)(nil).ExportGenesis), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QuerierRoute", reflect.TypeOf((*MockAppModule)(nil).QuerierRoute)) } -// RegisterInvariants mocks base method -func (m *MockAppModule) RegisterInvariants(arg0 types0.InvariantRegistry) { +// RegisterGRPCGatewayRoutes mocks base method. +func (m *MockAppModule) RegisterGRPCGatewayRoutes(arg0 client.Context, arg1 *runtime.ServeMux) { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterInvariants", arg0) + m.ctrl.Call(m, "RegisterGRPCGatewayRoutes", arg0, arg1) } -// RegisterInvariants indicates an expected call of RegisterInvariants -func (mr *MockAppModuleMockRecorder) RegisterInvariants(arg0 interface{}) *gomock.Call { +// RegisterGRPCGatewayRoutes indicates an expected call of RegisterGRPCGatewayRoutes. +func (mr *MockAppModuleMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInvariants", reflect.TypeOf((*MockAppModule)(nil).RegisterInvariants), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockAppModule)(nil).RegisterGRPCGatewayRoutes), arg0, arg1) } -// Route mocks base method -func (m *MockAppModule) Route() types0.Route { +// RegisterInterfaces mocks base method. +func (m *MockAppModule) RegisterInterfaces(arg0 types.InterfaceRegistry) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Route") - ret0, _ := ret[0].(types0.Route) - return ret0 + m.ctrl.Call(m, "RegisterInterfaces", arg0) } -// Route indicates an expected call of Route -func (mr *MockAppModuleMockRecorder) Route() *gomock.Call { +// RegisterInterfaces indicates an expected call of RegisterInterfaces. +func (mr *MockAppModuleMockRecorder) RegisterInterfaces(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Route", reflect.TypeOf((*MockAppModule)(nil).Route)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInterfaces", reflect.TypeOf((*MockAppModule)(nil).RegisterInterfaces), arg0) } -// QuerierRoute mocks base method -func (m *MockAppModule) QuerierRoute() string { +// RegisterInvariants mocks base method. +func (m *MockAppModule) RegisterInvariants(arg0 types0.InvariantRegistry) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "QuerierRoute") - ret0, _ := ret[0].(string) - return ret0 + m.ctrl.Call(m, "RegisterInvariants", arg0) } -// QuerierRoute indicates an expected call of QuerierRoute -func (mr *MockAppModuleMockRecorder) QuerierRoute() *gomock.Call { +// RegisterInvariants indicates an expected call of RegisterInvariants. +func (mr *MockAppModuleMockRecorder) RegisterInvariants(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QuerierRoute", reflect.TypeOf((*MockAppModule)(nil).QuerierRoute)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterInvariants", reflect.TypeOf((*MockAppModule)(nil).RegisterInvariants), arg0) } -// LegacyQuerierHandler mocks base method -func (m *MockAppModule) LegacyQuerierHandler(arg0 *codec.LegacyAmino) types0.Querier { +// RegisterLegacyAminoCodec mocks base method. +func (m *MockAppModule) RegisterLegacyAminoCodec(arg0 *codec.LegacyAmino) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "LegacyQuerierHandler", arg0) - ret0, _ := ret[0].(types0.Querier) - return ret0 + m.ctrl.Call(m, "RegisterLegacyAminoCodec", arg0) } -// LegacyQuerierHandler indicates an expected call of LegacyQuerierHandler -func (mr *MockAppModuleMockRecorder) LegacyQuerierHandler(arg0 interface{}) *gomock.Call { +// RegisterLegacyAminoCodec indicates an expected call of RegisterLegacyAminoCodec. +func (mr *MockAppModuleMockRecorder) RegisterLegacyAminoCodec(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyQuerierHandler", reflect.TypeOf((*MockAppModule)(nil).LegacyQuerierHandler), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterLegacyAminoCodec", reflect.TypeOf((*MockAppModule)(nil).RegisterLegacyAminoCodec), arg0) } -// RegisterServices mocks base method +// RegisterRESTRoutes mocks base method. +func (m *MockAppModule) RegisterRESTRoutes(arg0 client.Context, arg1 *mux.Router) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "RegisterRESTRoutes", arg0, arg1) +} + +// RegisterRESTRoutes indicates an expected call of RegisterRESTRoutes. +func (mr *MockAppModuleMockRecorder) RegisterRESTRoutes(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterRESTRoutes", reflect.TypeOf((*MockAppModule)(nil).RegisterRESTRoutes), arg0, arg1) +} + +// RegisterServices mocks base method. func (m *MockAppModule) RegisterServices(arg0 module.Configurator) { m.ctrl.T.Helper() m.ctrl.Call(m, "RegisterServices", arg0) } -// RegisterServices indicates an expected call of RegisterServices +// RegisterServices indicates an expected call of RegisterServices. func (mr *MockAppModuleMockRecorder) RegisterServices(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterServices", reflect.TypeOf((*MockAppModule)(nil).RegisterServices), arg0) } -// BeginBlock mocks base method -func (m *MockAppModule) BeginBlock(arg0 types0.Context, arg1 types1.RequestBeginBlock) { +// Route mocks base method. +func (m *MockAppModule) Route() types0.Route { m.ctrl.T.Helper() - m.ctrl.Call(m, "BeginBlock", arg0, arg1) + ret := m.ctrl.Call(m, "Route") + ret0, _ := ret[0].(types0.Route) + return ret0 } -// BeginBlock indicates an expected call of BeginBlock -func (mr *MockAppModuleMockRecorder) BeginBlock(arg0, arg1 interface{}) *gomock.Call { +// Route indicates an expected call of Route. +func (mr *MockAppModuleMockRecorder) Route() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeginBlock", reflect.TypeOf((*MockAppModule)(nil).BeginBlock), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Route", reflect.TypeOf((*MockAppModule)(nil).Route)) } -// EndBlock mocks base method -func (m *MockAppModule) EndBlock(arg0 types0.Context, arg1 types1.RequestEndBlock) []types1.ValidatorUpdate { +// ValidateGenesis mocks base method. +func (m *MockAppModule) ValidateGenesis(arg0 codec.JSONCodec, arg1 client.TxEncodingConfig, arg2 json.RawMessage) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "EndBlock", arg0, arg1) - ret0, _ := ret[0].([]types1.ValidatorUpdate) + ret := m.ctrl.Call(m, "ValidateGenesis", arg0, arg1, arg2) + ret0, _ := ret[0].(error) return ret0 } -// EndBlock indicates an expected call of EndBlock -func (mr *MockAppModuleMockRecorder) EndBlock(arg0, arg1 interface{}) *gomock.Call { +// ValidateGenesis indicates an expected call of ValidateGenesis. +func (mr *MockAppModuleMockRecorder) ValidateGenesis(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EndBlock", reflect.TypeOf((*MockAppModule)(nil).EndBlock), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateGenesis", reflect.TypeOf((*MockAppModule)(nil).ValidateGenesis), arg0, arg1, arg2) } diff --git a/tests/mocks/types_router.go b/tests/mocks/types_router.go index 48f96b0b162..27f8fe56b8f 100644 --- a/tests/mocks/types_router.go +++ b/tests/mocks/types_router.go @@ -5,35 +5,36 @@ package mocks import ( + reflect "reflect" + types "github.com/cosmos/cosmos-sdk/types" gomock "github.com/golang/mock/gomock" - reflect "reflect" ) -// MockRouter is a mock of Router interface +// MockRouter is a mock of Router interface. type MockRouter struct { ctrl *gomock.Controller recorder *MockRouterMockRecorder } -// MockRouterMockRecorder is the mock recorder for MockRouter +// MockRouterMockRecorder is the mock recorder for MockRouter. type MockRouterMockRecorder struct { mock *MockRouter } -// NewMockRouter creates a new mock instance +// NewMockRouter creates a new mock instance. func NewMockRouter(ctrl *gomock.Controller) *MockRouter { mock := &MockRouter{ctrl: ctrl} mock.recorder = &MockRouterMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockRouter) EXPECT() *MockRouterMockRecorder { return m.recorder } -// AddRoute mocks base method +// AddRoute mocks base method. func (m *MockRouter) AddRoute(r types.Route) types.Router { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AddRoute", r) @@ -41,13 +42,13 @@ func (m *MockRouter) AddRoute(r types.Route) types.Router { return ret0 } -// AddRoute indicates an expected call of AddRoute +// AddRoute indicates an expected call of AddRoute. func (mr *MockRouterMockRecorder) AddRoute(r interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddRoute", reflect.TypeOf((*MockRouter)(nil).AddRoute), r) } -// Route mocks base method +// Route mocks base method. func (m *MockRouter) Route(ctx types.Context, path string) types.Handler { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Route", ctx, path) @@ -55,36 +56,36 @@ func (m *MockRouter) Route(ctx types.Context, path string) types.Handler { return ret0 } -// Route indicates an expected call of Route +// Route indicates an expected call of Route. func (mr *MockRouterMockRecorder) Route(ctx, path interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Route", reflect.TypeOf((*MockRouter)(nil).Route), ctx, path) } -// MockQueryRouter is a mock of QueryRouter interface +// MockQueryRouter is a mock of QueryRouter interface. type MockQueryRouter struct { ctrl *gomock.Controller recorder *MockQueryRouterMockRecorder } -// MockQueryRouterMockRecorder is the mock recorder for MockQueryRouter +// MockQueryRouterMockRecorder is the mock recorder for MockQueryRouter. type MockQueryRouterMockRecorder struct { mock *MockQueryRouter } -// NewMockQueryRouter creates a new mock instance +// NewMockQueryRouter creates a new mock instance. func NewMockQueryRouter(ctrl *gomock.Controller) *MockQueryRouter { mock := &MockQueryRouter{ctrl: ctrl} mock.recorder = &MockQueryRouterMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockQueryRouter) EXPECT() *MockQueryRouterMockRecorder { return m.recorder } -// AddRoute mocks base method +// AddRoute mocks base method. func (m *MockQueryRouter) AddRoute(r string, h types.Querier) types.QueryRouter { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AddRoute", r, h) @@ -92,13 +93,13 @@ func (m *MockQueryRouter) AddRoute(r string, h types.Querier) types.QueryRouter return ret0 } -// AddRoute indicates an expected call of AddRoute +// AddRoute indicates an expected call of AddRoute. func (mr *MockQueryRouterMockRecorder) AddRoute(r, h interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddRoute", reflect.TypeOf((*MockQueryRouter)(nil).AddRoute), r, h) } -// Route mocks base method +// Route mocks base method. func (m *MockQueryRouter) Route(path string) types.Querier { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Route", path) @@ -106,7 +107,7 @@ func (m *MockQueryRouter) Route(path string) types.Querier { return ret0 } -// Route indicates an expected call of Route +// Route indicates an expected call of Route. func (mr *MockQueryRouterMockRecorder) Route(path interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Route", reflect.TypeOf((*MockQueryRouter)(nil).Route), path) diff --git a/types/handler_test.go b/types/handler_test.go index b71980fd060..449d1b602f5 100644 --- a/types/handler_test.go +++ b/types/handler_test.go @@ -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) }