test: fix mockgen version (#9127)
* setup: update mockgen * Add expect ConsensusVersion in app_test * fix ChainAnteDecorators tests * remove types/handler.go from autogenerating mocks * adding a note * adding note Co-authored-by: Alessio Treglia <alessio@tendermint.com> Co-authored-by: Marko <marbar3778@yahoo.com>
This commit is contained in:
parent
8669f0b4b9
commit
8c1fe4b166
17
Makefile
17
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):
|
||||
|
|
2
go.mod
2
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
|
||||
|
|
4
go.sum
4
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=
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -5,65 +5,38 @@
|
|||
package mocks
|
||||
|
||||
import (
|
||||
client "github.com/cosmos/cosmos-sdk/client"
|
||||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
types "github.com/cosmos/cosmos-sdk/types"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
reflect "reflect"
|
||||
|
||||
client "github.com/cosmos/cosmos-sdk/client"
|
||||
types "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
types0 "github.com/cosmos/cosmos-sdk/types"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
// 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 {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAddress")
|
||||
ret0, _ := ret[0].(types.AccAddress)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// 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, "GetAddress", reflect.TypeOf((*MockAccount)(nil).GetAddress))
|
||||
}
|
||||
|
||||
// GetPubKey mocks base method
|
||||
func (m *MockAccount) GetPubKey() cryptotypes.PubKey {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetPubKey")
|
||||
ret0, _ := ret[0].(cryptotypes.PubKey)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// 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, "GetPubKey", reflect.TypeOf((*MockAccount)(nil).GetPubKey))
|
||||
}
|
||||
|
||||
// GetAccountNumber mocks base method
|
||||
// GetAccountNumber mocks base method.
|
||||
func (m *MockAccount) GetAccountNumber() uint64 {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAccountNumber")
|
||||
|
@ -71,13 +44,41 @@ func (m *MockAccount) GetAccountNumber() uint64 {
|
|||
return ret0
|
||||
}
|
||||
|
||||
// GetAccountNumber indicates an expected call of GetAccountNumber
|
||||
// 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, "GetAccountNumber", reflect.TypeOf((*MockAccount)(nil).GetAccountNumber))
|
||||
}
|
||||
|
||||
// GetSequence mocks base method
|
||||
// GetAddress mocks base method.
|
||||
func (m *MockAccount) GetAddress() types0.AccAddress {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetAddress")
|
||||
ret0, _ := ret[0].(types0.AccAddress)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// 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, "GetAddress", reflect.TypeOf((*MockAccount)(nil).GetAddress))
|
||||
}
|
||||
|
||||
// GetPubKey mocks base method.
|
||||
func (m *MockAccount) GetPubKey() types.PubKey {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetPubKey")
|
||||
ret0, _ := ret[0].(types.PubKey)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// 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, "GetPubKey", reflect.TypeOf((*MockAccount)(nil).GetPubKey))
|
||||
}
|
||||
|
||||
// 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,44 +138,14 @@ 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) {
|
||||
m.ctrl.T.Helper()
|
||||
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
|
||||
}
|
||||
|
||||
// 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 {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureExists", reflect.TypeOf((*MockAccountRetriever)(nil).EnsureExists), clientCtx, addr)
|
||||
}
|
||||
|
||||
// GetAccountNumberSequence mocks base method
|
||||
func (m *MockAccountRetriever) GetAccountNumberSequence(clientCtx client.Context, addr types.AccAddress) (uint64, uint64, 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, "GetAccountNumberSequence", clientCtx, addr)
|
||||
ret0, _ := ret[0].(uint64)
|
||||
|
@ -169,8 +154,24 @@ func (m *MockAccountRetriever) GetAccountNumberSequence(clientCtx client.Context
|
|||
return ret0, ret1, ret2
|
||||
}
|
||||
|
||||
// GetAccountNumberSequence indicates an expected call of GetAccountNumberSequence
|
||||
// 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, "GetAccountNumberSequence", reflect.TypeOf((*MockAccountRetriever)(nil).GetAccountNumberSequence), clientCtx, addr)
|
||||
}
|
||||
|
||||
// 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, "GetAccountWithHeight", clientCtx, addr)
|
||||
ret0, _ := ret[0].(client.Account)
|
||||
ret1, _ := ret[1].(int64)
|
||||
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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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...)
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue