diff --git a/.github/workflows/check-generated.yml b/.github/workflows/check-generated.yml index 0fe1e89ab9..d9f46c8271 100644 --- a/.github/workflows/check-generated.yml +++ b/.github/workflows/check-generated.yml @@ -36,7 +36,8 @@ jobs: run: | set -euo pipefail - readonly MOCKERY=2.53.3 # N.B. no leading "v" + + readonly MOCKERY=3.2.4 # N.B. no leading "v" curl -sL "https://github.com/vektra/mockery/releases/download/v${MOCKERY}/mockery_${MOCKERY}_Linux_x86_64.tar.gz" | tar -C /usr/local/bin -xzf - make mockery 2>/dev/null diff --git a/.mockery.yaml b/.mockery.yaml index ceed741a1c..6d8ec20f2c 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -1,74 +1,67 @@ ---- -with-expecter: true +all: false dir: "{{.InterfaceDir}}/mocks" -mockname: "{{.InterfaceName}}" -outpkg: "mocks" +log-level: warn +structname: "{{.InterfaceName}}" +pkgname: mocks +template: testify filename: "{{.InterfaceName | lower}}.go" -log-level: "warn" -disable-version-string: true -resolve-type-alias: false -issue-845-fix: True -all: false packages: github.com/dashpay/tenderdash/abci/client: interfaces: - Client: + Client: {} github.com/dashpay/tenderdash/abci/types: interfaces: - Application: + Application: {} github.com/dashpay/tenderdash/dash/core: interfaces: - Client: + Client: {} github.com/dashpay/tenderdash/internal/consensus: interfaces: - Gossiper: + Gossiper: {} github.com/dashpay/tenderdash/internal/consensus/versioned/selectproposer: interfaces: - ProposerSelector: + ProposerSelector: {} github.com/dashpay/tenderdash/internal/evidence: interfaces: - BlockStore: + BlockStore: {} github.com/dashpay/tenderdash/internal/mempool: interfaces: - Mempool: + Mempool: {} github.com/dashpay/tenderdash/internal/p2p: interfaces: - Transport: - Connection: - Channel: + Channel: {} + Connection: {} + Transport: {} github.com/dashpay/tenderdash/internal/p2p/client: interfaces: - Client: - BlockClient: - SnapshotClient: + BlockClient: {} + SnapshotClient: {} github.com/dashpay/tenderdash/internal/state: interfaces: - BlockStore: - EvidencePool: - Executor: - Store: + BlockStore: {} + EvidencePool: {} + Executor: {} + Store: {} github.com/dashpay/tenderdash/internal/state/indexer: interfaces: - EventSink: + EventSink: {} github.com/dashpay/tenderdash/internal/statesync: interfaces: - StateProvider: - ConsensusStateProvider: + StateProvider: {} + ConsensusStateProvider: {} github.com/dashpay/tenderdash/libs/store: interfaces: - Store: + Store: {} github.com/dashpay/tenderdash/light/provider: interfaces: - Provider: + Provider: {} github.com/dashpay/tenderdash/light/rpc: interfaces: - LightClient: + LightClient: {} github.com/dashpay/tenderdash/rpc/client: interfaces: - Client: - RemoteClient: + RemoteClient: {} github.com/dashpay/tenderdash/types: interfaces: - Store: - PrivValidator: - BlockEventPublisher: + BlockEventPublisher: {} + PrivValidator: {} diff --git a/abci/client/mocks/client.go b/abci/client/mocks/client.go index 7c2d062858..0d4f9c1553 100644 --- a/abci/client/mocks/client.go +++ b/abci/client/mocks/client.go @@ -1,14 +1,30 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" - types "github.com/dashpay/tenderdash/abci/types" + "github.com/dashpay/tenderdash/abci/types" mock "github.com/stretchr/testify/mock" ) +// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewClient(t interface { + mock.TestingT + Cleanup(func()) +}) *Client { + mock := &Client{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Client is an autogenerated mock type for the Client type type Client struct { mock.Mock @@ -22,9 +38,9 @@ func (_m *Client) EXPECT() *Client_Expecter { return &Client_Expecter{mock: &_m.Mock} } -// ApplySnapshotChunk provides a mock function with given fields: _a0, _a1 -func (_m *Client) ApplySnapshotChunk(_a0 context.Context, _a1 *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { - ret := _m.Called(_a0, _a1) +// ApplySnapshotChunk provides a mock function for the type Client +func (_mock *Client) ApplySnapshotChunk(context1 context.Context, requestApplySnapshotChunk *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { + ret := _mock.Called(context1, requestApplySnapshotChunk) if len(ret) == 0 { panic("no return value specified for ApplySnapshotChunk") @@ -32,23 +48,21 @@ func (_m *Client) ApplySnapshotChunk(_a0 context.Context, _a1 *types.RequestAppl var r0 *types.ResponseApplySnapshotChunk var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error)); ok { + return returnFunc(context1, requestApplySnapshotChunk) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) *types.ResponseApplySnapshotChunk); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) *types.ResponseApplySnapshotChunk); ok { + r0 = returnFunc(context1, requestApplySnapshotChunk) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseApplySnapshotChunk) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestApplySnapshotChunk) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestApplySnapshotChunk) error); ok { + r1 = returnFunc(context1, requestApplySnapshotChunk) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -58,32 +72,32 @@ type Client_ApplySnapshotChunk_Call struct { } // ApplySnapshotChunk is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestApplySnapshotChunk -func (_e *Client_Expecter) ApplySnapshotChunk(_a0 interface{}, _a1 interface{}) *Client_ApplySnapshotChunk_Call { - return &Client_ApplySnapshotChunk_Call{Call: _e.mock.On("ApplySnapshotChunk", _a0, _a1)} +// - context1 +// - requestApplySnapshotChunk +func (_e *Client_Expecter) ApplySnapshotChunk(context1 interface{}, requestApplySnapshotChunk interface{}) *Client_ApplySnapshotChunk_Call { + return &Client_ApplySnapshotChunk_Call{Call: _e.mock.On("ApplySnapshotChunk", context1, requestApplySnapshotChunk)} } -func (_c *Client_ApplySnapshotChunk_Call) Run(run func(_a0 context.Context, _a1 *types.RequestApplySnapshotChunk)) *Client_ApplySnapshotChunk_Call { +func (_c *Client_ApplySnapshotChunk_Call) Run(run func(context1 context.Context, requestApplySnapshotChunk *types.RequestApplySnapshotChunk)) *Client_ApplySnapshotChunk_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestApplySnapshotChunk)) }) return _c } -func (_c *Client_ApplySnapshotChunk_Call) Return(_a0 *types.ResponseApplySnapshotChunk, _a1 error) *Client_ApplySnapshotChunk_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_ApplySnapshotChunk_Call) Return(responseApplySnapshotChunk *types.ResponseApplySnapshotChunk, err error) *Client_ApplySnapshotChunk_Call { + _c.Call.Return(responseApplySnapshotChunk, err) return _c } -func (_c *Client_ApplySnapshotChunk_Call) RunAndReturn(run func(context.Context, *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error)) *Client_ApplySnapshotChunk_Call { +func (_c *Client_ApplySnapshotChunk_Call) RunAndReturn(run func(context1 context.Context, requestApplySnapshotChunk *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error)) *Client_ApplySnapshotChunk_Call { _c.Call.Return(run) return _c } -// CheckTx provides a mock function with given fields: _a0, _a1 -func (_m *Client) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) (*types.ResponseCheckTx, error) { - ret := _m.Called(_a0, _a1) +// CheckTx provides a mock function for the type Client +func (_mock *Client) CheckTx(context1 context.Context, requestCheckTx *types.RequestCheckTx) (*types.ResponseCheckTx, error) { + ret := _mock.Called(context1, requestCheckTx) if len(ret) == 0 { panic("no return value specified for CheckTx") @@ -91,23 +105,21 @@ func (_m *Client) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) (*type var r0 *types.ResponseCheckTx var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) (*types.ResponseCheckTx, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) (*types.ResponseCheckTx, error)); ok { + return returnFunc(context1, requestCheckTx) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) *types.ResponseCheckTx); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) *types.ResponseCheckTx); ok { + r0 = returnFunc(context1, requestCheckTx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseCheckTx) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestCheckTx) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestCheckTx) error); ok { + r1 = returnFunc(context1, requestCheckTx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -117,32 +129,32 @@ type Client_CheckTx_Call struct { } // CheckTx is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestCheckTx -func (_e *Client_Expecter) CheckTx(_a0 interface{}, _a1 interface{}) *Client_CheckTx_Call { - return &Client_CheckTx_Call{Call: _e.mock.On("CheckTx", _a0, _a1)} +// - context1 +// - requestCheckTx +func (_e *Client_Expecter) CheckTx(context1 interface{}, requestCheckTx interface{}) *Client_CheckTx_Call { + return &Client_CheckTx_Call{Call: _e.mock.On("CheckTx", context1, requestCheckTx)} } -func (_c *Client_CheckTx_Call) Run(run func(_a0 context.Context, _a1 *types.RequestCheckTx)) *Client_CheckTx_Call { +func (_c *Client_CheckTx_Call) Run(run func(context1 context.Context, requestCheckTx *types.RequestCheckTx)) *Client_CheckTx_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestCheckTx)) }) return _c } -func (_c *Client_CheckTx_Call) Return(_a0 *types.ResponseCheckTx, _a1 error) *Client_CheckTx_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_CheckTx_Call) Return(responseCheckTx *types.ResponseCheckTx, err error) *Client_CheckTx_Call { + _c.Call.Return(responseCheckTx, err) return _c } -func (_c *Client_CheckTx_Call) RunAndReturn(run func(context.Context, *types.RequestCheckTx) (*types.ResponseCheckTx, error)) *Client_CheckTx_Call { +func (_c *Client_CheckTx_Call) RunAndReturn(run func(context1 context.Context, requestCheckTx *types.RequestCheckTx) (*types.ResponseCheckTx, error)) *Client_CheckTx_Call { _c.Call.Return(run) return _c } -// Echo provides a mock function with given fields: _a0, _a1 -func (_m *Client) Echo(_a0 context.Context, _a1 string) (*types.ResponseEcho, error) { - ret := _m.Called(_a0, _a1) +// Echo provides a mock function for the type Client +func (_mock *Client) Echo(context1 context.Context, s string) (*types.ResponseEcho, error) { + ret := _mock.Called(context1, s) if len(ret) == 0 { panic("no return value specified for Echo") @@ -150,23 +162,21 @@ func (_m *Client) Echo(_a0 context.Context, _a1 string) (*types.ResponseEcho, er var r0 *types.ResponseEcho var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*types.ResponseEcho, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*types.ResponseEcho, error)); ok { + return returnFunc(context1, s) } - if rf, ok := ret.Get(0).(func(context.Context, string) *types.ResponseEcho); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) *types.ResponseEcho); ok { + r0 = returnFunc(context1, s) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseEcho) } } - - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(context1, s) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -176,44 +186,43 @@ type Client_Echo_Call struct { } // Echo is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 string -func (_e *Client_Expecter) Echo(_a0 interface{}, _a1 interface{}) *Client_Echo_Call { - return &Client_Echo_Call{Call: _e.mock.On("Echo", _a0, _a1)} +// - context1 +// - s +func (_e *Client_Expecter) Echo(context1 interface{}, s interface{}) *Client_Echo_Call { + return &Client_Echo_Call{Call: _e.mock.On("Echo", context1, s)} } -func (_c *Client_Echo_Call) Run(run func(_a0 context.Context, _a1 string)) *Client_Echo_Call { +func (_c *Client_Echo_Call) Run(run func(context1 context.Context, s string)) *Client_Echo_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(string)) }) return _c } -func (_c *Client_Echo_Call) Return(_a0 *types.ResponseEcho, _a1 error) *Client_Echo_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_Echo_Call) Return(responseEcho *types.ResponseEcho, err error) *Client_Echo_Call { + _c.Call.Return(responseEcho, err) return _c } -func (_c *Client_Echo_Call) RunAndReturn(run func(context.Context, string) (*types.ResponseEcho, error)) *Client_Echo_Call { +func (_c *Client_Echo_Call) RunAndReturn(run func(context1 context.Context, s string) (*types.ResponseEcho, error)) *Client_Echo_Call { _c.Call.Return(run) return _c } -// Error provides a mock function with no fields -func (_m *Client) Error() error { - ret := _m.Called() +// Error provides a mock function for the type Client +func (_mock *Client) Error() error { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Error") } var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() error); ok { + r0 = returnFunc() } else { r0 = ret.Error(0) } - return r0 } @@ -234,8 +243,8 @@ func (_c *Client_Error_Call) Run(run func()) *Client_Error_Call { return _c } -func (_c *Client_Error_Call) Return(_a0 error) *Client_Error_Call { - _c.Call.Return(_a0) +func (_c *Client_Error_Call) Return(err error) *Client_Error_Call { + _c.Call.Return(err) return _c } @@ -244,9 +253,9 @@ func (_c *Client_Error_Call) RunAndReturn(run func() error) *Client_Error_Call { return _c } -// ExtendVote provides a mock function with given fields: _a0, _a1 -func (_m *Client) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendVote) (*types.ResponseExtendVote, error) { - ret := _m.Called(_a0, _a1) +// ExtendVote provides a mock function for the type Client +func (_mock *Client) ExtendVote(context1 context.Context, requestExtendVote *types.RequestExtendVote) (*types.ResponseExtendVote, error) { + ret := _mock.Called(context1, requestExtendVote) if len(ret) == 0 { panic("no return value specified for ExtendVote") @@ -254,23 +263,21 @@ func (_m *Client) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendVote) var r0 *types.ResponseExtendVote var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) (*types.ResponseExtendVote, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) (*types.ResponseExtendVote, error)); ok { + return returnFunc(context1, requestExtendVote) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) *types.ResponseExtendVote); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) *types.ResponseExtendVote); ok { + r0 = returnFunc(context1, requestExtendVote) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseExtendVote) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestExtendVote) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestExtendVote) error); ok { + r1 = returnFunc(context1, requestExtendVote) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -280,32 +287,32 @@ type Client_ExtendVote_Call struct { } // ExtendVote is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestExtendVote -func (_e *Client_Expecter) ExtendVote(_a0 interface{}, _a1 interface{}) *Client_ExtendVote_Call { - return &Client_ExtendVote_Call{Call: _e.mock.On("ExtendVote", _a0, _a1)} +// - context1 +// - requestExtendVote +func (_e *Client_Expecter) ExtendVote(context1 interface{}, requestExtendVote interface{}) *Client_ExtendVote_Call { + return &Client_ExtendVote_Call{Call: _e.mock.On("ExtendVote", context1, requestExtendVote)} } -func (_c *Client_ExtendVote_Call) Run(run func(_a0 context.Context, _a1 *types.RequestExtendVote)) *Client_ExtendVote_Call { +func (_c *Client_ExtendVote_Call) Run(run func(context1 context.Context, requestExtendVote *types.RequestExtendVote)) *Client_ExtendVote_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestExtendVote)) }) return _c } -func (_c *Client_ExtendVote_Call) Return(_a0 *types.ResponseExtendVote, _a1 error) *Client_ExtendVote_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_ExtendVote_Call) Return(responseExtendVote *types.ResponseExtendVote, err error) *Client_ExtendVote_Call { + _c.Call.Return(responseExtendVote, err) return _c } -func (_c *Client_ExtendVote_Call) RunAndReturn(run func(context.Context, *types.RequestExtendVote) (*types.ResponseExtendVote, error)) *Client_ExtendVote_Call { +func (_c *Client_ExtendVote_Call) RunAndReturn(run func(context1 context.Context, requestExtendVote *types.RequestExtendVote) (*types.ResponseExtendVote, error)) *Client_ExtendVote_Call { _c.Call.Return(run) return _c } -// FinalizeBlock provides a mock function with given fields: _a0, _a1 -func (_m *Client) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) { - ret := _m.Called(_a0, _a1) +// FinalizeBlock provides a mock function for the type Client +func (_mock *Client) FinalizeBlock(context1 context.Context, requestFinalizeBlock *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) { + ret := _mock.Called(context1, requestFinalizeBlock) if len(ret) == 0 { panic("no return value specified for FinalizeBlock") @@ -313,23 +320,21 @@ func (_m *Client) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFinalizeB var r0 *types.ResponseFinalizeBlock var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error)); ok { + return returnFunc(context1, requestFinalizeBlock) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) *types.ResponseFinalizeBlock); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) *types.ResponseFinalizeBlock); ok { + r0 = returnFunc(context1, requestFinalizeBlock) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseFinalizeBlock) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestFinalizeBlock) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestFinalizeBlock) error); ok { + r1 = returnFunc(context1, requestFinalizeBlock) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -339,44 +344,43 @@ type Client_FinalizeBlock_Call struct { } // FinalizeBlock is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestFinalizeBlock -func (_e *Client_Expecter) FinalizeBlock(_a0 interface{}, _a1 interface{}) *Client_FinalizeBlock_Call { - return &Client_FinalizeBlock_Call{Call: _e.mock.On("FinalizeBlock", _a0, _a1)} +// - context1 +// - requestFinalizeBlock +func (_e *Client_Expecter) FinalizeBlock(context1 interface{}, requestFinalizeBlock interface{}) *Client_FinalizeBlock_Call { + return &Client_FinalizeBlock_Call{Call: _e.mock.On("FinalizeBlock", context1, requestFinalizeBlock)} } -func (_c *Client_FinalizeBlock_Call) Run(run func(_a0 context.Context, _a1 *types.RequestFinalizeBlock)) *Client_FinalizeBlock_Call { +func (_c *Client_FinalizeBlock_Call) Run(run func(context1 context.Context, requestFinalizeBlock *types.RequestFinalizeBlock)) *Client_FinalizeBlock_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestFinalizeBlock)) }) return _c } -func (_c *Client_FinalizeBlock_Call) Return(_a0 *types.ResponseFinalizeBlock, _a1 error) *Client_FinalizeBlock_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_FinalizeBlock_Call) Return(responseFinalizeBlock *types.ResponseFinalizeBlock, err error) *Client_FinalizeBlock_Call { + _c.Call.Return(responseFinalizeBlock, err) return _c } -func (_c *Client_FinalizeBlock_Call) RunAndReturn(run func(context.Context, *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error)) *Client_FinalizeBlock_Call { +func (_c *Client_FinalizeBlock_Call) RunAndReturn(run func(context1 context.Context, requestFinalizeBlock *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error)) *Client_FinalizeBlock_Call { _c.Call.Return(run) return _c } -// Flush provides a mock function with given fields: _a0 -func (_m *Client) Flush(_a0 context.Context) error { - ret := _m.Called(_a0) +// Flush provides a mock function for the type Client +func (_mock *Client) Flush(context1 context.Context) error { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for Flush") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = returnFunc(context1) } else { r0 = ret.Error(0) } - return r0 } @@ -386,31 +390,31 @@ type Client_Flush_Call struct { } // Flush is a helper method to define mock.On call -// - _a0 context.Context -func (_e *Client_Expecter) Flush(_a0 interface{}) *Client_Flush_Call { - return &Client_Flush_Call{Call: _e.mock.On("Flush", _a0)} +// - context1 +func (_e *Client_Expecter) Flush(context1 interface{}) *Client_Flush_Call { + return &Client_Flush_Call{Call: _e.mock.On("Flush", context1)} } -func (_c *Client_Flush_Call) Run(run func(_a0 context.Context)) *Client_Flush_Call { +func (_c *Client_Flush_Call) Run(run func(context1 context.Context)) *Client_Flush_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *Client_Flush_Call) Return(_a0 error) *Client_Flush_Call { - _c.Call.Return(_a0) +func (_c *Client_Flush_Call) Return(err error) *Client_Flush_Call { + _c.Call.Return(err) return _c } -func (_c *Client_Flush_Call) RunAndReturn(run func(context.Context) error) *Client_Flush_Call { +func (_c *Client_Flush_Call) RunAndReturn(run func(context1 context.Context) error) *Client_Flush_Call { _c.Call.Return(run) return _c } -// Info provides a mock function with given fields: _a0, _a1 -func (_m *Client) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types.ResponseInfo, error) { - ret := _m.Called(_a0, _a1) +// Info provides a mock function for the type Client +func (_mock *Client) Info(context1 context.Context, requestInfo *types.RequestInfo) (*types.ResponseInfo, error) { + ret := _mock.Called(context1, requestInfo) if len(ret) == 0 { panic("no return value specified for Info") @@ -418,23 +422,21 @@ func (_m *Client) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types.Resp var r0 *types.ResponseInfo var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) (*types.ResponseInfo, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) (*types.ResponseInfo, error)); ok { + return returnFunc(context1, requestInfo) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) *types.ResponseInfo); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) *types.ResponseInfo); ok { + r0 = returnFunc(context1, requestInfo) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseInfo) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInfo) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestInfo) error); ok { + r1 = returnFunc(context1, requestInfo) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -444,32 +446,32 @@ type Client_Info_Call struct { } // Info is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestInfo -func (_e *Client_Expecter) Info(_a0 interface{}, _a1 interface{}) *Client_Info_Call { - return &Client_Info_Call{Call: _e.mock.On("Info", _a0, _a1)} +// - context1 +// - requestInfo +func (_e *Client_Expecter) Info(context1 interface{}, requestInfo interface{}) *Client_Info_Call { + return &Client_Info_Call{Call: _e.mock.On("Info", context1, requestInfo)} } -func (_c *Client_Info_Call) Run(run func(_a0 context.Context, _a1 *types.RequestInfo)) *Client_Info_Call { +func (_c *Client_Info_Call) Run(run func(context1 context.Context, requestInfo *types.RequestInfo)) *Client_Info_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestInfo)) }) return _c } -func (_c *Client_Info_Call) Return(_a0 *types.ResponseInfo, _a1 error) *Client_Info_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_Info_Call) Return(responseInfo *types.ResponseInfo, err error) *Client_Info_Call { + _c.Call.Return(responseInfo, err) return _c } -func (_c *Client_Info_Call) RunAndReturn(run func(context.Context, *types.RequestInfo) (*types.ResponseInfo, error)) *Client_Info_Call { +func (_c *Client_Info_Call) RunAndReturn(run func(context1 context.Context, requestInfo *types.RequestInfo) (*types.ResponseInfo, error)) *Client_Info_Call { _c.Call.Return(run) return _c } -// InitChain provides a mock function with given fields: _a0, _a1 -func (_m *Client) InitChain(_a0 context.Context, _a1 *types.RequestInitChain) (*types.ResponseInitChain, error) { - ret := _m.Called(_a0, _a1) +// InitChain provides a mock function for the type Client +func (_mock *Client) InitChain(context1 context.Context, requestInitChain *types.RequestInitChain) (*types.ResponseInitChain, error) { + ret := _mock.Called(context1, requestInitChain) if len(ret) == 0 { panic("no return value specified for InitChain") @@ -477,23 +479,21 @@ func (_m *Client) InitChain(_a0 context.Context, _a1 *types.RequestInitChain) (* var r0 *types.ResponseInitChain var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) (*types.ResponseInitChain, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) (*types.ResponseInitChain, error)); ok { + return returnFunc(context1, requestInitChain) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) *types.ResponseInitChain); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) *types.ResponseInitChain); ok { + r0 = returnFunc(context1, requestInitChain) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseInitChain) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInitChain) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestInitChain) error); ok { + r1 = returnFunc(context1, requestInitChain) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -503,44 +503,43 @@ type Client_InitChain_Call struct { } // InitChain is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestInitChain -func (_e *Client_Expecter) InitChain(_a0 interface{}, _a1 interface{}) *Client_InitChain_Call { - return &Client_InitChain_Call{Call: _e.mock.On("InitChain", _a0, _a1)} +// - context1 +// - requestInitChain +func (_e *Client_Expecter) InitChain(context1 interface{}, requestInitChain interface{}) *Client_InitChain_Call { + return &Client_InitChain_Call{Call: _e.mock.On("InitChain", context1, requestInitChain)} } -func (_c *Client_InitChain_Call) Run(run func(_a0 context.Context, _a1 *types.RequestInitChain)) *Client_InitChain_Call { +func (_c *Client_InitChain_Call) Run(run func(context1 context.Context, requestInitChain *types.RequestInitChain)) *Client_InitChain_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestInitChain)) }) return _c } -func (_c *Client_InitChain_Call) Return(_a0 *types.ResponseInitChain, _a1 error) *Client_InitChain_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_InitChain_Call) Return(responseInitChain *types.ResponseInitChain, err error) *Client_InitChain_Call { + _c.Call.Return(responseInitChain, err) return _c } -func (_c *Client_InitChain_Call) RunAndReturn(run func(context.Context, *types.RequestInitChain) (*types.ResponseInitChain, error)) *Client_InitChain_Call { +func (_c *Client_InitChain_Call) RunAndReturn(run func(context1 context.Context, requestInitChain *types.RequestInitChain) (*types.ResponseInitChain, error)) *Client_InitChain_Call { _c.Call.Return(run) return _c } -// IsRunning provides a mock function with no fields -func (_m *Client) IsRunning() bool { - ret := _m.Called() +// IsRunning provides a mock function for the type Client +func (_mock *Client) IsRunning() bool { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for IsRunning") } var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() bool); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(bool) } - return r0 } @@ -561,8 +560,8 @@ func (_c *Client_IsRunning_Call) Run(run func()) *Client_IsRunning_Call { return _c } -func (_c *Client_IsRunning_Call) Return(_a0 bool) *Client_IsRunning_Call { - _c.Call.Return(_a0) +func (_c *Client_IsRunning_Call) Return(b bool) *Client_IsRunning_Call { + _c.Call.Return(b) return _c } @@ -571,9 +570,9 @@ func (_c *Client_IsRunning_Call) RunAndReturn(run func() bool) *Client_IsRunning return _c } -// ListSnapshots provides a mock function with given fields: _a0, _a1 -func (_m *Client) ListSnapshots(_a0 context.Context, _a1 *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { - ret := _m.Called(_a0, _a1) +// ListSnapshots provides a mock function for the type Client +func (_mock *Client) ListSnapshots(context1 context.Context, requestListSnapshots *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { + ret := _mock.Called(context1, requestListSnapshots) if len(ret) == 0 { panic("no return value specified for ListSnapshots") @@ -581,23 +580,21 @@ func (_m *Client) ListSnapshots(_a0 context.Context, _a1 *types.RequestListSnaps var r0 *types.ResponseListSnapshots var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) (*types.ResponseListSnapshots, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) (*types.ResponseListSnapshots, error)); ok { + return returnFunc(context1, requestListSnapshots) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) *types.ResponseListSnapshots); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) *types.ResponseListSnapshots); ok { + r0 = returnFunc(context1, requestListSnapshots) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseListSnapshots) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestListSnapshots) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestListSnapshots) error); ok { + r1 = returnFunc(context1, requestListSnapshots) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -607,32 +604,32 @@ type Client_ListSnapshots_Call struct { } // ListSnapshots is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestListSnapshots -func (_e *Client_Expecter) ListSnapshots(_a0 interface{}, _a1 interface{}) *Client_ListSnapshots_Call { - return &Client_ListSnapshots_Call{Call: _e.mock.On("ListSnapshots", _a0, _a1)} +// - context1 +// - requestListSnapshots +func (_e *Client_Expecter) ListSnapshots(context1 interface{}, requestListSnapshots interface{}) *Client_ListSnapshots_Call { + return &Client_ListSnapshots_Call{Call: _e.mock.On("ListSnapshots", context1, requestListSnapshots)} } -func (_c *Client_ListSnapshots_Call) Run(run func(_a0 context.Context, _a1 *types.RequestListSnapshots)) *Client_ListSnapshots_Call { +func (_c *Client_ListSnapshots_Call) Run(run func(context1 context.Context, requestListSnapshots *types.RequestListSnapshots)) *Client_ListSnapshots_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestListSnapshots)) }) return _c } -func (_c *Client_ListSnapshots_Call) Return(_a0 *types.ResponseListSnapshots, _a1 error) *Client_ListSnapshots_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_ListSnapshots_Call) Return(responseListSnapshots *types.ResponseListSnapshots, err error) *Client_ListSnapshots_Call { + _c.Call.Return(responseListSnapshots, err) return _c } -func (_c *Client_ListSnapshots_Call) RunAndReturn(run func(context.Context, *types.RequestListSnapshots) (*types.ResponseListSnapshots, error)) *Client_ListSnapshots_Call { +func (_c *Client_ListSnapshots_Call) RunAndReturn(run func(context1 context.Context, requestListSnapshots *types.RequestListSnapshots) (*types.ResponseListSnapshots, error)) *Client_ListSnapshots_Call { _c.Call.Return(run) return _c } -// LoadSnapshotChunk provides a mock function with given fields: _a0, _a1 -func (_m *Client) LoadSnapshotChunk(_a0 context.Context, _a1 *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { - ret := _m.Called(_a0, _a1) +// LoadSnapshotChunk provides a mock function for the type Client +func (_mock *Client) LoadSnapshotChunk(context1 context.Context, requestLoadSnapshotChunk *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { + ret := _mock.Called(context1, requestLoadSnapshotChunk) if len(ret) == 0 { panic("no return value specified for LoadSnapshotChunk") @@ -640,23 +637,21 @@ func (_m *Client) LoadSnapshotChunk(_a0 context.Context, _a1 *types.RequestLoadS var r0 *types.ResponseLoadSnapshotChunk var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error)); ok { + return returnFunc(context1, requestLoadSnapshotChunk) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) *types.ResponseLoadSnapshotChunk); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) *types.ResponseLoadSnapshotChunk); ok { + r0 = returnFunc(context1, requestLoadSnapshotChunk) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseLoadSnapshotChunk) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestLoadSnapshotChunk) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestLoadSnapshotChunk) error); ok { + r1 = returnFunc(context1, requestLoadSnapshotChunk) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -666,32 +661,32 @@ type Client_LoadSnapshotChunk_Call struct { } // LoadSnapshotChunk is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestLoadSnapshotChunk -func (_e *Client_Expecter) LoadSnapshotChunk(_a0 interface{}, _a1 interface{}) *Client_LoadSnapshotChunk_Call { - return &Client_LoadSnapshotChunk_Call{Call: _e.mock.On("LoadSnapshotChunk", _a0, _a1)} +// - context1 +// - requestLoadSnapshotChunk +func (_e *Client_Expecter) LoadSnapshotChunk(context1 interface{}, requestLoadSnapshotChunk interface{}) *Client_LoadSnapshotChunk_Call { + return &Client_LoadSnapshotChunk_Call{Call: _e.mock.On("LoadSnapshotChunk", context1, requestLoadSnapshotChunk)} } -func (_c *Client_LoadSnapshotChunk_Call) Run(run func(_a0 context.Context, _a1 *types.RequestLoadSnapshotChunk)) *Client_LoadSnapshotChunk_Call { +func (_c *Client_LoadSnapshotChunk_Call) Run(run func(context1 context.Context, requestLoadSnapshotChunk *types.RequestLoadSnapshotChunk)) *Client_LoadSnapshotChunk_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestLoadSnapshotChunk)) }) return _c } -func (_c *Client_LoadSnapshotChunk_Call) Return(_a0 *types.ResponseLoadSnapshotChunk, _a1 error) *Client_LoadSnapshotChunk_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_LoadSnapshotChunk_Call) Return(responseLoadSnapshotChunk *types.ResponseLoadSnapshotChunk, err error) *Client_LoadSnapshotChunk_Call { + _c.Call.Return(responseLoadSnapshotChunk, err) return _c } -func (_c *Client_LoadSnapshotChunk_Call) RunAndReturn(run func(context.Context, *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error)) *Client_LoadSnapshotChunk_Call { +func (_c *Client_LoadSnapshotChunk_Call) RunAndReturn(run func(context1 context.Context, requestLoadSnapshotChunk *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error)) *Client_LoadSnapshotChunk_Call { _c.Call.Return(run) return _c } -// OfferSnapshot provides a mock function with given fields: _a0, _a1 -func (_m *Client) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { - ret := _m.Called(_a0, _a1) +// OfferSnapshot provides a mock function for the type Client +func (_mock *Client) OfferSnapshot(context1 context.Context, requestOfferSnapshot *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { + ret := _mock.Called(context1, requestOfferSnapshot) if len(ret) == 0 { panic("no return value specified for OfferSnapshot") @@ -699,23 +694,21 @@ func (_m *Client) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOfferSnap var r0 *types.ResponseOfferSnapshot var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error)); ok { + return returnFunc(context1, requestOfferSnapshot) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) *types.ResponseOfferSnapshot); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) *types.ResponseOfferSnapshot); ok { + r0 = returnFunc(context1, requestOfferSnapshot) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseOfferSnapshot) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestOfferSnapshot) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestOfferSnapshot) error); ok { + r1 = returnFunc(context1, requestOfferSnapshot) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -725,32 +718,32 @@ type Client_OfferSnapshot_Call struct { } // OfferSnapshot is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestOfferSnapshot -func (_e *Client_Expecter) OfferSnapshot(_a0 interface{}, _a1 interface{}) *Client_OfferSnapshot_Call { - return &Client_OfferSnapshot_Call{Call: _e.mock.On("OfferSnapshot", _a0, _a1)} +// - context1 +// - requestOfferSnapshot +func (_e *Client_Expecter) OfferSnapshot(context1 interface{}, requestOfferSnapshot interface{}) *Client_OfferSnapshot_Call { + return &Client_OfferSnapshot_Call{Call: _e.mock.On("OfferSnapshot", context1, requestOfferSnapshot)} } -func (_c *Client_OfferSnapshot_Call) Run(run func(_a0 context.Context, _a1 *types.RequestOfferSnapshot)) *Client_OfferSnapshot_Call { +func (_c *Client_OfferSnapshot_Call) Run(run func(context1 context.Context, requestOfferSnapshot *types.RequestOfferSnapshot)) *Client_OfferSnapshot_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestOfferSnapshot)) }) return _c } -func (_c *Client_OfferSnapshot_Call) Return(_a0 *types.ResponseOfferSnapshot, _a1 error) *Client_OfferSnapshot_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_OfferSnapshot_Call) Return(responseOfferSnapshot *types.ResponseOfferSnapshot, err error) *Client_OfferSnapshot_Call { + _c.Call.Return(responseOfferSnapshot, err) return _c } -func (_c *Client_OfferSnapshot_Call) RunAndReturn(run func(context.Context, *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error)) *Client_OfferSnapshot_Call { +func (_c *Client_OfferSnapshot_Call) RunAndReturn(run func(context1 context.Context, requestOfferSnapshot *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error)) *Client_OfferSnapshot_Call { _c.Call.Return(run) return _c } -// PrepareProposal provides a mock function with given fields: _a0, _a1 -func (_m *Client) PrepareProposal(_a0 context.Context, _a1 *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) { - ret := _m.Called(_a0, _a1) +// PrepareProposal provides a mock function for the type Client +func (_mock *Client) PrepareProposal(context1 context.Context, requestPrepareProposal *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) { + ret := _mock.Called(context1, requestPrepareProposal) if len(ret) == 0 { panic("no return value specified for PrepareProposal") @@ -758,23 +751,21 @@ func (_m *Client) PrepareProposal(_a0 context.Context, _a1 *types.RequestPrepare var r0 *types.ResponsePrepareProposal var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error)); ok { + return returnFunc(context1, requestPrepareProposal) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) *types.ResponsePrepareProposal); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) *types.ResponsePrepareProposal); ok { + r0 = returnFunc(context1, requestPrepareProposal) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponsePrepareProposal) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestPrepareProposal) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestPrepareProposal) error); ok { + r1 = returnFunc(context1, requestPrepareProposal) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -784,32 +775,32 @@ type Client_PrepareProposal_Call struct { } // PrepareProposal is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestPrepareProposal -func (_e *Client_Expecter) PrepareProposal(_a0 interface{}, _a1 interface{}) *Client_PrepareProposal_Call { - return &Client_PrepareProposal_Call{Call: _e.mock.On("PrepareProposal", _a0, _a1)} +// - context1 +// - requestPrepareProposal +func (_e *Client_Expecter) PrepareProposal(context1 interface{}, requestPrepareProposal interface{}) *Client_PrepareProposal_Call { + return &Client_PrepareProposal_Call{Call: _e.mock.On("PrepareProposal", context1, requestPrepareProposal)} } -func (_c *Client_PrepareProposal_Call) Run(run func(_a0 context.Context, _a1 *types.RequestPrepareProposal)) *Client_PrepareProposal_Call { +func (_c *Client_PrepareProposal_Call) Run(run func(context1 context.Context, requestPrepareProposal *types.RequestPrepareProposal)) *Client_PrepareProposal_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestPrepareProposal)) }) return _c } -func (_c *Client_PrepareProposal_Call) Return(_a0 *types.ResponsePrepareProposal, _a1 error) *Client_PrepareProposal_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_PrepareProposal_Call) Return(responsePrepareProposal *types.ResponsePrepareProposal, err error) *Client_PrepareProposal_Call { + _c.Call.Return(responsePrepareProposal, err) return _c } -func (_c *Client_PrepareProposal_Call) RunAndReturn(run func(context.Context, *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error)) *Client_PrepareProposal_Call { +func (_c *Client_PrepareProposal_Call) RunAndReturn(run func(context1 context.Context, requestPrepareProposal *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error)) *Client_PrepareProposal_Call { _c.Call.Return(run) return _c } -// ProcessProposal provides a mock function with given fields: _a0, _a1 -func (_m *Client) ProcessProposal(_a0 context.Context, _a1 *types.RequestProcessProposal) (*types.ResponseProcessProposal, error) { - ret := _m.Called(_a0, _a1) +// ProcessProposal provides a mock function for the type Client +func (_mock *Client) ProcessProposal(context1 context.Context, requestProcessProposal *types.RequestProcessProposal) (*types.ResponseProcessProposal, error) { + ret := _mock.Called(context1, requestProcessProposal) if len(ret) == 0 { panic("no return value specified for ProcessProposal") @@ -817,23 +808,21 @@ func (_m *Client) ProcessProposal(_a0 context.Context, _a1 *types.RequestProcess var r0 *types.ResponseProcessProposal var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) (*types.ResponseProcessProposal, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) (*types.ResponseProcessProposal, error)); ok { + return returnFunc(context1, requestProcessProposal) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) *types.ResponseProcessProposal); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) *types.ResponseProcessProposal); ok { + r0 = returnFunc(context1, requestProcessProposal) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseProcessProposal) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestProcessProposal) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestProcessProposal) error); ok { + r1 = returnFunc(context1, requestProcessProposal) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -843,32 +832,32 @@ type Client_ProcessProposal_Call struct { } // ProcessProposal is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestProcessProposal -func (_e *Client_Expecter) ProcessProposal(_a0 interface{}, _a1 interface{}) *Client_ProcessProposal_Call { - return &Client_ProcessProposal_Call{Call: _e.mock.On("ProcessProposal", _a0, _a1)} +// - context1 +// - requestProcessProposal +func (_e *Client_Expecter) ProcessProposal(context1 interface{}, requestProcessProposal interface{}) *Client_ProcessProposal_Call { + return &Client_ProcessProposal_Call{Call: _e.mock.On("ProcessProposal", context1, requestProcessProposal)} } -func (_c *Client_ProcessProposal_Call) Run(run func(_a0 context.Context, _a1 *types.RequestProcessProposal)) *Client_ProcessProposal_Call { +func (_c *Client_ProcessProposal_Call) Run(run func(context1 context.Context, requestProcessProposal *types.RequestProcessProposal)) *Client_ProcessProposal_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestProcessProposal)) }) return _c } -func (_c *Client_ProcessProposal_Call) Return(_a0 *types.ResponseProcessProposal, _a1 error) *Client_ProcessProposal_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_ProcessProposal_Call) Return(responseProcessProposal *types.ResponseProcessProposal, err error) *Client_ProcessProposal_Call { + _c.Call.Return(responseProcessProposal, err) return _c } -func (_c *Client_ProcessProposal_Call) RunAndReturn(run func(context.Context, *types.RequestProcessProposal) (*types.ResponseProcessProposal, error)) *Client_ProcessProposal_Call { +func (_c *Client_ProcessProposal_Call) RunAndReturn(run func(context1 context.Context, requestProcessProposal *types.RequestProcessProposal) (*types.ResponseProcessProposal, error)) *Client_ProcessProposal_Call { _c.Call.Return(run) return _c } -// Query provides a mock function with given fields: _a0, _a1 -func (_m *Client) Query(_a0 context.Context, _a1 *types.RequestQuery) (*types.ResponseQuery, error) { - ret := _m.Called(_a0, _a1) +// Query provides a mock function for the type Client +func (_mock *Client) Query(context1 context.Context, requestQuery *types.RequestQuery) (*types.ResponseQuery, error) { + ret := _mock.Called(context1, requestQuery) if len(ret) == 0 { panic("no return value specified for Query") @@ -876,23 +865,21 @@ func (_m *Client) Query(_a0 context.Context, _a1 *types.RequestQuery) (*types.Re var r0 *types.ResponseQuery var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) (*types.ResponseQuery, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) (*types.ResponseQuery, error)); ok { + return returnFunc(context1, requestQuery) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) *types.ResponseQuery); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) *types.ResponseQuery); ok { + r0 = returnFunc(context1, requestQuery) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseQuery) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestQuery) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestQuery) error); ok { + r1 = returnFunc(context1, requestQuery) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -902,44 +889,43 @@ type Client_Query_Call struct { } // Query is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestQuery -func (_e *Client_Expecter) Query(_a0 interface{}, _a1 interface{}) *Client_Query_Call { - return &Client_Query_Call{Call: _e.mock.On("Query", _a0, _a1)} +// - context1 +// - requestQuery +func (_e *Client_Expecter) Query(context1 interface{}, requestQuery interface{}) *Client_Query_Call { + return &Client_Query_Call{Call: _e.mock.On("Query", context1, requestQuery)} } -func (_c *Client_Query_Call) Run(run func(_a0 context.Context, _a1 *types.RequestQuery)) *Client_Query_Call { +func (_c *Client_Query_Call) Run(run func(context1 context.Context, requestQuery *types.RequestQuery)) *Client_Query_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestQuery)) }) return _c } -func (_c *Client_Query_Call) Return(_a0 *types.ResponseQuery, _a1 error) *Client_Query_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_Query_Call) Return(responseQuery *types.ResponseQuery, err error) *Client_Query_Call { + _c.Call.Return(responseQuery, err) return _c } -func (_c *Client_Query_Call) RunAndReturn(run func(context.Context, *types.RequestQuery) (*types.ResponseQuery, error)) *Client_Query_Call { +func (_c *Client_Query_Call) RunAndReturn(run func(context1 context.Context, requestQuery *types.RequestQuery) (*types.ResponseQuery, error)) *Client_Query_Call { _c.Call.Return(run) return _c } -// Start provides a mock function with given fields: _a0 -func (_m *Client) Start(_a0 context.Context) error { - ret := _m.Called(_a0) +// Start provides a mock function for the type Client +func (_mock *Client) Start(context1 context.Context) error { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for Start") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = returnFunc(context1) } else { r0 = ret.Error(0) } - return r0 } @@ -949,31 +935,31 @@ type Client_Start_Call struct { } // Start is a helper method to define mock.On call -// - _a0 context.Context -func (_e *Client_Expecter) Start(_a0 interface{}) *Client_Start_Call { - return &Client_Start_Call{Call: _e.mock.On("Start", _a0)} +// - context1 +func (_e *Client_Expecter) Start(context1 interface{}) *Client_Start_Call { + return &Client_Start_Call{Call: _e.mock.On("Start", context1)} } -func (_c *Client_Start_Call) Run(run func(_a0 context.Context)) *Client_Start_Call { +func (_c *Client_Start_Call) Run(run func(context1 context.Context)) *Client_Start_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *Client_Start_Call) Return(_a0 error) *Client_Start_Call { - _c.Call.Return(_a0) +func (_c *Client_Start_Call) Return(err error) *Client_Start_Call { + _c.Call.Return(err) return _c } -func (_c *Client_Start_Call) RunAndReturn(run func(context.Context) error) *Client_Start_Call { +func (_c *Client_Start_Call) RunAndReturn(run func(context1 context.Context) error) *Client_Start_Call { _c.Call.Return(run) return _c } -// VerifyVoteExtension provides a mock function with given fields: _a0, _a1 -func (_m *Client) VerifyVoteExtension(_a0 context.Context, _a1 *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) { - ret := _m.Called(_a0, _a1) +// VerifyVoteExtension provides a mock function for the type Client +func (_mock *Client) VerifyVoteExtension(context1 context.Context, requestVerifyVoteExtension *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) { + ret := _mock.Called(context1, requestVerifyVoteExtension) if len(ret) == 0 { panic("no return value specified for VerifyVoteExtension") @@ -981,23 +967,21 @@ func (_m *Client) VerifyVoteExtension(_a0 context.Context, _a1 *types.RequestVer var r0 *types.ResponseVerifyVoteExtension var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error)); ok { + return returnFunc(context1, requestVerifyVoteExtension) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) *types.ResponseVerifyVoteExtension); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) *types.ResponseVerifyVoteExtension); ok { + r0 = returnFunc(context1, requestVerifyVoteExtension) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseVerifyVoteExtension) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestVerifyVoteExtension) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestVerifyVoteExtension) error); ok { + r1 = returnFunc(context1, requestVerifyVoteExtension) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1007,32 +991,33 @@ type Client_VerifyVoteExtension_Call struct { } // VerifyVoteExtension is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestVerifyVoteExtension -func (_e *Client_Expecter) VerifyVoteExtension(_a0 interface{}, _a1 interface{}) *Client_VerifyVoteExtension_Call { - return &Client_VerifyVoteExtension_Call{Call: _e.mock.On("VerifyVoteExtension", _a0, _a1)} +// - context1 +// - requestVerifyVoteExtension +func (_e *Client_Expecter) VerifyVoteExtension(context1 interface{}, requestVerifyVoteExtension interface{}) *Client_VerifyVoteExtension_Call { + return &Client_VerifyVoteExtension_Call{Call: _e.mock.On("VerifyVoteExtension", context1, requestVerifyVoteExtension)} } -func (_c *Client_VerifyVoteExtension_Call) Run(run func(_a0 context.Context, _a1 *types.RequestVerifyVoteExtension)) *Client_VerifyVoteExtension_Call { +func (_c *Client_VerifyVoteExtension_Call) Run(run func(context1 context.Context, requestVerifyVoteExtension *types.RequestVerifyVoteExtension)) *Client_VerifyVoteExtension_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestVerifyVoteExtension)) }) return _c } -func (_c *Client_VerifyVoteExtension_Call) Return(_a0 *types.ResponseVerifyVoteExtension, _a1 error) *Client_VerifyVoteExtension_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_VerifyVoteExtension_Call) Return(responseVerifyVoteExtension *types.ResponseVerifyVoteExtension, err error) *Client_VerifyVoteExtension_Call { + _c.Call.Return(responseVerifyVoteExtension, err) return _c } -func (_c *Client_VerifyVoteExtension_Call) RunAndReturn(run func(context.Context, *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error)) *Client_VerifyVoteExtension_Call { +func (_c *Client_VerifyVoteExtension_Call) RunAndReturn(run func(context1 context.Context, requestVerifyVoteExtension *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error)) *Client_VerifyVoteExtension_Call { _c.Call.Return(run) return _c } -// Wait provides a mock function with no fields -func (_m *Client) Wait() { - _m.Called() +// Wait provides a mock function for the type Client +func (_mock *Client) Wait() { + _mock.Called() + return } // Client_Wait_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Wait' @@ -1061,17 +1046,3 @@ func (_c *Client_Wait_Call) RunAndReturn(run func()) *Client_Wait_Call { _c.Run(run) return _c } - -// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewClient(t interface { - mock.TestingT - Cleanup(func()) -}) *Client { - mock := &Client{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/abci/types/mocks/application.go b/abci/types/mocks/application.go index 1a706370d6..e3db3b54b3 100644 --- a/abci/types/mocks/application.go +++ b/abci/types/mocks/application.go @@ -1,14 +1,30 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" - types "github.com/dashpay/tenderdash/abci/types" + "github.com/dashpay/tenderdash/abci/types" mock "github.com/stretchr/testify/mock" ) +// NewApplication creates a new instance of Application. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewApplication(t interface { + mock.TestingT + Cleanup(func()) +}) *Application { + mock := &Application{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Application is an autogenerated mock type for the Application type type Application struct { mock.Mock @@ -22,9 +38,9 @@ func (_m *Application) EXPECT() *Application_Expecter { return &Application_Expecter{mock: &_m.Mock} } -// ApplySnapshotChunk provides a mock function with given fields: _a0, _a1 -func (_m *Application) ApplySnapshotChunk(_a0 context.Context, _a1 *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { - ret := _m.Called(_a0, _a1) +// ApplySnapshotChunk provides a mock function for the type Application +func (_mock *Application) ApplySnapshotChunk(context1 context.Context, requestApplySnapshotChunk *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { + ret := _mock.Called(context1, requestApplySnapshotChunk) if len(ret) == 0 { panic("no return value specified for ApplySnapshotChunk") @@ -32,23 +48,21 @@ func (_m *Application) ApplySnapshotChunk(_a0 context.Context, _a1 *types.Reques var r0 *types.ResponseApplySnapshotChunk var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error)); ok { + return returnFunc(context1, requestApplySnapshotChunk) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) *types.ResponseApplySnapshotChunk); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) *types.ResponseApplySnapshotChunk); ok { + r0 = returnFunc(context1, requestApplySnapshotChunk) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseApplySnapshotChunk) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestApplySnapshotChunk) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestApplySnapshotChunk) error); ok { + r1 = returnFunc(context1, requestApplySnapshotChunk) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -58,32 +72,32 @@ type Application_ApplySnapshotChunk_Call struct { } // ApplySnapshotChunk is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestApplySnapshotChunk -func (_e *Application_Expecter) ApplySnapshotChunk(_a0 interface{}, _a1 interface{}) *Application_ApplySnapshotChunk_Call { - return &Application_ApplySnapshotChunk_Call{Call: _e.mock.On("ApplySnapshotChunk", _a0, _a1)} +// - context1 +// - requestApplySnapshotChunk +func (_e *Application_Expecter) ApplySnapshotChunk(context1 interface{}, requestApplySnapshotChunk interface{}) *Application_ApplySnapshotChunk_Call { + return &Application_ApplySnapshotChunk_Call{Call: _e.mock.On("ApplySnapshotChunk", context1, requestApplySnapshotChunk)} } -func (_c *Application_ApplySnapshotChunk_Call) Run(run func(_a0 context.Context, _a1 *types.RequestApplySnapshotChunk)) *Application_ApplySnapshotChunk_Call { +func (_c *Application_ApplySnapshotChunk_Call) Run(run func(context1 context.Context, requestApplySnapshotChunk *types.RequestApplySnapshotChunk)) *Application_ApplySnapshotChunk_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestApplySnapshotChunk)) }) return _c } -func (_c *Application_ApplySnapshotChunk_Call) Return(_a0 *types.ResponseApplySnapshotChunk, _a1 error) *Application_ApplySnapshotChunk_Call { - _c.Call.Return(_a0, _a1) +func (_c *Application_ApplySnapshotChunk_Call) Return(responseApplySnapshotChunk *types.ResponseApplySnapshotChunk, err error) *Application_ApplySnapshotChunk_Call { + _c.Call.Return(responseApplySnapshotChunk, err) return _c } -func (_c *Application_ApplySnapshotChunk_Call) RunAndReturn(run func(context.Context, *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error)) *Application_ApplySnapshotChunk_Call { +func (_c *Application_ApplySnapshotChunk_Call) RunAndReturn(run func(context1 context.Context, requestApplySnapshotChunk *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error)) *Application_ApplySnapshotChunk_Call { _c.Call.Return(run) return _c } -// CheckTx provides a mock function with given fields: _a0, _a1 -func (_m *Application) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) (*types.ResponseCheckTx, error) { - ret := _m.Called(_a0, _a1) +// CheckTx provides a mock function for the type Application +func (_mock *Application) CheckTx(context1 context.Context, requestCheckTx *types.RequestCheckTx) (*types.ResponseCheckTx, error) { + ret := _mock.Called(context1, requestCheckTx) if len(ret) == 0 { panic("no return value specified for CheckTx") @@ -91,23 +105,21 @@ func (_m *Application) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) ( var r0 *types.ResponseCheckTx var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) (*types.ResponseCheckTx, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) (*types.ResponseCheckTx, error)); ok { + return returnFunc(context1, requestCheckTx) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) *types.ResponseCheckTx); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) *types.ResponseCheckTx); ok { + r0 = returnFunc(context1, requestCheckTx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseCheckTx) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestCheckTx) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestCheckTx) error); ok { + r1 = returnFunc(context1, requestCheckTx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -117,32 +129,32 @@ type Application_CheckTx_Call struct { } // CheckTx is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestCheckTx -func (_e *Application_Expecter) CheckTx(_a0 interface{}, _a1 interface{}) *Application_CheckTx_Call { - return &Application_CheckTx_Call{Call: _e.mock.On("CheckTx", _a0, _a1)} +// - context1 +// - requestCheckTx +func (_e *Application_Expecter) CheckTx(context1 interface{}, requestCheckTx interface{}) *Application_CheckTx_Call { + return &Application_CheckTx_Call{Call: _e.mock.On("CheckTx", context1, requestCheckTx)} } -func (_c *Application_CheckTx_Call) Run(run func(_a0 context.Context, _a1 *types.RequestCheckTx)) *Application_CheckTx_Call { +func (_c *Application_CheckTx_Call) Run(run func(context1 context.Context, requestCheckTx *types.RequestCheckTx)) *Application_CheckTx_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestCheckTx)) }) return _c } -func (_c *Application_CheckTx_Call) Return(_a0 *types.ResponseCheckTx, _a1 error) *Application_CheckTx_Call { - _c.Call.Return(_a0, _a1) +func (_c *Application_CheckTx_Call) Return(responseCheckTx *types.ResponseCheckTx, err error) *Application_CheckTx_Call { + _c.Call.Return(responseCheckTx, err) return _c } -func (_c *Application_CheckTx_Call) RunAndReturn(run func(context.Context, *types.RequestCheckTx) (*types.ResponseCheckTx, error)) *Application_CheckTx_Call { +func (_c *Application_CheckTx_Call) RunAndReturn(run func(context1 context.Context, requestCheckTx *types.RequestCheckTx) (*types.ResponseCheckTx, error)) *Application_CheckTx_Call { _c.Call.Return(run) return _c } -// ExtendVote provides a mock function with given fields: _a0, _a1 -func (_m *Application) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendVote) (*types.ResponseExtendVote, error) { - ret := _m.Called(_a0, _a1) +// ExtendVote provides a mock function for the type Application +func (_mock *Application) ExtendVote(context1 context.Context, requestExtendVote *types.RequestExtendVote) (*types.ResponseExtendVote, error) { + ret := _mock.Called(context1, requestExtendVote) if len(ret) == 0 { panic("no return value specified for ExtendVote") @@ -150,23 +162,21 @@ func (_m *Application) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendV var r0 *types.ResponseExtendVote var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) (*types.ResponseExtendVote, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) (*types.ResponseExtendVote, error)); ok { + return returnFunc(context1, requestExtendVote) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) *types.ResponseExtendVote); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) *types.ResponseExtendVote); ok { + r0 = returnFunc(context1, requestExtendVote) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseExtendVote) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestExtendVote) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestExtendVote) error); ok { + r1 = returnFunc(context1, requestExtendVote) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -176,32 +186,32 @@ type Application_ExtendVote_Call struct { } // ExtendVote is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestExtendVote -func (_e *Application_Expecter) ExtendVote(_a0 interface{}, _a1 interface{}) *Application_ExtendVote_Call { - return &Application_ExtendVote_Call{Call: _e.mock.On("ExtendVote", _a0, _a1)} +// - context1 +// - requestExtendVote +func (_e *Application_Expecter) ExtendVote(context1 interface{}, requestExtendVote interface{}) *Application_ExtendVote_Call { + return &Application_ExtendVote_Call{Call: _e.mock.On("ExtendVote", context1, requestExtendVote)} } -func (_c *Application_ExtendVote_Call) Run(run func(_a0 context.Context, _a1 *types.RequestExtendVote)) *Application_ExtendVote_Call { +func (_c *Application_ExtendVote_Call) Run(run func(context1 context.Context, requestExtendVote *types.RequestExtendVote)) *Application_ExtendVote_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestExtendVote)) }) return _c } -func (_c *Application_ExtendVote_Call) Return(_a0 *types.ResponseExtendVote, _a1 error) *Application_ExtendVote_Call { - _c.Call.Return(_a0, _a1) +func (_c *Application_ExtendVote_Call) Return(responseExtendVote *types.ResponseExtendVote, err error) *Application_ExtendVote_Call { + _c.Call.Return(responseExtendVote, err) return _c } -func (_c *Application_ExtendVote_Call) RunAndReturn(run func(context.Context, *types.RequestExtendVote) (*types.ResponseExtendVote, error)) *Application_ExtendVote_Call { +func (_c *Application_ExtendVote_Call) RunAndReturn(run func(context1 context.Context, requestExtendVote *types.RequestExtendVote) (*types.ResponseExtendVote, error)) *Application_ExtendVote_Call { _c.Call.Return(run) return _c } -// FinalizeBlock provides a mock function with given fields: _a0, _a1 -func (_m *Application) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) { - ret := _m.Called(_a0, _a1) +// FinalizeBlock provides a mock function for the type Application +func (_mock *Application) FinalizeBlock(context1 context.Context, requestFinalizeBlock *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error) { + ret := _mock.Called(context1, requestFinalizeBlock) if len(ret) == 0 { panic("no return value specified for FinalizeBlock") @@ -209,23 +219,21 @@ func (_m *Application) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFina var r0 *types.ResponseFinalizeBlock var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error)); ok { + return returnFunc(context1, requestFinalizeBlock) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) *types.ResponseFinalizeBlock); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) *types.ResponseFinalizeBlock); ok { + r0 = returnFunc(context1, requestFinalizeBlock) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseFinalizeBlock) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestFinalizeBlock) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestFinalizeBlock) error); ok { + r1 = returnFunc(context1, requestFinalizeBlock) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -235,32 +243,32 @@ type Application_FinalizeBlock_Call struct { } // FinalizeBlock is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestFinalizeBlock -func (_e *Application_Expecter) FinalizeBlock(_a0 interface{}, _a1 interface{}) *Application_FinalizeBlock_Call { - return &Application_FinalizeBlock_Call{Call: _e.mock.On("FinalizeBlock", _a0, _a1)} +// - context1 +// - requestFinalizeBlock +func (_e *Application_Expecter) FinalizeBlock(context1 interface{}, requestFinalizeBlock interface{}) *Application_FinalizeBlock_Call { + return &Application_FinalizeBlock_Call{Call: _e.mock.On("FinalizeBlock", context1, requestFinalizeBlock)} } -func (_c *Application_FinalizeBlock_Call) Run(run func(_a0 context.Context, _a1 *types.RequestFinalizeBlock)) *Application_FinalizeBlock_Call { +func (_c *Application_FinalizeBlock_Call) Run(run func(context1 context.Context, requestFinalizeBlock *types.RequestFinalizeBlock)) *Application_FinalizeBlock_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestFinalizeBlock)) }) return _c } -func (_c *Application_FinalizeBlock_Call) Return(_a0 *types.ResponseFinalizeBlock, _a1 error) *Application_FinalizeBlock_Call { - _c.Call.Return(_a0, _a1) +func (_c *Application_FinalizeBlock_Call) Return(responseFinalizeBlock *types.ResponseFinalizeBlock, err error) *Application_FinalizeBlock_Call { + _c.Call.Return(responseFinalizeBlock, err) return _c } -func (_c *Application_FinalizeBlock_Call) RunAndReturn(run func(context.Context, *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error)) *Application_FinalizeBlock_Call { +func (_c *Application_FinalizeBlock_Call) RunAndReturn(run func(context1 context.Context, requestFinalizeBlock *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error)) *Application_FinalizeBlock_Call { _c.Call.Return(run) return _c } -// Info provides a mock function with given fields: _a0, _a1 -func (_m *Application) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types.ResponseInfo, error) { - ret := _m.Called(_a0, _a1) +// Info provides a mock function for the type Application +func (_mock *Application) Info(context1 context.Context, requestInfo *types.RequestInfo) (*types.ResponseInfo, error) { + ret := _mock.Called(context1, requestInfo) if len(ret) == 0 { panic("no return value specified for Info") @@ -268,23 +276,21 @@ func (_m *Application) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types var r0 *types.ResponseInfo var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) (*types.ResponseInfo, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) (*types.ResponseInfo, error)); ok { + return returnFunc(context1, requestInfo) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) *types.ResponseInfo); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) *types.ResponseInfo); ok { + r0 = returnFunc(context1, requestInfo) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseInfo) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInfo) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestInfo) error); ok { + r1 = returnFunc(context1, requestInfo) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -294,32 +300,32 @@ type Application_Info_Call struct { } // Info is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestInfo -func (_e *Application_Expecter) Info(_a0 interface{}, _a1 interface{}) *Application_Info_Call { - return &Application_Info_Call{Call: _e.mock.On("Info", _a0, _a1)} +// - context1 +// - requestInfo +func (_e *Application_Expecter) Info(context1 interface{}, requestInfo interface{}) *Application_Info_Call { + return &Application_Info_Call{Call: _e.mock.On("Info", context1, requestInfo)} } -func (_c *Application_Info_Call) Run(run func(_a0 context.Context, _a1 *types.RequestInfo)) *Application_Info_Call { +func (_c *Application_Info_Call) Run(run func(context1 context.Context, requestInfo *types.RequestInfo)) *Application_Info_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestInfo)) }) return _c } -func (_c *Application_Info_Call) Return(_a0 *types.ResponseInfo, _a1 error) *Application_Info_Call { - _c.Call.Return(_a0, _a1) +func (_c *Application_Info_Call) Return(responseInfo *types.ResponseInfo, err error) *Application_Info_Call { + _c.Call.Return(responseInfo, err) return _c } -func (_c *Application_Info_Call) RunAndReturn(run func(context.Context, *types.RequestInfo) (*types.ResponseInfo, error)) *Application_Info_Call { +func (_c *Application_Info_Call) RunAndReturn(run func(context1 context.Context, requestInfo *types.RequestInfo) (*types.ResponseInfo, error)) *Application_Info_Call { _c.Call.Return(run) return _c } -// InitChain provides a mock function with given fields: _a0, _a1 -func (_m *Application) InitChain(_a0 context.Context, _a1 *types.RequestInitChain) (*types.ResponseInitChain, error) { - ret := _m.Called(_a0, _a1) +// InitChain provides a mock function for the type Application +func (_mock *Application) InitChain(context1 context.Context, requestInitChain *types.RequestInitChain) (*types.ResponseInitChain, error) { + ret := _mock.Called(context1, requestInitChain) if len(ret) == 0 { panic("no return value specified for InitChain") @@ -327,23 +333,21 @@ func (_m *Application) InitChain(_a0 context.Context, _a1 *types.RequestInitChai var r0 *types.ResponseInitChain var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) (*types.ResponseInitChain, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) (*types.ResponseInitChain, error)); ok { + return returnFunc(context1, requestInitChain) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) *types.ResponseInitChain); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) *types.ResponseInitChain); ok { + r0 = returnFunc(context1, requestInitChain) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseInitChain) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInitChain) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestInitChain) error); ok { + r1 = returnFunc(context1, requestInitChain) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -353,32 +357,32 @@ type Application_InitChain_Call struct { } // InitChain is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestInitChain -func (_e *Application_Expecter) InitChain(_a0 interface{}, _a1 interface{}) *Application_InitChain_Call { - return &Application_InitChain_Call{Call: _e.mock.On("InitChain", _a0, _a1)} +// - context1 +// - requestInitChain +func (_e *Application_Expecter) InitChain(context1 interface{}, requestInitChain interface{}) *Application_InitChain_Call { + return &Application_InitChain_Call{Call: _e.mock.On("InitChain", context1, requestInitChain)} } -func (_c *Application_InitChain_Call) Run(run func(_a0 context.Context, _a1 *types.RequestInitChain)) *Application_InitChain_Call { +func (_c *Application_InitChain_Call) Run(run func(context1 context.Context, requestInitChain *types.RequestInitChain)) *Application_InitChain_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestInitChain)) }) return _c } -func (_c *Application_InitChain_Call) Return(_a0 *types.ResponseInitChain, _a1 error) *Application_InitChain_Call { - _c.Call.Return(_a0, _a1) +func (_c *Application_InitChain_Call) Return(responseInitChain *types.ResponseInitChain, err error) *Application_InitChain_Call { + _c.Call.Return(responseInitChain, err) return _c } -func (_c *Application_InitChain_Call) RunAndReturn(run func(context.Context, *types.RequestInitChain) (*types.ResponseInitChain, error)) *Application_InitChain_Call { +func (_c *Application_InitChain_Call) RunAndReturn(run func(context1 context.Context, requestInitChain *types.RequestInitChain) (*types.ResponseInitChain, error)) *Application_InitChain_Call { _c.Call.Return(run) return _c } -// ListSnapshots provides a mock function with given fields: _a0, _a1 -func (_m *Application) ListSnapshots(_a0 context.Context, _a1 *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { - ret := _m.Called(_a0, _a1) +// ListSnapshots provides a mock function for the type Application +func (_mock *Application) ListSnapshots(context1 context.Context, requestListSnapshots *types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { + ret := _mock.Called(context1, requestListSnapshots) if len(ret) == 0 { panic("no return value specified for ListSnapshots") @@ -386,23 +390,21 @@ func (_m *Application) ListSnapshots(_a0 context.Context, _a1 *types.RequestList var r0 *types.ResponseListSnapshots var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) (*types.ResponseListSnapshots, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) (*types.ResponseListSnapshots, error)); ok { + return returnFunc(context1, requestListSnapshots) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) *types.ResponseListSnapshots); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) *types.ResponseListSnapshots); ok { + r0 = returnFunc(context1, requestListSnapshots) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseListSnapshots) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestListSnapshots) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestListSnapshots) error); ok { + r1 = returnFunc(context1, requestListSnapshots) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -412,32 +414,32 @@ type Application_ListSnapshots_Call struct { } // ListSnapshots is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestListSnapshots -func (_e *Application_Expecter) ListSnapshots(_a0 interface{}, _a1 interface{}) *Application_ListSnapshots_Call { - return &Application_ListSnapshots_Call{Call: _e.mock.On("ListSnapshots", _a0, _a1)} +// - context1 +// - requestListSnapshots +func (_e *Application_Expecter) ListSnapshots(context1 interface{}, requestListSnapshots interface{}) *Application_ListSnapshots_Call { + return &Application_ListSnapshots_Call{Call: _e.mock.On("ListSnapshots", context1, requestListSnapshots)} } -func (_c *Application_ListSnapshots_Call) Run(run func(_a0 context.Context, _a1 *types.RequestListSnapshots)) *Application_ListSnapshots_Call { +func (_c *Application_ListSnapshots_Call) Run(run func(context1 context.Context, requestListSnapshots *types.RequestListSnapshots)) *Application_ListSnapshots_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestListSnapshots)) }) return _c } -func (_c *Application_ListSnapshots_Call) Return(_a0 *types.ResponseListSnapshots, _a1 error) *Application_ListSnapshots_Call { - _c.Call.Return(_a0, _a1) +func (_c *Application_ListSnapshots_Call) Return(responseListSnapshots *types.ResponseListSnapshots, err error) *Application_ListSnapshots_Call { + _c.Call.Return(responseListSnapshots, err) return _c } -func (_c *Application_ListSnapshots_Call) RunAndReturn(run func(context.Context, *types.RequestListSnapshots) (*types.ResponseListSnapshots, error)) *Application_ListSnapshots_Call { +func (_c *Application_ListSnapshots_Call) RunAndReturn(run func(context1 context.Context, requestListSnapshots *types.RequestListSnapshots) (*types.ResponseListSnapshots, error)) *Application_ListSnapshots_Call { _c.Call.Return(run) return _c } -// LoadSnapshotChunk provides a mock function with given fields: _a0, _a1 -func (_m *Application) LoadSnapshotChunk(_a0 context.Context, _a1 *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { - ret := _m.Called(_a0, _a1) +// LoadSnapshotChunk provides a mock function for the type Application +func (_mock *Application) LoadSnapshotChunk(context1 context.Context, requestLoadSnapshotChunk *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { + ret := _mock.Called(context1, requestLoadSnapshotChunk) if len(ret) == 0 { panic("no return value specified for LoadSnapshotChunk") @@ -445,23 +447,21 @@ func (_m *Application) LoadSnapshotChunk(_a0 context.Context, _a1 *types.Request var r0 *types.ResponseLoadSnapshotChunk var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error)); ok { + return returnFunc(context1, requestLoadSnapshotChunk) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) *types.ResponseLoadSnapshotChunk); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) *types.ResponseLoadSnapshotChunk); ok { + r0 = returnFunc(context1, requestLoadSnapshotChunk) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseLoadSnapshotChunk) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestLoadSnapshotChunk) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestLoadSnapshotChunk) error); ok { + r1 = returnFunc(context1, requestLoadSnapshotChunk) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -471,32 +471,32 @@ type Application_LoadSnapshotChunk_Call struct { } // LoadSnapshotChunk is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestLoadSnapshotChunk -func (_e *Application_Expecter) LoadSnapshotChunk(_a0 interface{}, _a1 interface{}) *Application_LoadSnapshotChunk_Call { - return &Application_LoadSnapshotChunk_Call{Call: _e.mock.On("LoadSnapshotChunk", _a0, _a1)} +// - context1 +// - requestLoadSnapshotChunk +func (_e *Application_Expecter) LoadSnapshotChunk(context1 interface{}, requestLoadSnapshotChunk interface{}) *Application_LoadSnapshotChunk_Call { + return &Application_LoadSnapshotChunk_Call{Call: _e.mock.On("LoadSnapshotChunk", context1, requestLoadSnapshotChunk)} } -func (_c *Application_LoadSnapshotChunk_Call) Run(run func(_a0 context.Context, _a1 *types.RequestLoadSnapshotChunk)) *Application_LoadSnapshotChunk_Call { +func (_c *Application_LoadSnapshotChunk_Call) Run(run func(context1 context.Context, requestLoadSnapshotChunk *types.RequestLoadSnapshotChunk)) *Application_LoadSnapshotChunk_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestLoadSnapshotChunk)) }) return _c } -func (_c *Application_LoadSnapshotChunk_Call) Return(_a0 *types.ResponseLoadSnapshotChunk, _a1 error) *Application_LoadSnapshotChunk_Call { - _c.Call.Return(_a0, _a1) +func (_c *Application_LoadSnapshotChunk_Call) Return(responseLoadSnapshotChunk *types.ResponseLoadSnapshotChunk, err error) *Application_LoadSnapshotChunk_Call { + _c.Call.Return(responseLoadSnapshotChunk, err) return _c } -func (_c *Application_LoadSnapshotChunk_Call) RunAndReturn(run func(context.Context, *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error)) *Application_LoadSnapshotChunk_Call { +func (_c *Application_LoadSnapshotChunk_Call) RunAndReturn(run func(context1 context.Context, requestLoadSnapshotChunk *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error)) *Application_LoadSnapshotChunk_Call { _c.Call.Return(run) return _c } -// OfferSnapshot provides a mock function with given fields: _a0, _a1 -func (_m *Application) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { - ret := _m.Called(_a0, _a1) +// OfferSnapshot provides a mock function for the type Application +func (_mock *Application) OfferSnapshot(context1 context.Context, requestOfferSnapshot *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { + ret := _mock.Called(context1, requestOfferSnapshot) if len(ret) == 0 { panic("no return value specified for OfferSnapshot") @@ -504,23 +504,21 @@ func (_m *Application) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOffe var r0 *types.ResponseOfferSnapshot var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error)); ok { + return returnFunc(context1, requestOfferSnapshot) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) *types.ResponseOfferSnapshot); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) *types.ResponseOfferSnapshot); ok { + r0 = returnFunc(context1, requestOfferSnapshot) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseOfferSnapshot) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestOfferSnapshot) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestOfferSnapshot) error); ok { + r1 = returnFunc(context1, requestOfferSnapshot) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -530,32 +528,32 @@ type Application_OfferSnapshot_Call struct { } // OfferSnapshot is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestOfferSnapshot -func (_e *Application_Expecter) OfferSnapshot(_a0 interface{}, _a1 interface{}) *Application_OfferSnapshot_Call { - return &Application_OfferSnapshot_Call{Call: _e.mock.On("OfferSnapshot", _a0, _a1)} +// - context1 +// - requestOfferSnapshot +func (_e *Application_Expecter) OfferSnapshot(context1 interface{}, requestOfferSnapshot interface{}) *Application_OfferSnapshot_Call { + return &Application_OfferSnapshot_Call{Call: _e.mock.On("OfferSnapshot", context1, requestOfferSnapshot)} } -func (_c *Application_OfferSnapshot_Call) Run(run func(_a0 context.Context, _a1 *types.RequestOfferSnapshot)) *Application_OfferSnapshot_Call { +func (_c *Application_OfferSnapshot_Call) Run(run func(context1 context.Context, requestOfferSnapshot *types.RequestOfferSnapshot)) *Application_OfferSnapshot_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestOfferSnapshot)) }) return _c } -func (_c *Application_OfferSnapshot_Call) Return(_a0 *types.ResponseOfferSnapshot, _a1 error) *Application_OfferSnapshot_Call { - _c.Call.Return(_a0, _a1) +func (_c *Application_OfferSnapshot_Call) Return(responseOfferSnapshot *types.ResponseOfferSnapshot, err error) *Application_OfferSnapshot_Call { + _c.Call.Return(responseOfferSnapshot, err) return _c } -func (_c *Application_OfferSnapshot_Call) RunAndReturn(run func(context.Context, *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error)) *Application_OfferSnapshot_Call { +func (_c *Application_OfferSnapshot_Call) RunAndReturn(run func(context1 context.Context, requestOfferSnapshot *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error)) *Application_OfferSnapshot_Call { _c.Call.Return(run) return _c } -// PrepareProposal provides a mock function with given fields: _a0, _a1 -func (_m *Application) PrepareProposal(_a0 context.Context, _a1 *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) { - ret := _m.Called(_a0, _a1) +// PrepareProposal provides a mock function for the type Application +func (_mock *Application) PrepareProposal(context1 context.Context, requestPrepareProposal *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) { + ret := _mock.Called(context1, requestPrepareProposal) if len(ret) == 0 { panic("no return value specified for PrepareProposal") @@ -563,23 +561,21 @@ func (_m *Application) PrepareProposal(_a0 context.Context, _a1 *types.RequestPr var r0 *types.ResponsePrepareProposal var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error)); ok { + return returnFunc(context1, requestPrepareProposal) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) *types.ResponsePrepareProposal); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) *types.ResponsePrepareProposal); ok { + r0 = returnFunc(context1, requestPrepareProposal) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponsePrepareProposal) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestPrepareProposal) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestPrepareProposal) error); ok { + r1 = returnFunc(context1, requestPrepareProposal) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -589,32 +585,32 @@ type Application_PrepareProposal_Call struct { } // PrepareProposal is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestPrepareProposal -func (_e *Application_Expecter) PrepareProposal(_a0 interface{}, _a1 interface{}) *Application_PrepareProposal_Call { - return &Application_PrepareProposal_Call{Call: _e.mock.On("PrepareProposal", _a0, _a1)} +// - context1 +// - requestPrepareProposal +func (_e *Application_Expecter) PrepareProposal(context1 interface{}, requestPrepareProposal interface{}) *Application_PrepareProposal_Call { + return &Application_PrepareProposal_Call{Call: _e.mock.On("PrepareProposal", context1, requestPrepareProposal)} } -func (_c *Application_PrepareProposal_Call) Run(run func(_a0 context.Context, _a1 *types.RequestPrepareProposal)) *Application_PrepareProposal_Call { +func (_c *Application_PrepareProposal_Call) Run(run func(context1 context.Context, requestPrepareProposal *types.RequestPrepareProposal)) *Application_PrepareProposal_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestPrepareProposal)) }) return _c } -func (_c *Application_PrepareProposal_Call) Return(_a0 *types.ResponsePrepareProposal, _a1 error) *Application_PrepareProposal_Call { - _c.Call.Return(_a0, _a1) +func (_c *Application_PrepareProposal_Call) Return(responsePrepareProposal *types.ResponsePrepareProposal, err error) *Application_PrepareProposal_Call { + _c.Call.Return(responsePrepareProposal, err) return _c } -func (_c *Application_PrepareProposal_Call) RunAndReturn(run func(context.Context, *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error)) *Application_PrepareProposal_Call { +func (_c *Application_PrepareProposal_Call) RunAndReturn(run func(context1 context.Context, requestPrepareProposal *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error)) *Application_PrepareProposal_Call { _c.Call.Return(run) return _c } -// ProcessProposal provides a mock function with given fields: _a0, _a1 -func (_m *Application) ProcessProposal(_a0 context.Context, _a1 *types.RequestProcessProposal) (*types.ResponseProcessProposal, error) { - ret := _m.Called(_a0, _a1) +// ProcessProposal provides a mock function for the type Application +func (_mock *Application) ProcessProposal(context1 context.Context, requestProcessProposal *types.RequestProcessProposal) (*types.ResponseProcessProposal, error) { + ret := _mock.Called(context1, requestProcessProposal) if len(ret) == 0 { panic("no return value specified for ProcessProposal") @@ -622,23 +618,21 @@ func (_m *Application) ProcessProposal(_a0 context.Context, _a1 *types.RequestPr var r0 *types.ResponseProcessProposal var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) (*types.ResponseProcessProposal, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) (*types.ResponseProcessProposal, error)); ok { + return returnFunc(context1, requestProcessProposal) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) *types.ResponseProcessProposal); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) *types.ResponseProcessProposal); ok { + r0 = returnFunc(context1, requestProcessProposal) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseProcessProposal) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestProcessProposal) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestProcessProposal) error); ok { + r1 = returnFunc(context1, requestProcessProposal) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -648,32 +642,32 @@ type Application_ProcessProposal_Call struct { } // ProcessProposal is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestProcessProposal -func (_e *Application_Expecter) ProcessProposal(_a0 interface{}, _a1 interface{}) *Application_ProcessProposal_Call { - return &Application_ProcessProposal_Call{Call: _e.mock.On("ProcessProposal", _a0, _a1)} +// - context1 +// - requestProcessProposal +func (_e *Application_Expecter) ProcessProposal(context1 interface{}, requestProcessProposal interface{}) *Application_ProcessProposal_Call { + return &Application_ProcessProposal_Call{Call: _e.mock.On("ProcessProposal", context1, requestProcessProposal)} } -func (_c *Application_ProcessProposal_Call) Run(run func(_a0 context.Context, _a1 *types.RequestProcessProposal)) *Application_ProcessProposal_Call { +func (_c *Application_ProcessProposal_Call) Run(run func(context1 context.Context, requestProcessProposal *types.RequestProcessProposal)) *Application_ProcessProposal_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestProcessProposal)) }) return _c } -func (_c *Application_ProcessProposal_Call) Return(_a0 *types.ResponseProcessProposal, _a1 error) *Application_ProcessProposal_Call { - _c.Call.Return(_a0, _a1) +func (_c *Application_ProcessProposal_Call) Return(responseProcessProposal *types.ResponseProcessProposal, err error) *Application_ProcessProposal_Call { + _c.Call.Return(responseProcessProposal, err) return _c } -func (_c *Application_ProcessProposal_Call) RunAndReturn(run func(context.Context, *types.RequestProcessProposal) (*types.ResponseProcessProposal, error)) *Application_ProcessProposal_Call { +func (_c *Application_ProcessProposal_Call) RunAndReturn(run func(context1 context.Context, requestProcessProposal *types.RequestProcessProposal) (*types.ResponseProcessProposal, error)) *Application_ProcessProposal_Call { _c.Call.Return(run) return _c } -// Query provides a mock function with given fields: _a0, _a1 -func (_m *Application) Query(_a0 context.Context, _a1 *types.RequestQuery) (*types.ResponseQuery, error) { - ret := _m.Called(_a0, _a1) +// Query provides a mock function for the type Application +func (_mock *Application) Query(context1 context.Context, requestQuery *types.RequestQuery) (*types.ResponseQuery, error) { + ret := _mock.Called(context1, requestQuery) if len(ret) == 0 { panic("no return value specified for Query") @@ -681,23 +675,21 @@ func (_m *Application) Query(_a0 context.Context, _a1 *types.RequestQuery) (*typ var r0 *types.ResponseQuery var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) (*types.ResponseQuery, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) (*types.ResponseQuery, error)); ok { + return returnFunc(context1, requestQuery) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) *types.ResponseQuery); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) *types.ResponseQuery); ok { + r0 = returnFunc(context1, requestQuery) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseQuery) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestQuery) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestQuery) error); ok { + r1 = returnFunc(context1, requestQuery) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -707,32 +699,32 @@ type Application_Query_Call struct { } // Query is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestQuery -func (_e *Application_Expecter) Query(_a0 interface{}, _a1 interface{}) *Application_Query_Call { - return &Application_Query_Call{Call: _e.mock.On("Query", _a0, _a1)} +// - context1 +// - requestQuery +func (_e *Application_Expecter) Query(context1 interface{}, requestQuery interface{}) *Application_Query_Call { + return &Application_Query_Call{Call: _e.mock.On("Query", context1, requestQuery)} } -func (_c *Application_Query_Call) Run(run func(_a0 context.Context, _a1 *types.RequestQuery)) *Application_Query_Call { +func (_c *Application_Query_Call) Run(run func(context1 context.Context, requestQuery *types.RequestQuery)) *Application_Query_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestQuery)) }) return _c } -func (_c *Application_Query_Call) Return(_a0 *types.ResponseQuery, _a1 error) *Application_Query_Call { - _c.Call.Return(_a0, _a1) +func (_c *Application_Query_Call) Return(responseQuery *types.ResponseQuery, err error) *Application_Query_Call { + _c.Call.Return(responseQuery, err) return _c } -func (_c *Application_Query_Call) RunAndReturn(run func(context.Context, *types.RequestQuery) (*types.ResponseQuery, error)) *Application_Query_Call { +func (_c *Application_Query_Call) RunAndReturn(run func(context1 context.Context, requestQuery *types.RequestQuery) (*types.ResponseQuery, error)) *Application_Query_Call { _c.Call.Return(run) return _c } -// VerifyVoteExtension provides a mock function with given fields: _a0, _a1 -func (_m *Application) VerifyVoteExtension(_a0 context.Context, _a1 *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) { - ret := _m.Called(_a0, _a1) +// VerifyVoteExtension provides a mock function for the type Application +func (_mock *Application) VerifyVoteExtension(context1 context.Context, requestVerifyVoteExtension *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error) { + ret := _mock.Called(context1, requestVerifyVoteExtension) if len(ret) == 0 { panic("no return value specified for VerifyVoteExtension") @@ -740,23 +732,21 @@ func (_m *Application) VerifyVoteExtension(_a0 context.Context, _a1 *types.Reque var r0 *types.ResponseVerifyVoteExtension var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error)); ok { + return returnFunc(context1, requestVerifyVoteExtension) } - if rf, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) *types.ResponseVerifyVoteExtension); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) *types.ResponseVerifyVoteExtension); ok { + r0 = returnFunc(context1, requestVerifyVoteExtension) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ResponseVerifyVoteExtension) } } - - if rf, ok := ret.Get(1).(func(context.Context, *types.RequestVerifyVoteExtension) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.RequestVerifyVoteExtension) error); ok { + r1 = returnFunc(context1, requestVerifyVoteExtension) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -766,39 +756,25 @@ type Application_VerifyVoteExtension_Call struct { } // VerifyVoteExtension is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.RequestVerifyVoteExtension -func (_e *Application_Expecter) VerifyVoteExtension(_a0 interface{}, _a1 interface{}) *Application_VerifyVoteExtension_Call { - return &Application_VerifyVoteExtension_Call{Call: _e.mock.On("VerifyVoteExtension", _a0, _a1)} +// - context1 +// - requestVerifyVoteExtension +func (_e *Application_Expecter) VerifyVoteExtension(context1 interface{}, requestVerifyVoteExtension interface{}) *Application_VerifyVoteExtension_Call { + return &Application_VerifyVoteExtension_Call{Call: _e.mock.On("VerifyVoteExtension", context1, requestVerifyVoteExtension)} } -func (_c *Application_VerifyVoteExtension_Call) Run(run func(_a0 context.Context, _a1 *types.RequestVerifyVoteExtension)) *Application_VerifyVoteExtension_Call { +func (_c *Application_VerifyVoteExtension_Call) Run(run func(context1 context.Context, requestVerifyVoteExtension *types.RequestVerifyVoteExtension)) *Application_VerifyVoteExtension_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.RequestVerifyVoteExtension)) }) return _c } -func (_c *Application_VerifyVoteExtension_Call) Return(_a0 *types.ResponseVerifyVoteExtension, _a1 error) *Application_VerifyVoteExtension_Call { - _c.Call.Return(_a0, _a1) +func (_c *Application_VerifyVoteExtension_Call) Return(responseVerifyVoteExtension *types.ResponseVerifyVoteExtension, err error) *Application_VerifyVoteExtension_Call { + _c.Call.Return(responseVerifyVoteExtension, err) return _c } -func (_c *Application_VerifyVoteExtension_Call) RunAndReturn(run func(context.Context, *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error)) *Application_VerifyVoteExtension_Call { +func (_c *Application_VerifyVoteExtension_Call) RunAndReturn(run func(context1 context.Context, requestVerifyVoteExtension *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error)) *Application_VerifyVoteExtension_Call { _c.Call.Return(run) return _c } - -// NewApplication creates a new instance of Application. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewApplication(t interface { - mock.TestingT - Cleanup(func()) -}) *Application { - mock := &Application{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/dash/core/mocks/client.go b/dash/core/mocks/client.go index 34625cd015..070173c821 100644 --- a/dash/core/mocks/client.go +++ b/dash/core/mocks/client.go @@ -1,16 +1,30 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - btcjson "github.com/dashpay/dashd-go/btcjson" - bytes "github.com/dashpay/tenderdash/libs/bytes" - - crypto "github.com/dashpay/tenderdash/crypto" - + "github.com/dashpay/dashd-go/btcjson" + "github.com/dashpay/tenderdash/crypto" + "github.com/dashpay/tenderdash/libs/bytes" mock "github.com/stretchr/testify/mock" ) +// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewClient(t interface { + mock.TestingT + Cleanup(func()) +}) *Client { + mock := &Client{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Client is an autogenerated mock type for the Client type type Client struct { mock.Mock @@ -24,21 +38,20 @@ func (_m *Client) EXPECT() *Client_Expecter { return &Client_Expecter{mock: &_m.Mock} } -// Close provides a mock function with no fields -func (_m *Client) Close() error { - ret := _m.Called() +// Close provides a mock function for the type Client +func (_mock *Client) Close() error { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Close") } var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() error); ok { + r0 = returnFunc() } else { r0 = ret.Error(0) } - return r0 } @@ -59,8 +72,8 @@ func (_c *Client_Close_Call) Run(run func()) *Client_Close_Call { return _c } -func (_c *Client_Close_Call) Return(_a0 error) *Client_Close_Call { - _c.Call.Return(_a0) +func (_c *Client_Close_Call) Return(err error) *Client_Close_Call { + _c.Call.Return(err) return _c } @@ -69,9 +82,9 @@ func (_c *Client_Close_Call) RunAndReturn(run func() error) *Client_Close_Call { return _c } -// GetNetworkInfo provides a mock function with no fields -func (_m *Client) GetNetworkInfo() (*btcjson.GetNetworkInfoResult, error) { - ret := _m.Called() +// GetNetworkInfo provides a mock function for the type Client +func (_mock *Client) GetNetworkInfo() (*btcjson.GetNetworkInfoResult, error) { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for GetNetworkInfo") @@ -79,23 +92,21 @@ func (_m *Client) GetNetworkInfo() (*btcjson.GetNetworkInfoResult, error) { var r0 *btcjson.GetNetworkInfoResult var r1 error - if rf, ok := ret.Get(0).(func() (*btcjson.GetNetworkInfoResult, error)); ok { - return rf() + if returnFunc, ok := ret.Get(0).(func() (*btcjson.GetNetworkInfoResult, error)); ok { + return returnFunc() } - if rf, ok := ret.Get(0).(func() *btcjson.GetNetworkInfoResult); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() *btcjson.GetNetworkInfoResult); ok { + r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*btcjson.GetNetworkInfoResult) } } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() } else { r1 = ret.Error(1) } - return r0, r1 } @@ -116,8 +127,8 @@ func (_c *Client_GetNetworkInfo_Call) Run(run func()) *Client_GetNetworkInfo_Cal return _c } -func (_c *Client_GetNetworkInfo_Call) Return(_a0 *btcjson.GetNetworkInfoResult, _a1 error) *Client_GetNetworkInfo_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_GetNetworkInfo_Call) Return(getNetworkInfoResult *btcjson.GetNetworkInfoResult, err error) *Client_GetNetworkInfo_Call { + _c.Call.Return(getNetworkInfoResult, err) return _c } @@ -126,9 +137,9 @@ func (_c *Client_GetNetworkInfo_Call) RunAndReturn(run func() (*btcjson.GetNetwo return _c } -// MasternodeListJSON provides a mock function with given fields: filter -func (_m *Client) MasternodeListJSON(filter string) (map[string]btcjson.MasternodelistResultJSON, error) { - ret := _m.Called(filter) +// MasternodeListJSON provides a mock function for the type Client +func (_mock *Client) MasternodeListJSON(filter string) (map[string]btcjson.MasternodelistResultJSON, error) { + ret := _mock.Called(filter) if len(ret) == 0 { panic("no return value specified for MasternodeListJSON") @@ -136,23 +147,21 @@ func (_m *Client) MasternodeListJSON(filter string) (map[string]btcjson.Masterno var r0 map[string]btcjson.MasternodelistResultJSON var r1 error - if rf, ok := ret.Get(0).(func(string) (map[string]btcjson.MasternodelistResultJSON, error)); ok { - return rf(filter) + if returnFunc, ok := ret.Get(0).(func(string) (map[string]btcjson.MasternodelistResultJSON, error)); ok { + return returnFunc(filter) } - if rf, ok := ret.Get(0).(func(string) map[string]btcjson.MasternodelistResultJSON); ok { - r0 = rf(filter) + if returnFunc, ok := ret.Get(0).(func(string) map[string]btcjson.MasternodelistResultJSON); ok { + r0 = returnFunc(filter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(map[string]btcjson.MasternodelistResultJSON) } } - - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(filter) + if returnFunc, ok := ret.Get(1).(func(string) error); ok { + r1 = returnFunc(filter) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -162,7 +171,7 @@ type Client_MasternodeListJSON_Call struct { } // MasternodeListJSON is a helper method to define mock.On call -// - filter string +// - filter func (_e *Client_Expecter) MasternodeListJSON(filter interface{}) *Client_MasternodeListJSON_Call { return &Client_MasternodeListJSON_Call{Call: _e.mock.On("MasternodeListJSON", filter)} } @@ -174,19 +183,19 @@ func (_c *Client_MasternodeListJSON_Call) Run(run func(filter string)) *Client_M return _c } -func (_c *Client_MasternodeListJSON_Call) Return(_a0 map[string]btcjson.MasternodelistResultJSON, _a1 error) *Client_MasternodeListJSON_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_MasternodeListJSON_Call) Return(stringToMasternodelistResultJSON map[string]btcjson.MasternodelistResultJSON, err error) *Client_MasternodeListJSON_Call { + _c.Call.Return(stringToMasternodelistResultJSON, err) return _c } -func (_c *Client_MasternodeListJSON_Call) RunAndReturn(run func(string) (map[string]btcjson.MasternodelistResultJSON, error)) *Client_MasternodeListJSON_Call { +func (_c *Client_MasternodeListJSON_Call) RunAndReturn(run func(filter string) (map[string]btcjson.MasternodelistResultJSON, error)) *Client_MasternodeListJSON_Call { _c.Call.Return(run) return _c } -// MasternodeStatus provides a mock function with no fields -func (_m *Client) MasternodeStatus() (*btcjson.MasternodeStatusResult, error) { - ret := _m.Called() +// MasternodeStatus provides a mock function for the type Client +func (_mock *Client) MasternodeStatus() (*btcjson.MasternodeStatusResult, error) { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for MasternodeStatus") @@ -194,23 +203,21 @@ func (_m *Client) MasternodeStatus() (*btcjson.MasternodeStatusResult, error) { var r0 *btcjson.MasternodeStatusResult var r1 error - if rf, ok := ret.Get(0).(func() (*btcjson.MasternodeStatusResult, error)); ok { - return rf() + if returnFunc, ok := ret.Get(0).(func() (*btcjson.MasternodeStatusResult, error)); ok { + return returnFunc() } - if rf, ok := ret.Get(0).(func() *btcjson.MasternodeStatusResult); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() *btcjson.MasternodeStatusResult); ok { + r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*btcjson.MasternodeStatusResult) } } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() } else { r1 = ret.Error(1) } - return r0, r1 } @@ -231,8 +238,8 @@ func (_c *Client_MasternodeStatus_Call) Run(run func()) *Client_MasternodeStatus return _c } -func (_c *Client_MasternodeStatus_Call) Return(_a0 *btcjson.MasternodeStatusResult, _a1 error) *Client_MasternodeStatus_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_MasternodeStatus_Call) Return(masternodeStatusResult *btcjson.MasternodeStatusResult, err error) *Client_MasternodeStatus_Call { + _c.Call.Return(masternodeStatusResult, err) return _c } @@ -241,21 +248,20 @@ func (_c *Client_MasternodeStatus_Call) RunAndReturn(run func() (*btcjson.Master return _c } -// Ping provides a mock function with no fields -func (_m *Client) Ping() error { - ret := _m.Called() +// Ping provides a mock function for the type Client +func (_mock *Client) Ping() error { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Ping") } var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() error); ok { + r0 = returnFunc() } else { r0 = ret.Error(0) } - return r0 } @@ -276,8 +282,8 @@ func (_c *Client_Ping_Call) Run(run func()) *Client_Ping_Call { return _c } -func (_c *Client_Ping_Call) Return(_a0 error) *Client_Ping_Call { - _c.Call.Return(_a0) +func (_c *Client_Ping_Call) Return(err error) *Client_Ping_Call { + _c.Call.Return(err) return _c } @@ -286,9 +292,9 @@ func (_c *Client_Ping_Call) RunAndReturn(run func() error) *Client_Ping_Call { return _c } -// QuorumInfo provides a mock function with given fields: quorumType, quorumHash -func (_m *Client) QuorumInfo(quorumType btcjson.LLMQType, quorumHash crypto.QuorumHash) (*btcjson.QuorumInfoResult, error) { - ret := _m.Called(quorumType, quorumHash) +// QuorumInfo provides a mock function for the type Client +func (_mock *Client) QuorumInfo(quorumType btcjson.LLMQType, quorumHash crypto.QuorumHash) (*btcjson.QuorumInfoResult, error) { + ret := _mock.Called(quorumType, quorumHash) if len(ret) == 0 { panic("no return value specified for QuorumInfo") @@ -296,23 +302,21 @@ func (_m *Client) QuorumInfo(quorumType btcjson.LLMQType, quorumHash crypto.Quor var r0 *btcjson.QuorumInfoResult var r1 error - if rf, ok := ret.Get(0).(func(btcjson.LLMQType, crypto.QuorumHash) (*btcjson.QuorumInfoResult, error)); ok { - return rf(quorumType, quorumHash) + if returnFunc, ok := ret.Get(0).(func(btcjson.LLMQType, crypto.QuorumHash) (*btcjson.QuorumInfoResult, error)); ok { + return returnFunc(quorumType, quorumHash) } - if rf, ok := ret.Get(0).(func(btcjson.LLMQType, crypto.QuorumHash) *btcjson.QuorumInfoResult); ok { - r0 = rf(quorumType, quorumHash) + if returnFunc, ok := ret.Get(0).(func(btcjson.LLMQType, crypto.QuorumHash) *btcjson.QuorumInfoResult); ok { + r0 = returnFunc(quorumType, quorumHash) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*btcjson.QuorumInfoResult) } } - - if rf, ok := ret.Get(1).(func(btcjson.LLMQType, crypto.QuorumHash) error); ok { - r1 = rf(quorumType, quorumHash) + if returnFunc, ok := ret.Get(1).(func(btcjson.LLMQType, crypto.QuorumHash) error); ok { + r1 = returnFunc(quorumType, quorumHash) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -322,8 +326,8 @@ type Client_QuorumInfo_Call struct { } // QuorumInfo is a helper method to define mock.On call -// - quorumType btcjson.LLMQType -// - quorumHash crypto.QuorumHash +// - quorumType +// - quorumHash func (_e *Client_Expecter) QuorumInfo(quorumType interface{}, quorumHash interface{}) *Client_QuorumInfo_Call { return &Client_QuorumInfo_Call{Call: _e.mock.On("QuorumInfo", quorumType, quorumHash)} } @@ -335,19 +339,19 @@ func (_c *Client_QuorumInfo_Call) Run(run func(quorumType btcjson.LLMQType, quor return _c } -func (_c *Client_QuorumInfo_Call) Return(_a0 *btcjson.QuorumInfoResult, _a1 error) *Client_QuorumInfo_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_QuorumInfo_Call) Return(quorumInfoResult *btcjson.QuorumInfoResult, err error) *Client_QuorumInfo_Call { + _c.Call.Return(quorumInfoResult, err) return _c } -func (_c *Client_QuorumInfo_Call) RunAndReturn(run func(btcjson.LLMQType, crypto.QuorumHash) (*btcjson.QuorumInfoResult, error)) *Client_QuorumInfo_Call { +func (_c *Client_QuorumInfo_Call) RunAndReturn(run func(quorumType btcjson.LLMQType, quorumHash crypto.QuorumHash) (*btcjson.QuorumInfoResult, error)) *Client_QuorumInfo_Call { _c.Call.Return(run) return _c } -// QuorumSign provides a mock function with given fields: quorumType, requestID, messageHash, quorumHash -func (_m *Client) QuorumSign(quorumType btcjson.LLMQType, requestID bytes.HexBytes, messageHash bytes.HexBytes, quorumHash bytes.HexBytes) (*btcjson.QuorumSignResult, error) { - ret := _m.Called(quorumType, requestID, messageHash, quorumHash) +// QuorumSign provides a mock function for the type Client +func (_mock *Client) QuorumSign(quorumType btcjson.LLMQType, requestID bytes.HexBytes, messageHash bytes.HexBytes, quorumHash bytes.HexBytes) (*btcjson.QuorumSignResult, error) { + ret := _mock.Called(quorumType, requestID, messageHash, quorumHash) if len(ret) == 0 { panic("no return value specified for QuorumSign") @@ -355,23 +359,21 @@ func (_m *Client) QuorumSign(quorumType btcjson.LLMQType, requestID bytes.HexByt var r0 *btcjson.QuorumSignResult var r1 error - if rf, ok := ret.Get(0).(func(btcjson.LLMQType, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes) (*btcjson.QuorumSignResult, error)); ok { - return rf(quorumType, requestID, messageHash, quorumHash) + if returnFunc, ok := ret.Get(0).(func(btcjson.LLMQType, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes) (*btcjson.QuorumSignResult, error)); ok { + return returnFunc(quorumType, requestID, messageHash, quorumHash) } - if rf, ok := ret.Get(0).(func(btcjson.LLMQType, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes) *btcjson.QuorumSignResult); ok { - r0 = rf(quorumType, requestID, messageHash, quorumHash) + if returnFunc, ok := ret.Get(0).(func(btcjson.LLMQType, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes) *btcjson.QuorumSignResult); ok { + r0 = returnFunc(quorumType, requestID, messageHash, quorumHash) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*btcjson.QuorumSignResult) } } - - if rf, ok := ret.Get(1).(func(btcjson.LLMQType, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes) error); ok { - r1 = rf(quorumType, requestID, messageHash, quorumHash) + if returnFunc, ok := ret.Get(1).(func(btcjson.LLMQType, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes) error); ok { + r1 = returnFunc(quorumType, requestID, messageHash, quorumHash) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -381,10 +383,10 @@ type Client_QuorumSign_Call struct { } // QuorumSign is a helper method to define mock.On call -// - quorumType btcjson.LLMQType -// - requestID bytes.HexBytes -// - messageHash bytes.HexBytes -// - quorumHash bytes.HexBytes +// - quorumType +// - requestID +// - messageHash +// - quorumHash func (_e *Client_Expecter) QuorumSign(quorumType interface{}, requestID interface{}, messageHash interface{}, quorumHash interface{}) *Client_QuorumSign_Call { return &Client_QuorumSign_Call{Call: _e.mock.On("QuorumSign", quorumType, requestID, messageHash, quorumHash)} } @@ -396,19 +398,19 @@ func (_c *Client_QuorumSign_Call) Run(run func(quorumType btcjson.LLMQType, requ return _c } -func (_c *Client_QuorumSign_Call) Return(_a0 *btcjson.QuorumSignResult, _a1 error) *Client_QuorumSign_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_QuorumSign_Call) Return(quorumSignResult *btcjson.QuorumSignResult, err error) *Client_QuorumSign_Call { + _c.Call.Return(quorumSignResult, err) return _c } -func (_c *Client_QuorumSign_Call) RunAndReturn(run func(btcjson.LLMQType, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes) (*btcjson.QuorumSignResult, error)) *Client_QuorumSign_Call { +func (_c *Client_QuorumSign_Call) RunAndReturn(run func(quorumType btcjson.LLMQType, requestID bytes.HexBytes, messageHash bytes.HexBytes, quorumHash bytes.HexBytes) (*btcjson.QuorumSignResult, error)) *Client_QuorumSign_Call { _c.Call.Return(run) return _c } -// QuorumVerify provides a mock function with given fields: quorumType, requestID, messageHash, signature, quorumHash -func (_m *Client) QuorumVerify(quorumType btcjson.LLMQType, requestID bytes.HexBytes, messageHash bytes.HexBytes, signature bytes.HexBytes, quorumHash bytes.HexBytes) (bool, error) { - ret := _m.Called(quorumType, requestID, messageHash, signature, quorumHash) +// QuorumVerify provides a mock function for the type Client +func (_mock *Client) QuorumVerify(quorumType btcjson.LLMQType, requestID bytes.HexBytes, messageHash bytes.HexBytes, signature bytes.HexBytes, quorumHash bytes.HexBytes) (bool, error) { + ret := _mock.Called(quorumType, requestID, messageHash, signature, quorumHash) if len(ret) == 0 { panic("no return value specified for QuorumVerify") @@ -416,21 +418,19 @@ func (_m *Client) QuorumVerify(quorumType btcjson.LLMQType, requestID bytes.HexB var r0 bool var r1 error - if rf, ok := ret.Get(0).(func(btcjson.LLMQType, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes) (bool, error)); ok { - return rf(quorumType, requestID, messageHash, signature, quorumHash) + if returnFunc, ok := ret.Get(0).(func(btcjson.LLMQType, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes) (bool, error)); ok { + return returnFunc(quorumType, requestID, messageHash, signature, quorumHash) } - if rf, ok := ret.Get(0).(func(btcjson.LLMQType, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes) bool); ok { - r0 = rf(quorumType, requestID, messageHash, signature, quorumHash) + if returnFunc, ok := ret.Get(0).(func(btcjson.LLMQType, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes) bool); ok { + r0 = returnFunc(quorumType, requestID, messageHash, signature, quorumHash) } else { r0 = ret.Get(0).(bool) } - - if rf, ok := ret.Get(1).(func(btcjson.LLMQType, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes) error); ok { - r1 = rf(quorumType, requestID, messageHash, signature, quorumHash) + if returnFunc, ok := ret.Get(1).(func(btcjson.LLMQType, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes) error); ok { + r1 = returnFunc(quorumType, requestID, messageHash, signature, quorumHash) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -440,11 +440,11 @@ type Client_QuorumVerify_Call struct { } // QuorumVerify is a helper method to define mock.On call -// - quorumType btcjson.LLMQType -// - requestID bytes.HexBytes -// - messageHash bytes.HexBytes -// - signature bytes.HexBytes -// - quorumHash bytes.HexBytes +// - quorumType +// - requestID +// - messageHash +// - signature +// - quorumHash func (_e *Client_Expecter) QuorumVerify(quorumType interface{}, requestID interface{}, messageHash interface{}, signature interface{}, quorumHash interface{}) *Client_QuorumVerify_Call { return &Client_QuorumVerify_Call{Call: _e.mock.On("QuorumVerify", quorumType, requestID, messageHash, signature, quorumHash)} } @@ -456,26 +456,12 @@ func (_c *Client_QuorumVerify_Call) Run(run func(quorumType btcjson.LLMQType, re return _c } -func (_c *Client_QuorumVerify_Call) Return(_a0 bool, _a1 error) *Client_QuorumVerify_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_QuorumVerify_Call) Return(b bool, err error) *Client_QuorumVerify_Call { + _c.Call.Return(b, err) return _c } -func (_c *Client_QuorumVerify_Call) RunAndReturn(run func(btcjson.LLMQType, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes, bytes.HexBytes) (bool, error)) *Client_QuorumVerify_Call { +func (_c *Client_QuorumVerify_Call) RunAndReturn(run func(quorumType btcjson.LLMQType, requestID bytes.HexBytes, messageHash bytes.HexBytes, signature bytes.HexBytes, quorumHash bytes.HexBytes) (bool, error)) *Client_QuorumVerify_Call { _c.Call.Return(run) return _c } - -// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewClient(t interface { - mock.TestingT - Cleanup(func()) -}) *Client { - mock := &Client{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/consensus/mocks/gossiper.go b/internal/consensus/mocks/gossiper.go index e4548d1c62..90b281aa9d 100644 --- a/internal/consensus/mocks/gossiper.go +++ b/internal/consensus/mocks/gossiper.go @@ -1,14 +1,30 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" - types "github.com/dashpay/tenderdash/internal/consensus/types" + "github.com/dashpay/tenderdash/internal/consensus/types" mock "github.com/stretchr/testify/mock" ) +// NewGossiper creates a new instance of Gossiper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewGossiper(t interface { + mock.TestingT + Cleanup(func()) +}) *Gossiper { + mock := &Gossiper{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Gossiper is an autogenerated mock type for the Gossiper type type Gossiper struct { mock.Mock @@ -22,9 +38,10 @@ func (_m *Gossiper) EXPECT() *Gossiper_Expecter { return &Gossiper_Expecter{mock: &_m.Mock} } -// GossipBlockPartsForCatchup provides a mock function with given fields: ctx, rs, prs -func (_m *Gossiper) GossipBlockPartsForCatchup(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState) { - _m.Called(ctx, rs, prs) +// GossipBlockPartsForCatchup provides a mock function for the type Gossiper +func (_mock *Gossiper) GossipBlockPartsForCatchup(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState) { + _mock.Called(ctx, rs, prs) + return } // Gossiper_GossipBlockPartsForCatchup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GossipBlockPartsForCatchup' @@ -33,9 +50,9 @@ type Gossiper_GossipBlockPartsForCatchup_Call struct { } // GossipBlockPartsForCatchup is a helper method to define mock.On call -// - ctx context.Context -// - rs types.RoundState -// - prs *types.PeerRoundState +// - ctx +// - rs +// - prs func (_e *Gossiper_Expecter) GossipBlockPartsForCatchup(ctx interface{}, rs interface{}, prs interface{}) *Gossiper_GossipBlockPartsForCatchup_Call { return &Gossiper_GossipBlockPartsForCatchup_Call{Call: _e.mock.On("GossipBlockPartsForCatchup", ctx, rs, prs)} } @@ -52,14 +69,15 @@ func (_c *Gossiper_GossipBlockPartsForCatchup_Call) Return() *Gossiper_GossipBlo return _c } -func (_c *Gossiper_GossipBlockPartsForCatchup_Call) RunAndReturn(run func(context.Context, types.RoundState, *types.PeerRoundState)) *Gossiper_GossipBlockPartsForCatchup_Call { +func (_c *Gossiper_GossipBlockPartsForCatchup_Call) RunAndReturn(run func(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState)) *Gossiper_GossipBlockPartsForCatchup_Call { _c.Run(run) return _c } -// GossipCommit provides a mock function with given fields: ctx, rs, prs -func (_m *Gossiper) GossipCommit(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState) { - _m.Called(ctx, rs, prs) +// GossipCommit provides a mock function for the type Gossiper +func (_mock *Gossiper) GossipCommit(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState) { + _mock.Called(ctx, rs, prs) + return } // Gossiper_GossipCommit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GossipCommit' @@ -68,9 +86,9 @@ type Gossiper_GossipCommit_Call struct { } // GossipCommit is a helper method to define mock.On call -// - ctx context.Context -// - rs types.RoundState -// - prs *types.PeerRoundState +// - ctx +// - rs +// - prs func (_e *Gossiper_Expecter) GossipCommit(ctx interface{}, rs interface{}, prs interface{}) *Gossiper_GossipCommit_Call { return &Gossiper_GossipCommit_Call{Call: _e.mock.On("GossipCommit", ctx, rs, prs)} } @@ -87,14 +105,15 @@ func (_c *Gossiper_GossipCommit_Call) Return() *Gossiper_GossipCommit_Call { return _c } -func (_c *Gossiper_GossipCommit_Call) RunAndReturn(run func(context.Context, types.RoundState, *types.PeerRoundState)) *Gossiper_GossipCommit_Call { +func (_c *Gossiper_GossipCommit_Call) RunAndReturn(run func(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState)) *Gossiper_GossipCommit_Call { _c.Run(run) return _c } -// GossipProposal provides a mock function with given fields: ctx, rs, prs -func (_m *Gossiper) GossipProposal(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState) { - _m.Called(ctx, rs, prs) +// GossipProposal provides a mock function for the type Gossiper +func (_mock *Gossiper) GossipProposal(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState) { + _mock.Called(ctx, rs, prs) + return } // Gossiper_GossipProposal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GossipProposal' @@ -103,9 +122,9 @@ type Gossiper_GossipProposal_Call struct { } // GossipProposal is a helper method to define mock.On call -// - ctx context.Context -// - rs types.RoundState -// - prs *types.PeerRoundState +// - ctx +// - rs +// - prs func (_e *Gossiper_Expecter) GossipProposal(ctx interface{}, rs interface{}, prs interface{}) *Gossiper_GossipProposal_Call { return &Gossiper_GossipProposal_Call{Call: _e.mock.On("GossipProposal", ctx, rs, prs)} } @@ -122,14 +141,15 @@ func (_c *Gossiper_GossipProposal_Call) Return() *Gossiper_GossipProposal_Call { return _c } -func (_c *Gossiper_GossipProposal_Call) RunAndReturn(run func(context.Context, types.RoundState, *types.PeerRoundState)) *Gossiper_GossipProposal_Call { +func (_c *Gossiper_GossipProposal_Call) RunAndReturn(run func(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState)) *Gossiper_GossipProposal_Call { _c.Run(run) return _c } -// GossipProposalBlockParts provides a mock function with given fields: ctx, rs, prs -func (_m *Gossiper) GossipProposalBlockParts(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState) { - _m.Called(ctx, rs, prs) +// GossipProposalBlockParts provides a mock function for the type Gossiper +func (_mock *Gossiper) GossipProposalBlockParts(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState) { + _mock.Called(ctx, rs, prs) + return } // Gossiper_GossipProposalBlockParts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GossipProposalBlockParts' @@ -138,9 +158,9 @@ type Gossiper_GossipProposalBlockParts_Call struct { } // GossipProposalBlockParts is a helper method to define mock.On call -// - ctx context.Context -// - rs types.RoundState -// - prs *types.PeerRoundState +// - ctx +// - rs +// - prs func (_e *Gossiper_Expecter) GossipProposalBlockParts(ctx interface{}, rs interface{}, prs interface{}) *Gossiper_GossipProposalBlockParts_Call { return &Gossiper_GossipProposalBlockParts_Call{Call: _e.mock.On("GossipProposalBlockParts", ctx, rs, prs)} } @@ -157,14 +177,15 @@ func (_c *Gossiper_GossipProposalBlockParts_Call) Return() *Gossiper_GossipPropo return _c } -func (_c *Gossiper_GossipProposalBlockParts_Call) RunAndReturn(run func(context.Context, types.RoundState, *types.PeerRoundState)) *Gossiper_GossipProposalBlockParts_Call { +func (_c *Gossiper_GossipProposalBlockParts_Call) RunAndReturn(run func(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState)) *Gossiper_GossipProposalBlockParts_Call { _c.Run(run) return _c } -// GossipVote provides a mock function with given fields: ctx, rs, prs -func (_m *Gossiper) GossipVote(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState) { - _m.Called(ctx, rs, prs) +// GossipVote provides a mock function for the type Gossiper +func (_mock *Gossiper) GossipVote(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState) { + _mock.Called(ctx, rs, prs) + return } // Gossiper_GossipVote_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GossipVote' @@ -173,9 +194,9 @@ type Gossiper_GossipVote_Call struct { } // GossipVote is a helper method to define mock.On call -// - ctx context.Context -// - rs types.RoundState -// - prs *types.PeerRoundState +// - ctx +// - rs +// - prs func (_e *Gossiper_Expecter) GossipVote(ctx interface{}, rs interface{}, prs interface{}) *Gossiper_GossipVote_Call { return &Gossiper_GossipVote_Call{Call: _e.mock.On("GossipVote", ctx, rs, prs)} } @@ -192,14 +213,15 @@ func (_c *Gossiper_GossipVote_Call) Return() *Gossiper_GossipVote_Call { return _c } -func (_c *Gossiper_GossipVote_Call) RunAndReturn(run func(context.Context, types.RoundState, *types.PeerRoundState)) *Gossiper_GossipVote_Call { +func (_c *Gossiper_GossipVote_Call) RunAndReturn(run func(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState)) *Gossiper_GossipVote_Call { _c.Run(run) return _c } -// GossipVoteSetMaj23 provides a mock function with given fields: ctx, rs, prs -func (_m *Gossiper) GossipVoteSetMaj23(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState) { - _m.Called(ctx, rs, prs) +// GossipVoteSetMaj23 provides a mock function for the type Gossiper +func (_mock *Gossiper) GossipVoteSetMaj23(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState) { + _mock.Called(ctx, rs, prs) + return } // Gossiper_GossipVoteSetMaj23_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GossipVoteSetMaj23' @@ -208,9 +230,9 @@ type Gossiper_GossipVoteSetMaj23_Call struct { } // GossipVoteSetMaj23 is a helper method to define mock.On call -// - ctx context.Context -// - rs types.RoundState -// - prs *types.PeerRoundState +// - ctx +// - rs +// - prs func (_e *Gossiper_Expecter) GossipVoteSetMaj23(ctx interface{}, rs interface{}, prs interface{}) *Gossiper_GossipVoteSetMaj23_Call { return &Gossiper_GossipVoteSetMaj23_Call{Call: _e.mock.On("GossipVoteSetMaj23", ctx, rs, prs)} } @@ -227,21 +249,7 @@ func (_c *Gossiper_GossipVoteSetMaj23_Call) Return() *Gossiper_GossipVoteSetMaj2 return _c } -func (_c *Gossiper_GossipVoteSetMaj23_Call) RunAndReturn(run func(context.Context, types.RoundState, *types.PeerRoundState)) *Gossiper_GossipVoteSetMaj23_Call { +func (_c *Gossiper_GossipVoteSetMaj23_Call) RunAndReturn(run func(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState)) *Gossiper_GossipVoteSetMaj23_Call { _c.Run(run) return _c } - -// NewGossiper creates a new instance of Gossiper. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewGossiper(t interface { - mock.TestingT - Cleanup(func()) -}) *Gossiper { - mock := &Gossiper{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/consensus/versioned/selectproposer/mocks/proposerselector.go b/internal/consensus/versioned/selectproposer/mocks/proposerselector.go index bcee70886a..d7ef6806d2 100644 --- a/internal/consensus/versioned/selectproposer/mocks/proposerselector.go +++ b/internal/consensus/versioned/selectproposer/mocks/proposerselector.go @@ -1,13 +1,29 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - selectproposer "github.com/dashpay/tenderdash/internal/consensus/versioned/selectproposer" - types "github.com/dashpay/tenderdash/types" + "github.com/dashpay/tenderdash/internal/consensus/versioned/selectproposer" + "github.com/dashpay/tenderdash/types" mock "github.com/stretchr/testify/mock" ) +// NewProposerSelector creates a new instance of ProposerSelector. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewProposerSelector(t interface { + mock.TestingT + Cleanup(func()) +}) *ProposerSelector { + mock := &ProposerSelector{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // ProposerSelector is an autogenerated mock type for the ProposerSelector type type ProposerSelector struct { mock.Mock @@ -21,23 +37,22 @@ func (_m *ProposerSelector) EXPECT() *ProposerSelector_Expecter { return &ProposerSelector_Expecter{mock: &_m.Mock} } -// Copy provides a mock function with no fields -func (_m *ProposerSelector) Copy() selectproposer.ProposerSelector { - ret := _m.Called() +// Copy provides a mock function for the type ProposerSelector +func (_mock *ProposerSelector) Copy() selectproposer.ProposerSelector { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Copy") } var r0 selectproposer.ProposerSelector - if rf, ok := ret.Get(0).(func() selectproposer.ProposerSelector); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() selectproposer.ProposerSelector); ok { + r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(selectproposer.ProposerSelector) } } - return r0 } @@ -58,8 +73,8 @@ func (_c *ProposerSelector_Copy_Call) Run(run func()) *ProposerSelector_Copy_Cal return _c } -func (_c *ProposerSelector_Copy_Call) Return(_a0 selectproposer.ProposerSelector) *ProposerSelector_Copy_Call { - _c.Call.Return(_a0) +func (_c *ProposerSelector_Copy_Call) Return(proposerSelector selectproposer.ProposerSelector) *ProposerSelector_Copy_Call { + _c.Call.Return(proposerSelector) return _c } @@ -68,9 +83,9 @@ func (_c *ProposerSelector_Copy_Call) RunAndReturn(run func() selectproposer.Pro return _c } -// GetProposer provides a mock function with given fields: height, round -func (_m *ProposerSelector) GetProposer(height int64, round int32) (*types.Validator, error) { - ret := _m.Called(height, round) +// GetProposer provides a mock function for the type ProposerSelector +func (_mock *ProposerSelector) GetProposer(height int64, round int32) (*types.Validator, error) { + ret := _mock.Called(height, round) if len(ret) == 0 { panic("no return value specified for GetProposer") @@ -78,23 +93,21 @@ func (_m *ProposerSelector) GetProposer(height int64, round int32) (*types.Valid var r0 *types.Validator var r1 error - if rf, ok := ret.Get(0).(func(int64, int32) (*types.Validator, error)); ok { - return rf(height, round) + if returnFunc, ok := ret.Get(0).(func(int64, int32) (*types.Validator, error)); ok { + return returnFunc(height, round) } - if rf, ok := ret.Get(0).(func(int64, int32) *types.Validator); ok { - r0 = rf(height, round) + if returnFunc, ok := ret.Get(0).(func(int64, int32) *types.Validator); ok { + r0 = returnFunc(height, round) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.Validator) } } - - if rf, ok := ret.Get(1).(func(int64, int32) error); ok { - r1 = rf(height, round) + if returnFunc, ok := ret.Get(1).(func(int64, int32) error); ok { + r1 = returnFunc(height, round) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -104,8 +117,8 @@ type ProposerSelector_GetProposer_Call struct { } // GetProposer is a helper method to define mock.On call -// - height int64 -// - round int32 +// - height +// - round func (_e *ProposerSelector_Expecter) GetProposer(height interface{}, round interface{}) *ProposerSelector_GetProposer_Call { return &ProposerSelector_GetProposer_Call{Call: _e.mock.On("GetProposer", height, round)} } @@ -117,33 +130,32 @@ func (_c *ProposerSelector_GetProposer_Call) Run(run func(height int64, round in return _c } -func (_c *ProposerSelector_GetProposer_Call) Return(_a0 *types.Validator, _a1 error) *ProposerSelector_GetProposer_Call { - _c.Call.Return(_a0, _a1) +func (_c *ProposerSelector_GetProposer_Call) Return(validator *types.Validator, err error) *ProposerSelector_GetProposer_Call { + _c.Call.Return(validator, err) return _c } -func (_c *ProposerSelector_GetProposer_Call) RunAndReturn(run func(int64, int32) (*types.Validator, error)) *ProposerSelector_GetProposer_Call { +func (_c *ProposerSelector_GetProposer_Call) RunAndReturn(run func(height int64, round int32) (*types.Validator, error)) *ProposerSelector_GetProposer_Call { _c.Call.Return(run) return _c } -// MustGetProposer provides a mock function with given fields: height, round -func (_m *ProposerSelector) MustGetProposer(height int64, round int32) *types.Validator { - ret := _m.Called(height, round) +// MustGetProposer provides a mock function for the type ProposerSelector +func (_mock *ProposerSelector) MustGetProposer(height int64, round int32) *types.Validator { + ret := _mock.Called(height, round) if len(ret) == 0 { panic("no return value specified for MustGetProposer") } var r0 *types.Validator - if rf, ok := ret.Get(0).(func(int64, int32) *types.Validator); ok { - r0 = rf(height, round) + if returnFunc, ok := ret.Get(0).(func(int64, int32) *types.Validator); ok { + r0 = returnFunc(height, round) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.Validator) } } - return r0 } @@ -153,8 +165,8 @@ type ProposerSelector_MustGetProposer_Call struct { } // MustGetProposer is a helper method to define mock.On call -// - height int64 -// - round int32 +// - height +// - round func (_e *ProposerSelector_Expecter) MustGetProposer(height interface{}, round interface{}) *ProposerSelector_MustGetProposer_Call { return &ProposerSelector_MustGetProposer_Call{Call: _e.mock.On("MustGetProposer", height, round)} } @@ -166,31 +178,30 @@ func (_c *ProposerSelector_MustGetProposer_Call) Run(run func(height int64, roun return _c } -func (_c *ProposerSelector_MustGetProposer_Call) Return(_a0 *types.Validator) *ProposerSelector_MustGetProposer_Call { - _c.Call.Return(_a0) +func (_c *ProposerSelector_MustGetProposer_Call) Return(validator *types.Validator) *ProposerSelector_MustGetProposer_Call { + _c.Call.Return(validator) return _c } -func (_c *ProposerSelector_MustGetProposer_Call) RunAndReturn(run func(int64, int32) *types.Validator) *ProposerSelector_MustGetProposer_Call { +func (_c *ProposerSelector_MustGetProposer_Call) RunAndReturn(run func(height int64, round int32) *types.Validator) *ProposerSelector_MustGetProposer_Call { _c.Call.Return(run) return _c } -// UpdateHeightRound provides a mock function with given fields: height, round -func (_m *ProposerSelector) UpdateHeightRound(height int64, round int32) error { - ret := _m.Called(height, round) +// UpdateHeightRound provides a mock function for the type ProposerSelector +func (_mock *ProposerSelector) UpdateHeightRound(height int64, round int32) error { + ret := _mock.Called(height, round) if len(ret) == 0 { panic("no return value specified for UpdateHeightRound") } var r0 error - if rf, ok := ret.Get(0).(func(int64, int32) error); ok { - r0 = rf(height, round) + if returnFunc, ok := ret.Get(0).(func(int64, int32) error); ok { + r0 = returnFunc(height, round) } else { r0 = ret.Error(0) } - return r0 } @@ -200,8 +211,8 @@ type ProposerSelector_UpdateHeightRound_Call struct { } // UpdateHeightRound is a helper method to define mock.On call -// - height int64 -// - round int32 +// - height +// - round func (_e *ProposerSelector_Expecter) UpdateHeightRound(height interface{}, round interface{}) *ProposerSelector_UpdateHeightRound_Call { return &ProposerSelector_UpdateHeightRound_Call{Call: _e.mock.On("UpdateHeightRound", height, round)} } @@ -213,33 +224,32 @@ func (_c *ProposerSelector_UpdateHeightRound_Call) Run(run func(height int64, ro return _c } -func (_c *ProposerSelector_UpdateHeightRound_Call) Return(_a0 error) *ProposerSelector_UpdateHeightRound_Call { - _c.Call.Return(_a0) +func (_c *ProposerSelector_UpdateHeightRound_Call) Return(err error) *ProposerSelector_UpdateHeightRound_Call { + _c.Call.Return(err) return _c } -func (_c *ProposerSelector_UpdateHeightRound_Call) RunAndReturn(run func(int64, int32) error) *ProposerSelector_UpdateHeightRound_Call { +func (_c *ProposerSelector_UpdateHeightRound_Call) RunAndReturn(run func(height int64, round int32) error) *ProposerSelector_UpdateHeightRound_Call { _c.Call.Return(run) return _c } -// ValidatorSet provides a mock function with no fields -func (_m *ProposerSelector) ValidatorSet() *types.ValidatorSet { - ret := _m.Called() +// ValidatorSet provides a mock function for the type ProposerSelector +func (_mock *ProposerSelector) ValidatorSet() *types.ValidatorSet { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for ValidatorSet") } var r0 *types.ValidatorSet - if rf, ok := ret.Get(0).(func() *types.ValidatorSet); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() *types.ValidatorSet); ok { + r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ValidatorSet) } } - return r0 } @@ -260,8 +270,8 @@ func (_c *ProposerSelector_ValidatorSet_Call) Run(run func()) *ProposerSelector_ return _c } -func (_c *ProposerSelector_ValidatorSet_Call) Return(_a0 *types.ValidatorSet) *ProposerSelector_ValidatorSet_Call { - _c.Call.Return(_a0) +func (_c *ProposerSelector_ValidatorSet_Call) Return(validatorSet *types.ValidatorSet) *ProposerSelector_ValidatorSet_Call { + _c.Call.Return(validatorSet) return _c } @@ -269,17 +279,3 @@ func (_c *ProposerSelector_ValidatorSet_Call) RunAndReturn(run func() *types.Val _c.Call.Return(run) return _c } - -// NewProposerSelector creates a new instance of ProposerSelector. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewProposerSelector(t interface { - mock.TestingT - Cleanup(func()) -}) *ProposerSelector { - mock := &ProposerSelector{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/evidence/mocks/blockstore.go b/internal/evidence/mocks/blockstore.go index cc27dc4d2a..31d5d4692d 100644 --- a/internal/evidence/mocks/blockstore.go +++ b/internal/evidence/mocks/blockstore.go @@ -1,12 +1,28 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - types "github.com/dashpay/tenderdash/types" + "github.com/dashpay/tenderdash/types" mock "github.com/stretchr/testify/mock" ) +// NewBlockStore creates a new instance of BlockStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBlockStore(t interface { + mock.TestingT + Cleanup(func()) +}) *BlockStore { + mock := &BlockStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // BlockStore is an autogenerated mock type for the BlockStore type type BlockStore struct { mock.Mock @@ -20,21 +36,20 @@ func (_m *BlockStore) EXPECT() *BlockStore_Expecter { return &BlockStore_Expecter{mock: &_m.Mock} } -// Base provides a mock function with no fields -func (_m *BlockStore) Base() int64 { - ret := _m.Called() +// Base provides a mock function for the type BlockStore +func (_mock *BlockStore) Base() int64 { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Base") } var r0 int64 - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() int64); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(int64) } - return r0 } @@ -55,8 +70,8 @@ func (_c *BlockStore_Base_Call) Run(run func()) *BlockStore_Base_Call { return _c } -func (_c *BlockStore_Base_Call) Return(_a0 int64) *BlockStore_Base_Call { - _c.Call.Return(_a0) +func (_c *BlockStore_Base_Call) Return(n int64) *BlockStore_Base_Call { + _c.Call.Return(n) return _c } @@ -65,21 +80,20 @@ func (_c *BlockStore_Base_Call) RunAndReturn(run func() int64) *BlockStore_Base_ return _c } -// Height provides a mock function with no fields -func (_m *BlockStore) Height() int64 { - ret := _m.Called() +// Height provides a mock function for the type BlockStore +func (_mock *BlockStore) Height() int64 { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Height") } var r0 int64 - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() int64); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(int64) } - return r0 } @@ -100,8 +114,8 @@ func (_c *BlockStore_Height_Call) Run(run func()) *BlockStore_Height_Call { return _c } -func (_c *BlockStore_Height_Call) Return(_a0 int64) *BlockStore_Height_Call { - _c.Call.Return(_a0) +func (_c *BlockStore_Height_Call) Return(n int64) *BlockStore_Height_Call { + _c.Call.Return(n) return _c } @@ -110,23 +124,22 @@ func (_c *BlockStore_Height_Call) RunAndReturn(run func() int64) *BlockStore_Hei return _c } -// LoadBlockCommit provides a mock function with given fields: height -func (_m *BlockStore) LoadBlockCommit(height int64) *types.Commit { - ret := _m.Called(height) +// LoadBlockCommit provides a mock function for the type BlockStore +func (_mock *BlockStore) LoadBlockCommit(height int64) *types.Commit { + ret := _mock.Called(height) if len(ret) == 0 { panic("no return value specified for LoadBlockCommit") } var r0 *types.Commit - if rf, ok := ret.Get(0).(func(int64) *types.Commit); ok { - r0 = rf(height) + if returnFunc, ok := ret.Get(0).(func(int64) *types.Commit); ok { + r0 = returnFunc(height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.Commit) } } - return r0 } @@ -136,7 +149,7 @@ type BlockStore_LoadBlockCommit_Call struct { } // LoadBlockCommit is a helper method to define mock.On call -// - height int64 +// - height func (_e *BlockStore_Expecter) LoadBlockCommit(height interface{}) *BlockStore_LoadBlockCommit_Call { return &BlockStore_LoadBlockCommit_Call{Call: _e.mock.On("LoadBlockCommit", height)} } @@ -148,33 +161,32 @@ func (_c *BlockStore_LoadBlockCommit_Call) Run(run func(height int64)) *BlockSto return _c } -func (_c *BlockStore_LoadBlockCommit_Call) Return(_a0 *types.Commit) *BlockStore_LoadBlockCommit_Call { - _c.Call.Return(_a0) +func (_c *BlockStore_LoadBlockCommit_Call) Return(commit *types.Commit) *BlockStore_LoadBlockCommit_Call { + _c.Call.Return(commit) return _c } -func (_c *BlockStore_LoadBlockCommit_Call) RunAndReturn(run func(int64) *types.Commit) *BlockStore_LoadBlockCommit_Call { +func (_c *BlockStore_LoadBlockCommit_Call) RunAndReturn(run func(height int64) *types.Commit) *BlockStore_LoadBlockCommit_Call { _c.Call.Return(run) return _c } -// LoadBlockMeta provides a mock function with given fields: height -func (_m *BlockStore) LoadBlockMeta(height int64) *types.BlockMeta { - ret := _m.Called(height) +// LoadBlockMeta provides a mock function for the type BlockStore +func (_mock *BlockStore) LoadBlockMeta(height int64) *types.BlockMeta { + ret := _mock.Called(height) if len(ret) == 0 { panic("no return value specified for LoadBlockMeta") } var r0 *types.BlockMeta - if rf, ok := ret.Get(0).(func(int64) *types.BlockMeta); ok { - r0 = rf(height) + if returnFunc, ok := ret.Get(0).(func(int64) *types.BlockMeta); ok { + r0 = returnFunc(height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.BlockMeta) } } - return r0 } @@ -184,7 +196,7 @@ type BlockStore_LoadBlockMeta_Call struct { } // LoadBlockMeta is a helper method to define mock.On call -// - height int64 +// - height func (_e *BlockStore_Expecter) LoadBlockMeta(height interface{}) *BlockStore_LoadBlockMeta_Call { return &BlockStore_LoadBlockMeta_Call{Call: _e.mock.On("LoadBlockMeta", height)} } @@ -196,26 +208,12 @@ func (_c *BlockStore_LoadBlockMeta_Call) Run(run func(height int64)) *BlockStore return _c } -func (_c *BlockStore_LoadBlockMeta_Call) Return(_a0 *types.BlockMeta) *BlockStore_LoadBlockMeta_Call { - _c.Call.Return(_a0) +func (_c *BlockStore_LoadBlockMeta_Call) Return(blockMeta *types.BlockMeta) *BlockStore_LoadBlockMeta_Call { + _c.Call.Return(blockMeta) return _c } -func (_c *BlockStore_LoadBlockMeta_Call) RunAndReturn(run func(int64) *types.BlockMeta) *BlockStore_LoadBlockMeta_Call { +func (_c *BlockStore_LoadBlockMeta_Call) RunAndReturn(run func(height int64) *types.BlockMeta) *BlockStore_LoadBlockMeta_Call { _c.Call.Return(run) return _c } - -// NewBlockStore creates a new instance of BlockStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewBlockStore(t interface { - mock.TestingT - Cleanup(func()) -}) *BlockStore { - mock := &BlockStore{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/mempool/mocks/mempool.go b/internal/mempool/mocks/mempool.go index db1c0fdc98..123d3fa9cc 100644 --- a/internal/mempool/mocks/mempool.go +++ b/internal/mempool/mocks/mempool.go @@ -1,18 +1,31 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" - abcitypes "github.com/dashpay/tenderdash/abci/types" + types0 "github.com/dashpay/tenderdash/abci/types" + "github.com/dashpay/tenderdash/internal/mempool" + "github.com/dashpay/tenderdash/types" + mock "github.com/stretchr/testify/mock" +) - mempool "github.com/dashpay/tenderdash/internal/mempool" +// NewMempool creates a new instance of Mempool. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMempool(t interface { + mock.TestingT + Cleanup(func()) +}) *Mempool { + mock := &Mempool{} + mock.Mock.Test(t) - mock "github.com/stretchr/testify/mock" + t.Cleanup(func() { mock.AssertExpectations(t) }) - types "github.com/dashpay/tenderdash/types" -) + return mock +} // Mempool is an autogenerated mock type for the Mempool type type Mempool struct { @@ -27,21 +40,20 @@ func (_m *Mempool) EXPECT() *Mempool_Expecter { return &Mempool_Expecter{mock: &_m.Mock} } -// CheckTx provides a mock function with given fields: ctx, tx, cb, txInfo -func (_m *Mempool) CheckTx(ctx context.Context, tx types.Tx, cb func(*abcitypes.ResponseCheckTx), txInfo mempool.TxInfo) error { - ret := _m.Called(ctx, tx, cb, txInfo) +// CheckTx provides a mock function for the type Mempool +func (_mock *Mempool) CheckTx(ctx context.Context, tx types.Tx, cb func(*types0.ResponseCheckTx), txInfo mempool.TxInfo) error { + ret := _mock.Called(ctx, tx, cb, txInfo) if len(ret) == 0 { panic("no return value specified for CheckTx") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx, func(*abcitypes.ResponseCheckTx), mempool.TxInfo) error); ok { - r0 = rf(ctx, tx, cb, txInfo) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx, func(*types0.ResponseCheckTx), mempool.TxInfo) error); ok { + r0 = returnFunc(ctx, tx, cb, txInfo) } else { r0 = ret.Error(0) } - return r0 } @@ -51,34 +63,35 @@ type Mempool_CheckTx_Call struct { } // CheckTx is a helper method to define mock.On call -// - ctx context.Context -// - tx types.Tx -// - cb func(*abcitypes.ResponseCheckTx) -// - txInfo mempool.TxInfo +// - ctx +// - tx +// - cb +// - txInfo func (_e *Mempool_Expecter) CheckTx(ctx interface{}, tx interface{}, cb interface{}, txInfo interface{}) *Mempool_CheckTx_Call { return &Mempool_CheckTx_Call{Call: _e.mock.On("CheckTx", ctx, tx, cb, txInfo)} } -func (_c *Mempool_CheckTx_Call) Run(run func(ctx context.Context, tx types.Tx, cb func(*abcitypes.ResponseCheckTx), txInfo mempool.TxInfo)) *Mempool_CheckTx_Call { +func (_c *Mempool_CheckTx_Call) Run(run func(ctx context.Context, tx types.Tx, cb func(*types0.ResponseCheckTx), txInfo mempool.TxInfo)) *Mempool_CheckTx_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(types.Tx), args[2].(func(*abcitypes.ResponseCheckTx)), args[3].(mempool.TxInfo)) + run(args[0].(context.Context), args[1].(types.Tx), args[2].(func(*types0.ResponseCheckTx)), args[3].(mempool.TxInfo)) }) return _c } -func (_c *Mempool_CheckTx_Call) Return(_a0 error) *Mempool_CheckTx_Call { - _c.Call.Return(_a0) +func (_c *Mempool_CheckTx_Call) Return(err error) *Mempool_CheckTx_Call { + _c.Call.Return(err) return _c } -func (_c *Mempool_CheckTx_Call) RunAndReturn(run func(context.Context, types.Tx, func(*abcitypes.ResponseCheckTx), mempool.TxInfo) error) *Mempool_CheckTx_Call { +func (_c *Mempool_CheckTx_Call) RunAndReturn(run func(ctx context.Context, tx types.Tx, cb func(*types0.ResponseCheckTx), txInfo mempool.TxInfo) error) *Mempool_CheckTx_Call { _c.Call.Return(run) return _c } -// EnableTxsAvailable provides a mock function with no fields -func (_m *Mempool) EnableTxsAvailable() { - _m.Called() +// EnableTxsAvailable provides a mock function for the type Mempool +func (_mock *Mempool) EnableTxsAvailable() { + _mock.Called() + return } // Mempool_EnableTxsAvailable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnableTxsAvailable' @@ -108,9 +121,10 @@ func (_c *Mempool_EnableTxsAvailable_Call) RunAndReturn(run func()) *Mempool_Ena return _c } -// Flush provides a mock function with no fields -func (_m *Mempool) Flush() { - _m.Called() +// Flush provides a mock function for the type Mempool +func (_mock *Mempool) Flush() { + _mock.Called() + return } // Mempool_Flush_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Flush' @@ -140,21 +154,20 @@ func (_c *Mempool_Flush_Call) RunAndReturn(run func()) *Mempool_Flush_Call { return _c } -// FlushAppConn provides a mock function with given fields: _a0 -func (_m *Mempool) FlushAppConn(_a0 context.Context) error { - ret := _m.Called(_a0) +// FlushAppConn provides a mock function for the type Mempool +func (_mock *Mempool) FlushAppConn(context1 context.Context) error { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for FlushAppConn") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = returnFunc(context1) } else { r0 = ret.Error(0) } - return r0 } @@ -164,45 +177,44 @@ type Mempool_FlushAppConn_Call struct { } // FlushAppConn is a helper method to define mock.On call -// - _a0 context.Context -func (_e *Mempool_Expecter) FlushAppConn(_a0 interface{}) *Mempool_FlushAppConn_Call { - return &Mempool_FlushAppConn_Call{Call: _e.mock.On("FlushAppConn", _a0)} +// - context1 +func (_e *Mempool_Expecter) FlushAppConn(context1 interface{}) *Mempool_FlushAppConn_Call { + return &Mempool_FlushAppConn_Call{Call: _e.mock.On("FlushAppConn", context1)} } -func (_c *Mempool_FlushAppConn_Call) Run(run func(_a0 context.Context)) *Mempool_FlushAppConn_Call { +func (_c *Mempool_FlushAppConn_Call) Run(run func(context1 context.Context)) *Mempool_FlushAppConn_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *Mempool_FlushAppConn_Call) Return(_a0 error) *Mempool_FlushAppConn_Call { - _c.Call.Return(_a0) +func (_c *Mempool_FlushAppConn_Call) Return(err error) *Mempool_FlushAppConn_Call { + _c.Call.Return(err) return _c } -func (_c *Mempool_FlushAppConn_Call) RunAndReturn(run func(context.Context) error) *Mempool_FlushAppConn_Call { +func (_c *Mempool_FlushAppConn_Call) RunAndReturn(run func(context1 context.Context) error) *Mempool_FlushAppConn_Call { _c.Call.Return(run) return _c } -// GetTxByHash provides a mock function with given fields: txHash -func (_m *Mempool) GetTxByHash(txHash types.TxKey) types.Tx { - ret := _m.Called(txHash) +// GetTxByHash provides a mock function for the type Mempool +func (_mock *Mempool) GetTxByHash(txHash types.TxKey) types.Tx { + ret := _mock.Called(txHash) if len(ret) == 0 { panic("no return value specified for GetTxByHash") } var r0 types.Tx - if rf, ok := ret.Get(0).(func(types.TxKey) types.Tx); ok { - r0 = rf(txHash) + if returnFunc, ok := ret.Get(0).(func(types.TxKey) types.Tx); ok { + r0 = returnFunc(txHash) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(types.Tx) } } - return r0 } @@ -212,7 +224,7 @@ type Mempool_GetTxByHash_Call struct { } // GetTxByHash is a helper method to define mock.On call -// - txHash types.TxKey +// - txHash func (_e *Mempool_Expecter) GetTxByHash(txHash interface{}) *Mempool_GetTxByHash_Call { return &Mempool_GetTxByHash_Call{Call: _e.mock.On("GetTxByHash", txHash)} } @@ -224,19 +236,20 @@ func (_c *Mempool_GetTxByHash_Call) Run(run func(txHash types.TxKey)) *Mempool_G return _c } -func (_c *Mempool_GetTxByHash_Call) Return(_a0 types.Tx) *Mempool_GetTxByHash_Call { - _c.Call.Return(_a0) +func (_c *Mempool_GetTxByHash_Call) Return(tx types.Tx) *Mempool_GetTxByHash_Call { + _c.Call.Return(tx) return _c } -func (_c *Mempool_GetTxByHash_Call) RunAndReturn(run func(types.TxKey) types.Tx) *Mempool_GetTxByHash_Call { +func (_c *Mempool_GetTxByHash_Call) RunAndReturn(run func(txHash types.TxKey) types.Tx) *Mempool_GetTxByHash_Call { _c.Call.Return(run) return _c } -// Lock provides a mock function with no fields -func (_m *Mempool) Lock() { - _m.Called() +// Lock provides a mock function for the type Mempool +func (_mock *Mempool) Lock() { + _mock.Called() + return } // Mempool_Lock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Lock' @@ -266,23 +279,22 @@ func (_c *Mempool_Lock_Call) RunAndReturn(run func()) *Mempool_Lock_Call { return _c } -// ReapMaxBytesMaxGas provides a mock function with given fields: maxBytes, maxGas -func (_m *Mempool) ReapMaxBytesMaxGas(maxBytes int64, maxGas int64) types.Txs { - ret := _m.Called(maxBytes, maxGas) +// ReapMaxBytesMaxGas provides a mock function for the type Mempool +func (_mock *Mempool) ReapMaxBytesMaxGas(maxBytes int64, maxGas int64) types.Txs { + ret := _mock.Called(maxBytes, maxGas) if len(ret) == 0 { panic("no return value specified for ReapMaxBytesMaxGas") } var r0 types.Txs - if rf, ok := ret.Get(0).(func(int64, int64) types.Txs); ok { - r0 = rf(maxBytes, maxGas) + if returnFunc, ok := ret.Get(0).(func(int64, int64) types.Txs); ok { + r0 = returnFunc(maxBytes, maxGas) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(types.Txs) } } - return r0 } @@ -292,8 +304,8 @@ type Mempool_ReapMaxBytesMaxGas_Call struct { } // ReapMaxBytesMaxGas is a helper method to define mock.On call -// - maxBytes int64 -// - maxGas int64 +// - maxBytes +// - maxGas func (_e *Mempool_Expecter) ReapMaxBytesMaxGas(maxBytes interface{}, maxGas interface{}) *Mempool_ReapMaxBytesMaxGas_Call { return &Mempool_ReapMaxBytesMaxGas_Call{Call: _e.mock.On("ReapMaxBytesMaxGas", maxBytes, maxGas)} } @@ -305,33 +317,32 @@ func (_c *Mempool_ReapMaxBytesMaxGas_Call) Run(run func(maxBytes int64, maxGas i return _c } -func (_c *Mempool_ReapMaxBytesMaxGas_Call) Return(_a0 types.Txs) *Mempool_ReapMaxBytesMaxGas_Call { - _c.Call.Return(_a0) +func (_c *Mempool_ReapMaxBytesMaxGas_Call) Return(txs types.Txs) *Mempool_ReapMaxBytesMaxGas_Call { + _c.Call.Return(txs) return _c } -func (_c *Mempool_ReapMaxBytesMaxGas_Call) RunAndReturn(run func(int64, int64) types.Txs) *Mempool_ReapMaxBytesMaxGas_Call { +func (_c *Mempool_ReapMaxBytesMaxGas_Call) RunAndReturn(run func(maxBytes int64, maxGas int64) types.Txs) *Mempool_ReapMaxBytesMaxGas_Call { _c.Call.Return(run) return _c } -// ReapMaxTxs provides a mock function with given fields: max -func (_m *Mempool) ReapMaxTxs(max int) types.Txs { - ret := _m.Called(max) +// ReapMaxTxs provides a mock function for the type Mempool +func (_mock *Mempool) ReapMaxTxs(max int) types.Txs { + ret := _mock.Called(max) if len(ret) == 0 { panic("no return value specified for ReapMaxTxs") } var r0 types.Txs - if rf, ok := ret.Get(0).(func(int) types.Txs); ok { - r0 = rf(max) + if returnFunc, ok := ret.Get(0).(func(int) types.Txs); ok { + r0 = returnFunc(max) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(types.Txs) } } - return r0 } @@ -341,7 +352,7 @@ type Mempool_ReapMaxTxs_Call struct { } // ReapMaxTxs is a helper method to define mock.On call -// - max int +// - max func (_e *Mempool_Expecter) ReapMaxTxs(max interface{}) *Mempool_ReapMaxTxs_Call { return &Mempool_ReapMaxTxs_Call{Call: _e.mock.On("ReapMaxTxs", max)} } @@ -353,31 +364,30 @@ func (_c *Mempool_ReapMaxTxs_Call) Run(run func(max int)) *Mempool_ReapMaxTxs_Ca return _c } -func (_c *Mempool_ReapMaxTxs_Call) Return(_a0 types.Txs) *Mempool_ReapMaxTxs_Call { - _c.Call.Return(_a0) +func (_c *Mempool_ReapMaxTxs_Call) Return(txs types.Txs) *Mempool_ReapMaxTxs_Call { + _c.Call.Return(txs) return _c } -func (_c *Mempool_ReapMaxTxs_Call) RunAndReturn(run func(int) types.Txs) *Mempool_ReapMaxTxs_Call { +func (_c *Mempool_ReapMaxTxs_Call) RunAndReturn(run func(max int) types.Txs) *Mempool_ReapMaxTxs_Call { _c.Call.Return(run) return _c } -// RemoveTxByKey provides a mock function with given fields: txKey -func (_m *Mempool) RemoveTxByKey(txKey types.TxKey) error { - ret := _m.Called(txKey) +// RemoveTxByKey provides a mock function for the type Mempool +func (_mock *Mempool) RemoveTxByKey(txKey types.TxKey) error { + ret := _mock.Called(txKey) if len(ret) == 0 { panic("no return value specified for RemoveTxByKey") } var r0 error - if rf, ok := ret.Get(0).(func(types.TxKey) error); ok { - r0 = rf(txKey) + if returnFunc, ok := ret.Get(0).(func(types.TxKey) error); ok { + r0 = returnFunc(txKey) } else { r0 = ret.Error(0) } - return r0 } @@ -387,7 +397,7 @@ type Mempool_RemoveTxByKey_Call struct { } // RemoveTxByKey is a helper method to define mock.On call -// - txKey types.TxKey +// - txKey func (_e *Mempool_Expecter) RemoveTxByKey(txKey interface{}) *Mempool_RemoveTxByKey_Call { return &Mempool_RemoveTxByKey_Call{Call: _e.mock.On("RemoveTxByKey", txKey)} } @@ -399,31 +409,30 @@ func (_c *Mempool_RemoveTxByKey_Call) Run(run func(txKey types.TxKey)) *Mempool_ return _c } -func (_c *Mempool_RemoveTxByKey_Call) Return(_a0 error) *Mempool_RemoveTxByKey_Call { - _c.Call.Return(_a0) +func (_c *Mempool_RemoveTxByKey_Call) Return(err error) *Mempool_RemoveTxByKey_Call { + _c.Call.Return(err) return _c } -func (_c *Mempool_RemoveTxByKey_Call) RunAndReturn(run func(types.TxKey) error) *Mempool_RemoveTxByKey_Call { +func (_c *Mempool_RemoveTxByKey_Call) RunAndReturn(run func(txKey types.TxKey) error) *Mempool_RemoveTxByKey_Call { _c.Call.Return(run) return _c } -// Size provides a mock function with no fields -func (_m *Mempool) Size() int { - ret := _m.Called() +// Size provides a mock function for the type Mempool +func (_mock *Mempool) Size() int { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Size") } var r0 int - if rf, ok := ret.Get(0).(func() int); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() int); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(int) } - return r0 } @@ -444,8 +453,8 @@ func (_c *Mempool_Size_Call) Run(run func()) *Mempool_Size_Call { return _c } -func (_c *Mempool_Size_Call) Return(_a0 int) *Mempool_Size_Call { - _c.Call.Return(_a0) +func (_c *Mempool_Size_Call) Return(n int) *Mempool_Size_Call { + _c.Call.Return(n) return _c } @@ -454,21 +463,20 @@ func (_c *Mempool_Size_Call) RunAndReturn(run func() int) *Mempool_Size_Call { return _c } -// SizeBytes provides a mock function with no fields -func (_m *Mempool) SizeBytes() int64 { - ret := _m.Called() +// SizeBytes provides a mock function for the type Mempool +func (_mock *Mempool) SizeBytes() int64 { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for SizeBytes") } var r0 int64 - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() int64); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(int64) } - return r0 } @@ -489,8 +497,8 @@ func (_c *Mempool_SizeBytes_Call) Run(run func()) *Mempool_SizeBytes_Call { return _c } -func (_c *Mempool_SizeBytes_Call) Return(_a0 int64) *Mempool_SizeBytes_Call { - _c.Call.Return(_a0) +func (_c *Mempool_SizeBytes_Call) Return(n int64) *Mempool_SizeBytes_Call { + _c.Call.Return(n) return _c } @@ -499,23 +507,22 @@ func (_c *Mempool_SizeBytes_Call) RunAndReturn(run func() int64) *Mempool_SizeBy return _c } -// TxsAvailable provides a mock function with no fields -func (_m *Mempool) TxsAvailable() <-chan struct{} { - ret := _m.Called() +// TxsAvailable provides a mock function for the type Mempool +func (_mock *Mempool) TxsAvailable() <-chan struct{} { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for TxsAvailable") } var r0 <-chan struct{} - if rf, ok := ret.Get(0).(func() <-chan struct{}); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() <-chan struct{}); ok { + r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(<-chan struct{}) } } - return r0 } @@ -536,8 +543,8 @@ func (_c *Mempool_TxsAvailable_Call) Run(run func()) *Mempool_TxsAvailable_Call return _c } -func (_c *Mempool_TxsAvailable_Call) Return(_a0 <-chan struct{}) *Mempool_TxsAvailable_Call { - _c.Call.Return(_a0) +func (_c *Mempool_TxsAvailable_Call) Return(valCh <-chan struct{}) *Mempool_TxsAvailable_Call { + _c.Call.Return(valCh) return _c } @@ -546,9 +553,10 @@ func (_c *Mempool_TxsAvailable_Call) RunAndReturn(run func() <-chan struct{}) *M return _c } -// Unlock provides a mock function with no fields -func (_m *Mempool) Unlock() { - _m.Called() +// Unlock provides a mock function for the type Mempool +func (_mock *Mempool) Unlock() { + _mock.Called() + return } // Mempool_Unlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unlock' @@ -578,21 +586,20 @@ func (_c *Mempool_Unlock_Call) RunAndReturn(run func()) *Mempool_Unlock_Call { return _c } -// Update provides a mock function with given fields: ctx, blockHeight, blockTxs, txResults, newPreFn, newPostFn, recheck -func (_m *Mempool) Update(ctx context.Context, blockHeight int64, blockTxs types.Txs, txResults []*abcitypes.ExecTxResult, newPreFn mempool.PreCheckFunc, newPostFn mempool.PostCheckFunc, recheck bool) error { - ret := _m.Called(ctx, blockHeight, blockTxs, txResults, newPreFn, newPostFn, recheck) +// Update provides a mock function for the type Mempool +func (_mock *Mempool) Update(ctx context.Context, blockHeight int64, blockTxs types.Txs, txResults []*types0.ExecTxResult, newPreFn mempool.PreCheckFunc, newPostFn mempool.PostCheckFunc, recheck bool) error { + ret := _mock.Called(ctx, blockHeight, blockTxs, txResults, newPreFn, newPostFn, recheck) if len(ret) == 0 { panic("no return value specified for Update") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, int64, types.Txs, []*abcitypes.ExecTxResult, mempool.PreCheckFunc, mempool.PostCheckFunc, bool) error); ok { - r0 = rf(ctx, blockHeight, blockTxs, txResults, newPreFn, newPostFn, recheck) + if returnFunc, ok := ret.Get(0).(func(context.Context, int64, types.Txs, []*types0.ExecTxResult, mempool.PreCheckFunc, mempool.PostCheckFunc, bool) error); ok { + r0 = returnFunc(ctx, blockHeight, blockTxs, txResults, newPreFn, newPostFn, recheck) } else { r0 = ret.Error(0) } - return r0 } @@ -602,44 +609,30 @@ type Mempool_Update_Call struct { } // Update is a helper method to define mock.On call -// - ctx context.Context -// - blockHeight int64 -// - blockTxs types.Txs -// - txResults []*abcitypes.ExecTxResult -// - newPreFn mempool.PreCheckFunc -// - newPostFn mempool.PostCheckFunc -// - recheck bool +// - ctx +// - blockHeight +// - blockTxs +// - txResults +// - newPreFn +// - newPostFn +// - recheck func (_e *Mempool_Expecter) Update(ctx interface{}, blockHeight interface{}, blockTxs interface{}, txResults interface{}, newPreFn interface{}, newPostFn interface{}, recheck interface{}) *Mempool_Update_Call { return &Mempool_Update_Call{Call: _e.mock.On("Update", ctx, blockHeight, blockTxs, txResults, newPreFn, newPostFn, recheck)} } -func (_c *Mempool_Update_Call) Run(run func(ctx context.Context, blockHeight int64, blockTxs types.Txs, txResults []*abcitypes.ExecTxResult, newPreFn mempool.PreCheckFunc, newPostFn mempool.PostCheckFunc, recheck bool)) *Mempool_Update_Call { +func (_c *Mempool_Update_Call) Run(run func(ctx context.Context, blockHeight int64, blockTxs types.Txs, txResults []*types0.ExecTxResult, newPreFn mempool.PreCheckFunc, newPostFn mempool.PostCheckFunc, recheck bool)) *Mempool_Update_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(int64), args[2].(types.Txs), args[3].([]*abcitypes.ExecTxResult), args[4].(mempool.PreCheckFunc), args[5].(mempool.PostCheckFunc), args[6].(bool)) + run(args[0].(context.Context), args[1].(int64), args[2].(types.Txs), args[3].([]*types0.ExecTxResult), args[4].(mempool.PreCheckFunc), args[5].(mempool.PostCheckFunc), args[6].(bool)) }) return _c } -func (_c *Mempool_Update_Call) Return(_a0 error) *Mempool_Update_Call { - _c.Call.Return(_a0) +func (_c *Mempool_Update_Call) Return(err error) *Mempool_Update_Call { + _c.Call.Return(err) return _c } -func (_c *Mempool_Update_Call) RunAndReturn(run func(context.Context, int64, types.Txs, []*abcitypes.ExecTxResult, mempool.PreCheckFunc, mempool.PostCheckFunc, bool) error) *Mempool_Update_Call { +func (_c *Mempool_Update_Call) RunAndReturn(run func(ctx context.Context, blockHeight int64, blockTxs types.Txs, txResults []*types0.ExecTxResult, newPreFn mempool.PreCheckFunc, newPostFn mempool.PostCheckFunc, recheck bool) error) *Mempool_Update_Call { _c.Call.Return(run) return _c } - -// NewMempool creates a new instance of Mempool. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewMempool(t interface { - mock.TestingT - Cleanup(func()) -}) *Mempool { - mock := &Mempool{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/p2p/client/mocks/blockclient.go b/internal/p2p/client/mocks/blockclient.go index d4b8d0e3bd..2bcc333cee 100644 --- a/internal/p2p/client/mocks/blockclient.go +++ b/internal/p2p/client/mocks/blockclient.go @@ -1,18 +1,31 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - blocksync "github.com/dashpay/tenderdash/proto/tendermint/blocksync" - - context "context" + "context" + "github.com/dashpay/tenderdash/libs/promise" + "github.com/dashpay/tenderdash/proto/tendermint/blocksync" + "github.com/dashpay/tenderdash/types" mock "github.com/stretchr/testify/mock" +) - promise "github.com/dashpay/tenderdash/libs/promise" +// NewBlockClient creates a new instance of BlockClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBlockClient(t interface { + mock.TestingT + Cleanup(func()) +}) *BlockClient { + mock := &BlockClient{} + mock.Mock.Test(t) - types "github.com/dashpay/tenderdash/types" -) + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} // BlockClient is an autogenerated mock type for the BlockClient type type BlockClient struct { @@ -27,9 +40,9 @@ func (_m *BlockClient) EXPECT() *BlockClient_Expecter { return &BlockClient_Expecter{mock: &_m.Mock} } -// GetBlock provides a mock function with given fields: ctx, height, peerID -func (_m *BlockClient) GetBlock(ctx context.Context, height int64, peerID types.NodeID) (*promise.Promise[*blocksync.BlockResponse], error) { - ret := _m.Called(ctx, height, peerID) +// GetBlock provides a mock function for the type BlockClient +func (_mock *BlockClient) GetBlock(ctx context.Context, height int64, peerID types.NodeID) (*promise.Promise[*blocksync.BlockResponse], error) { + ret := _mock.Called(ctx, height, peerID) if len(ret) == 0 { panic("no return value specified for GetBlock") @@ -37,23 +50,21 @@ func (_m *BlockClient) GetBlock(ctx context.Context, height int64, peerID types. var r0 *promise.Promise[*blocksync.BlockResponse] var r1 error - if rf, ok := ret.Get(0).(func(context.Context, int64, types.NodeID) (*promise.Promise[*blocksync.BlockResponse], error)); ok { - return rf(ctx, height, peerID) + if returnFunc, ok := ret.Get(0).(func(context.Context, int64, types.NodeID) (*promise.Promise[*blocksync.BlockResponse], error)); ok { + return returnFunc(ctx, height, peerID) } - if rf, ok := ret.Get(0).(func(context.Context, int64, types.NodeID) *promise.Promise[*blocksync.BlockResponse]); ok { - r0 = rf(ctx, height, peerID) + if returnFunc, ok := ret.Get(0).(func(context.Context, int64, types.NodeID) *promise.Promise[*blocksync.BlockResponse]); ok { + r0 = returnFunc(ctx, height, peerID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*promise.Promise[*blocksync.BlockResponse]) } } - - if rf, ok := ret.Get(1).(func(context.Context, int64, types.NodeID) error); ok { - r1 = rf(ctx, height, peerID) + if returnFunc, ok := ret.Get(1).(func(context.Context, int64, types.NodeID) error); ok { + r1 = returnFunc(ctx, height, peerID) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -63,9 +74,9 @@ type BlockClient_GetBlock_Call struct { } // GetBlock is a helper method to define mock.On call -// - ctx context.Context -// - height int64 -// - peerID types.NodeID +// - ctx +// - height +// - peerID func (_e *BlockClient_Expecter) GetBlock(ctx interface{}, height interface{}, peerID interface{}) *BlockClient_GetBlock_Call { return &BlockClient_GetBlock_Call{Call: _e.mock.On("GetBlock", ctx, height, peerID)} } @@ -77,31 +88,30 @@ func (_c *BlockClient_GetBlock_Call) Run(run func(ctx context.Context, height in return _c } -func (_c *BlockClient_GetBlock_Call) Return(_a0 *promise.Promise[*blocksync.BlockResponse], _a1 error) *BlockClient_GetBlock_Call { - _c.Call.Return(_a0, _a1) +func (_c *BlockClient_GetBlock_Call) Return(promise1 *promise.Promise[*blocksync.BlockResponse], err error) *BlockClient_GetBlock_Call { + _c.Call.Return(promise1, err) return _c } -func (_c *BlockClient_GetBlock_Call) RunAndReturn(run func(context.Context, int64, types.NodeID) (*promise.Promise[*blocksync.BlockResponse], error)) *BlockClient_GetBlock_Call { +func (_c *BlockClient_GetBlock_Call) RunAndReturn(run func(ctx context.Context, height int64, peerID types.NodeID) (*promise.Promise[*blocksync.BlockResponse], error)) *BlockClient_GetBlock_Call { _c.Call.Return(run) return _c } -// GetSyncStatus provides a mock function with given fields: ctx -func (_m *BlockClient) GetSyncStatus(ctx context.Context) error { - ret := _m.Called(ctx) +// GetSyncStatus provides a mock function for the type BlockClient +func (_mock *BlockClient) GetSyncStatus(ctx context.Context) error { + ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for GetSyncStatus") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = returnFunc(ctx) } else { r0 = ret.Error(0) } - return r0 } @@ -111,7 +121,7 @@ type BlockClient_GetSyncStatus_Call struct { } // GetSyncStatus is a helper method to define mock.On call -// - ctx context.Context +// - ctx func (_e *BlockClient_Expecter) GetSyncStatus(ctx interface{}) *BlockClient_GetSyncStatus_Call { return &BlockClient_GetSyncStatus_Call{Call: _e.mock.On("GetSyncStatus", ctx)} } @@ -123,31 +133,30 @@ func (_c *BlockClient_GetSyncStatus_Call) Run(run func(ctx context.Context)) *Bl return _c } -func (_c *BlockClient_GetSyncStatus_Call) Return(_a0 error) *BlockClient_GetSyncStatus_Call { - _c.Call.Return(_a0) +func (_c *BlockClient_GetSyncStatus_Call) Return(err error) *BlockClient_GetSyncStatus_Call { + _c.Call.Return(err) return _c } -func (_c *BlockClient_GetSyncStatus_Call) RunAndReturn(run func(context.Context) error) *BlockClient_GetSyncStatus_Call { +func (_c *BlockClient_GetSyncStatus_Call) RunAndReturn(run func(ctx context.Context) error) *BlockClient_GetSyncStatus_Call { _c.Call.Return(run) return _c } -// Send provides a mock function with given fields: ctx, msg -func (_m *BlockClient) Send(ctx context.Context, msg any) error { - ret := _m.Called(ctx, msg) +// Send provides a mock function for the type BlockClient +func (_mock *BlockClient) Send(ctx context.Context, msg any) error { + ret := _mock.Called(ctx, msg) if len(ret) == 0 { panic("no return value specified for Send") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, any) error); ok { - r0 = rf(ctx, msg) + if returnFunc, ok := ret.Get(0).(func(context.Context, any) error); ok { + r0 = returnFunc(ctx, msg) } else { r0 = ret.Error(0) } - return r0 } @@ -157,8 +166,8 @@ type BlockClient_Send_Call struct { } // Send is a helper method to define mock.On call -// - ctx context.Context -// - msg any +// - ctx +// - msg func (_e *BlockClient_Expecter) Send(ctx interface{}, msg interface{}) *BlockClient_Send_Call { return &BlockClient_Send_Call{Call: _e.mock.On("Send", ctx, msg)} } @@ -170,26 +179,12 @@ func (_c *BlockClient_Send_Call) Run(run func(ctx context.Context, msg any)) *Bl return _c } -func (_c *BlockClient_Send_Call) Return(_a0 error) *BlockClient_Send_Call { - _c.Call.Return(_a0) +func (_c *BlockClient_Send_Call) Return(err error) *BlockClient_Send_Call { + _c.Call.Return(err) return _c } -func (_c *BlockClient_Send_Call) RunAndReturn(run func(context.Context, any) error) *BlockClient_Send_Call { +func (_c *BlockClient_Send_Call) RunAndReturn(run func(ctx context.Context, msg any) error) *BlockClient_Send_Call { _c.Call.Return(run) return _c } - -// NewBlockClient creates a new instance of BlockClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewBlockClient(t interface { - mock.TestingT - Cleanup(func()) -}) *BlockClient { - mock := &BlockClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/p2p/client/mocks/snapshotclient.go b/internal/p2p/client/mocks/snapshotclient.go index 543143be7b..94311fc523 100644 --- a/internal/p2p/client/mocks/snapshotclient.go +++ b/internal/p2p/client/mocks/snapshotclient.go @@ -1,17 +1,31 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" - promise "github.com/dashpay/tenderdash/libs/promise" + "github.com/dashpay/tenderdash/libs/promise" + "github.com/dashpay/tenderdash/proto/tendermint/statesync" + "github.com/dashpay/tenderdash/types" mock "github.com/stretchr/testify/mock" +) + +// NewSnapshotClient creates a new instance of SnapshotClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewSnapshotClient(t interface { + mock.TestingT + Cleanup(func()) +}) *SnapshotClient { + mock := &SnapshotClient{} + mock.Mock.Test(t) - statesync "github.com/dashpay/tenderdash/proto/tendermint/statesync" + t.Cleanup(func() { mock.AssertExpectations(t) }) - types "github.com/dashpay/tenderdash/types" -) + return mock +} // SnapshotClient is an autogenerated mock type for the SnapshotClient type type SnapshotClient struct { @@ -26,9 +40,9 @@ func (_m *SnapshotClient) EXPECT() *SnapshotClient_Expecter { return &SnapshotClient_Expecter{mock: &_m.Mock} } -// GetChunk provides a mock function with given fields: ctx, peerID, height, format, index -func (_m *SnapshotClient) GetChunk(ctx context.Context, peerID types.NodeID, height uint64, format uint32, index uint32) (*promise.Promise[*statesync.ChunkResponse], error) { - ret := _m.Called(ctx, peerID, height, format, index) +// GetChunk provides a mock function for the type SnapshotClient +func (_mock *SnapshotClient) GetChunk(ctx context.Context, peerID types.NodeID, height uint64, format uint32, index uint32) (*promise.Promise[*statesync.ChunkResponse], error) { + ret := _mock.Called(ctx, peerID, height, format, index) if len(ret) == 0 { panic("no return value specified for GetChunk") @@ -36,23 +50,21 @@ func (_m *SnapshotClient) GetChunk(ctx context.Context, peerID types.NodeID, hei var r0 *promise.Promise[*statesync.ChunkResponse] var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.NodeID, uint64, uint32, uint32) (*promise.Promise[*statesync.ChunkResponse], error)); ok { - return rf(ctx, peerID, height, format, index) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.NodeID, uint64, uint32, uint32) (*promise.Promise[*statesync.ChunkResponse], error)); ok { + return returnFunc(ctx, peerID, height, format, index) } - if rf, ok := ret.Get(0).(func(context.Context, types.NodeID, uint64, uint32, uint32) *promise.Promise[*statesync.ChunkResponse]); ok { - r0 = rf(ctx, peerID, height, format, index) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.NodeID, uint64, uint32, uint32) *promise.Promise[*statesync.ChunkResponse]); ok { + r0 = returnFunc(ctx, peerID, height, format, index) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*promise.Promise[*statesync.ChunkResponse]) } } - - if rf, ok := ret.Get(1).(func(context.Context, types.NodeID, uint64, uint32, uint32) error); ok { - r1 = rf(ctx, peerID, height, format, index) + if returnFunc, ok := ret.Get(1).(func(context.Context, types.NodeID, uint64, uint32, uint32) error); ok { + r1 = returnFunc(ctx, peerID, height, format, index) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -62,11 +74,11 @@ type SnapshotClient_GetChunk_Call struct { } // GetChunk is a helper method to define mock.On call -// - ctx context.Context -// - peerID types.NodeID -// - height uint64 -// - format uint32 -// - index uint32 +// - ctx +// - peerID +// - height +// - format +// - index func (_e *SnapshotClient_Expecter) GetChunk(ctx interface{}, peerID interface{}, height interface{}, format interface{}, index interface{}) *SnapshotClient_GetChunk_Call { return &SnapshotClient_GetChunk_Call{Call: _e.mock.On("GetChunk", ctx, peerID, height, format, index)} } @@ -78,19 +90,19 @@ func (_c *SnapshotClient_GetChunk_Call) Run(run func(ctx context.Context, peerID return _c } -func (_c *SnapshotClient_GetChunk_Call) Return(_a0 *promise.Promise[*statesync.ChunkResponse], _a1 error) *SnapshotClient_GetChunk_Call { - _c.Call.Return(_a0, _a1) +func (_c *SnapshotClient_GetChunk_Call) Return(promise1 *promise.Promise[*statesync.ChunkResponse], err error) *SnapshotClient_GetChunk_Call { + _c.Call.Return(promise1, err) return _c } -func (_c *SnapshotClient_GetChunk_Call) RunAndReturn(run func(context.Context, types.NodeID, uint64, uint32, uint32) (*promise.Promise[*statesync.ChunkResponse], error)) *SnapshotClient_GetChunk_Call { +func (_c *SnapshotClient_GetChunk_Call) RunAndReturn(run func(ctx context.Context, peerID types.NodeID, height uint64, format uint32, index uint32) (*promise.Promise[*statesync.ChunkResponse], error)) *SnapshotClient_GetChunk_Call { _c.Call.Return(run) return _c } -// GetLightBlock provides a mock function with given fields: ctx, peerID, height -func (_m *SnapshotClient) GetLightBlock(ctx context.Context, peerID types.NodeID, height uint64) (*promise.Promise[*statesync.LightBlockResponse], error) { - ret := _m.Called(ctx, peerID, height) +// GetLightBlock provides a mock function for the type SnapshotClient +func (_mock *SnapshotClient) GetLightBlock(ctx context.Context, peerID types.NodeID, height uint64) (*promise.Promise[*statesync.LightBlockResponse], error) { + ret := _mock.Called(ctx, peerID, height) if len(ret) == 0 { panic("no return value specified for GetLightBlock") @@ -98,23 +110,21 @@ func (_m *SnapshotClient) GetLightBlock(ctx context.Context, peerID types.NodeID var r0 *promise.Promise[*statesync.LightBlockResponse] var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.NodeID, uint64) (*promise.Promise[*statesync.LightBlockResponse], error)); ok { - return rf(ctx, peerID, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.NodeID, uint64) (*promise.Promise[*statesync.LightBlockResponse], error)); ok { + return returnFunc(ctx, peerID, height) } - if rf, ok := ret.Get(0).(func(context.Context, types.NodeID, uint64) *promise.Promise[*statesync.LightBlockResponse]); ok { - r0 = rf(ctx, peerID, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.NodeID, uint64) *promise.Promise[*statesync.LightBlockResponse]); ok { + r0 = returnFunc(ctx, peerID, height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*promise.Promise[*statesync.LightBlockResponse]) } } - - if rf, ok := ret.Get(1).(func(context.Context, types.NodeID, uint64) error); ok { - r1 = rf(ctx, peerID, height) + if returnFunc, ok := ret.Get(1).(func(context.Context, types.NodeID, uint64) error); ok { + r1 = returnFunc(ctx, peerID, height) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -124,9 +134,9 @@ type SnapshotClient_GetLightBlock_Call struct { } // GetLightBlock is a helper method to define mock.On call -// - ctx context.Context -// - peerID types.NodeID -// - height uint64 +// - ctx +// - peerID +// - height func (_e *SnapshotClient_Expecter) GetLightBlock(ctx interface{}, peerID interface{}, height interface{}) *SnapshotClient_GetLightBlock_Call { return &SnapshotClient_GetLightBlock_Call{Call: _e.mock.On("GetLightBlock", ctx, peerID, height)} } @@ -138,19 +148,19 @@ func (_c *SnapshotClient_GetLightBlock_Call) Run(run func(ctx context.Context, p return _c } -func (_c *SnapshotClient_GetLightBlock_Call) Return(_a0 *promise.Promise[*statesync.LightBlockResponse], _a1 error) *SnapshotClient_GetLightBlock_Call { - _c.Call.Return(_a0, _a1) +func (_c *SnapshotClient_GetLightBlock_Call) Return(promise1 *promise.Promise[*statesync.LightBlockResponse], err error) *SnapshotClient_GetLightBlock_Call { + _c.Call.Return(promise1, err) return _c } -func (_c *SnapshotClient_GetLightBlock_Call) RunAndReturn(run func(context.Context, types.NodeID, uint64) (*promise.Promise[*statesync.LightBlockResponse], error)) *SnapshotClient_GetLightBlock_Call { +func (_c *SnapshotClient_GetLightBlock_Call) RunAndReturn(run func(ctx context.Context, peerID types.NodeID, height uint64) (*promise.Promise[*statesync.LightBlockResponse], error)) *SnapshotClient_GetLightBlock_Call { _c.Call.Return(run) return _c } -// GetParams provides a mock function with given fields: ctx, peerID, height -func (_m *SnapshotClient) GetParams(ctx context.Context, peerID types.NodeID, height uint64) (*promise.Promise[*statesync.ParamsResponse], error) { - ret := _m.Called(ctx, peerID, height) +// GetParams provides a mock function for the type SnapshotClient +func (_mock *SnapshotClient) GetParams(ctx context.Context, peerID types.NodeID, height uint64) (*promise.Promise[*statesync.ParamsResponse], error) { + ret := _mock.Called(ctx, peerID, height) if len(ret) == 0 { panic("no return value specified for GetParams") @@ -158,23 +168,21 @@ func (_m *SnapshotClient) GetParams(ctx context.Context, peerID types.NodeID, he var r0 *promise.Promise[*statesync.ParamsResponse] var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.NodeID, uint64) (*promise.Promise[*statesync.ParamsResponse], error)); ok { - return rf(ctx, peerID, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.NodeID, uint64) (*promise.Promise[*statesync.ParamsResponse], error)); ok { + return returnFunc(ctx, peerID, height) } - if rf, ok := ret.Get(0).(func(context.Context, types.NodeID, uint64) *promise.Promise[*statesync.ParamsResponse]); ok { - r0 = rf(ctx, peerID, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.NodeID, uint64) *promise.Promise[*statesync.ParamsResponse]); ok { + r0 = returnFunc(ctx, peerID, height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*promise.Promise[*statesync.ParamsResponse]) } } - - if rf, ok := ret.Get(1).(func(context.Context, types.NodeID, uint64) error); ok { - r1 = rf(ctx, peerID, height) + if returnFunc, ok := ret.Get(1).(func(context.Context, types.NodeID, uint64) error); ok { + r1 = returnFunc(ctx, peerID, height) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -184,9 +192,9 @@ type SnapshotClient_GetParams_Call struct { } // GetParams is a helper method to define mock.On call -// - ctx context.Context -// - peerID types.NodeID -// - height uint64 +// - ctx +// - peerID +// - height func (_e *SnapshotClient_Expecter) GetParams(ctx interface{}, peerID interface{}, height interface{}) *SnapshotClient_GetParams_Call { return &SnapshotClient_GetParams_Call{Call: _e.mock.On("GetParams", ctx, peerID, height)} } @@ -198,31 +206,30 @@ func (_c *SnapshotClient_GetParams_Call) Run(run func(ctx context.Context, peerI return _c } -func (_c *SnapshotClient_GetParams_Call) Return(_a0 *promise.Promise[*statesync.ParamsResponse], _a1 error) *SnapshotClient_GetParams_Call { - _c.Call.Return(_a0, _a1) +func (_c *SnapshotClient_GetParams_Call) Return(promise1 *promise.Promise[*statesync.ParamsResponse], err error) *SnapshotClient_GetParams_Call { + _c.Call.Return(promise1, err) return _c } -func (_c *SnapshotClient_GetParams_Call) RunAndReturn(run func(context.Context, types.NodeID, uint64) (*promise.Promise[*statesync.ParamsResponse], error)) *SnapshotClient_GetParams_Call { +func (_c *SnapshotClient_GetParams_Call) RunAndReturn(run func(ctx context.Context, peerID types.NodeID, height uint64) (*promise.Promise[*statesync.ParamsResponse], error)) *SnapshotClient_GetParams_Call { _c.Call.Return(run) return _c } -// GetSnapshots provides a mock function with given fields: ctx, peerID -func (_m *SnapshotClient) GetSnapshots(ctx context.Context, peerID types.NodeID) error { - ret := _m.Called(ctx, peerID) +// GetSnapshots provides a mock function for the type SnapshotClient +func (_mock *SnapshotClient) GetSnapshots(ctx context.Context, peerID types.NodeID) error { + ret := _mock.Called(ctx, peerID) if len(ret) == 0 { panic("no return value specified for GetSnapshots") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, types.NodeID) error); ok { - r0 = rf(ctx, peerID) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.NodeID) error); ok { + r0 = returnFunc(ctx, peerID) } else { r0 = ret.Error(0) } - return r0 } @@ -232,8 +239,8 @@ type SnapshotClient_GetSnapshots_Call struct { } // GetSnapshots is a helper method to define mock.On call -// - ctx context.Context -// - peerID types.NodeID +// - ctx +// - peerID func (_e *SnapshotClient_Expecter) GetSnapshots(ctx interface{}, peerID interface{}) *SnapshotClient_GetSnapshots_Call { return &SnapshotClient_GetSnapshots_Call{Call: _e.mock.On("GetSnapshots", ctx, peerID)} } @@ -245,26 +252,12 @@ func (_c *SnapshotClient_GetSnapshots_Call) Run(run func(ctx context.Context, pe return _c } -func (_c *SnapshotClient_GetSnapshots_Call) Return(_a0 error) *SnapshotClient_GetSnapshots_Call { - _c.Call.Return(_a0) +func (_c *SnapshotClient_GetSnapshots_Call) Return(err error) *SnapshotClient_GetSnapshots_Call { + _c.Call.Return(err) return _c } -func (_c *SnapshotClient_GetSnapshots_Call) RunAndReturn(run func(context.Context, types.NodeID) error) *SnapshotClient_GetSnapshots_Call { +func (_c *SnapshotClient_GetSnapshots_Call) RunAndReturn(run func(ctx context.Context, peerID types.NodeID) error) *SnapshotClient_GetSnapshots_Call { _c.Call.Return(run) return _c } - -// NewSnapshotClient creates a new instance of SnapshotClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewSnapshotClient(t interface { - mock.TestingT - Cleanup(func()) -}) *SnapshotClient { - mock := &SnapshotClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/p2p/mocks/channel.go b/internal/p2p/mocks/channel.go index 9af5e12e5d..036ab1b716 100644 --- a/internal/p2p/mocks/channel.go +++ b/internal/p2p/mocks/channel.go @@ -1,14 +1,30 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" - p2p "github.com/dashpay/tenderdash/internal/p2p" + "github.com/dashpay/tenderdash/internal/p2p" mock "github.com/stretchr/testify/mock" ) +// NewChannel creates a new instance of Channel. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewChannel(t interface { + mock.TestingT + Cleanup(func()) +}) *Channel { + mock := &Channel{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Channel is an autogenerated mock type for the Channel type type Channel struct { mock.Mock @@ -22,21 +38,20 @@ func (_m *Channel) EXPECT() *Channel_Expecter { return &Channel_Expecter{mock: &_m.Mock} } -// Err provides a mock function with no fields -func (_m *Channel) Err() error { - ret := _m.Called() +// Err provides a mock function for the type Channel +func (_mock *Channel) Err() error { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Err") } var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() error); ok { + r0 = returnFunc() } else { r0 = ret.Error(0) } - return r0 } @@ -57,8 +72,8 @@ func (_c *Channel_Err_Call) Run(run func()) *Channel_Err_Call { return _c } -func (_c *Channel_Err_Call) Return(_a0 error) *Channel_Err_Call { - _c.Call.Return(_a0) +func (_c *Channel_Err_Call) Return(err error) *Channel_Err_Call { + _c.Call.Return(err) return _c } @@ -67,23 +82,22 @@ func (_c *Channel_Err_Call) RunAndReturn(run func() error) *Channel_Err_Call { return _c } -// Receive provides a mock function with given fields: _a0 -func (_m *Channel) Receive(_a0 context.Context) p2p.ChannelIterator { - ret := _m.Called(_a0) +// Receive provides a mock function for the type Channel +func (_mock *Channel) Receive(context1 context.Context) p2p.ChannelIterator { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for Receive") } var r0 p2p.ChannelIterator - if rf, ok := ret.Get(0).(func(context.Context) p2p.ChannelIterator); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) p2p.ChannelIterator); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(p2p.ChannelIterator) } } - return r0 } @@ -93,43 +107,42 @@ type Channel_Receive_Call struct { } // Receive is a helper method to define mock.On call -// - _a0 context.Context -func (_e *Channel_Expecter) Receive(_a0 interface{}) *Channel_Receive_Call { - return &Channel_Receive_Call{Call: _e.mock.On("Receive", _a0)} +// - context1 +func (_e *Channel_Expecter) Receive(context1 interface{}) *Channel_Receive_Call { + return &Channel_Receive_Call{Call: _e.mock.On("Receive", context1)} } -func (_c *Channel_Receive_Call) Run(run func(_a0 context.Context)) *Channel_Receive_Call { +func (_c *Channel_Receive_Call) Run(run func(context1 context.Context)) *Channel_Receive_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *Channel_Receive_Call) Return(_a0 p2p.ChannelIterator) *Channel_Receive_Call { - _c.Call.Return(_a0) +func (_c *Channel_Receive_Call) Return(channelIterator p2p.ChannelIterator) *Channel_Receive_Call { + _c.Call.Return(channelIterator) return _c } -func (_c *Channel_Receive_Call) RunAndReturn(run func(context.Context) p2p.ChannelIterator) *Channel_Receive_Call { +func (_c *Channel_Receive_Call) RunAndReturn(run func(context1 context.Context) p2p.ChannelIterator) *Channel_Receive_Call { _c.Call.Return(run) return _c } -// Send provides a mock function with given fields: _a0, _a1 -func (_m *Channel) Send(_a0 context.Context, _a1 p2p.Envelope) error { - ret := _m.Called(_a0, _a1) +// Send provides a mock function for the type Channel +func (_mock *Channel) Send(context1 context.Context, envelope p2p.Envelope) error { + ret := _mock.Called(context1, envelope) if len(ret) == 0 { panic("no return value specified for Send") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, p2p.Envelope) error); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, p2p.Envelope) error); ok { + r0 = returnFunc(context1, envelope) } else { r0 = ret.Error(0) } - return r0 } @@ -139,44 +152,43 @@ type Channel_Send_Call struct { } // Send is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 p2p.Envelope -func (_e *Channel_Expecter) Send(_a0 interface{}, _a1 interface{}) *Channel_Send_Call { - return &Channel_Send_Call{Call: _e.mock.On("Send", _a0, _a1)} +// - context1 +// - envelope +func (_e *Channel_Expecter) Send(context1 interface{}, envelope interface{}) *Channel_Send_Call { + return &Channel_Send_Call{Call: _e.mock.On("Send", context1, envelope)} } -func (_c *Channel_Send_Call) Run(run func(_a0 context.Context, _a1 p2p.Envelope)) *Channel_Send_Call { +func (_c *Channel_Send_Call) Run(run func(context1 context.Context, envelope p2p.Envelope)) *Channel_Send_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(p2p.Envelope)) }) return _c } -func (_c *Channel_Send_Call) Return(_a0 error) *Channel_Send_Call { - _c.Call.Return(_a0) +func (_c *Channel_Send_Call) Return(err error) *Channel_Send_Call { + _c.Call.Return(err) return _c } -func (_c *Channel_Send_Call) RunAndReturn(run func(context.Context, p2p.Envelope) error) *Channel_Send_Call { +func (_c *Channel_Send_Call) RunAndReturn(run func(context1 context.Context, envelope p2p.Envelope) error) *Channel_Send_Call { _c.Call.Return(run) return _c } -// SendError provides a mock function with given fields: _a0, _a1 -func (_m *Channel) SendError(_a0 context.Context, _a1 p2p.PeerError) error { - ret := _m.Called(_a0, _a1) +// SendError provides a mock function for the type Channel +func (_mock *Channel) SendError(context1 context.Context, peerError p2p.PeerError) error { + ret := _mock.Called(context1, peerError) if len(ret) == 0 { panic("no return value specified for SendError") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, p2p.PeerError) error); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, p2p.PeerError) error); ok { + r0 = returnFunc(context1, peerError) } else { r0 = ret.Error(0) } - return r0 } @@ -186,44 +198,43 @@ type Channel_SendError_Call struct { } // SendError is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 p2p.PeerError -func (_e *Channel_Expecter) SendError(_a0 interface{}, _a1 interface{}) *Channel_SendError_Call { - return &Channel_SendError_Call{Call: _e.mock.On("SendError", _a0, _a1)} +// - context1 +// - peerError +func (_e *Channel_Expecter) SendError(context1 interface{}, peerError interface{}) *Channel_SendError_Call { + return &Channel_SendError_Call{Call: _e.mock.On("SendError", context1, peerError)} } -func (_c *Channel_SendError_Call) Run(run func(_a0 context.Context, _a1 p2p.PeerError)) *Channel_SendError_Call { +func (_c *Channel_SendError_Call) Run(run func(context1 context.Context, peerError p2p.PeerError)) *Channel_SendError_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(p2p.PeerError)) }) return _c } -func (_c *Channel_SendError_Call) Return(_a0 error) *Channel_SendError_Call { - _c.Call.Return(_a0) +func (_c *Channel_SendError_Call) Return(err error) *Channel_SendError_Call { + _c.Call.Return(err) return _c } -func (_c *Channel_SendError_Call) RunAndReturn(run func(context.Context, p2p.PeerError) error) *Channel_SendError_Call { +func (_c *Channel_SendError_Call) RunAndReturn(run func(context1 context.Context, peerError p2p.PeerError) error) *Channel_SendError_Call { _c.Call.Return(run) return _c } -// String provides a mock function with no fields -func (_m *Channel) String() string { - ret := _m.Called() +// String provides a mock function for the type Channel +func (_mock *Channel) String() string { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for String") } var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(string) } - return r0 } @@ -244,8 +255,8 @@ func (_c *Channel_String_Call) Run(run func()) *Channel_String_Call { return _c } -func (_c *Channel_String_Call) Return(_a0 string) *Channel_String_Call { - _c.Call.Return(_a0) +func (_c *Channel_String_Call) Return(s string) *Channel_String_Call { + _c.Call.Return(s) return _c } @@ -253,17 +264,3 @@ func (_c *Channel_String_Call) RunAndReturn(run func() string) *Channel_String_C _c.Call.Return(run) return _c } - -// NewChannel creates a new instance of Channel. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewChannel(t interface { - mock.TestingT - Cleanup(func()) -}) *Channel { - mock := &Channel{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/p2p/mocks/connection.go b/internal/p2p/mocks/connection.go index fd1fcad61f..c170d38afe 100644 --- a/internal/p2p/mocks/connection.go +++ b/internal/p2p/mocks/connection.go @@ -1,19 +1,32 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" + "time" - crypto "github.com/dashpay/tenderdash/crypto" + "github.com/dashpay/tenderdash/crypto" + "github.com/dashpay/tenderdash/internal/p2p" + "github.com/dashpay/tenderdash/types" mock "github.com/stretchr/testify/mock" +) - p2p "github.com/dashpay/tenderdash/internal/p2p" +// NewConnection creates a new instance of Connection. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewConnection(t interface { + mock.TestingT + Cleanup(func()) +}) *Connection { + mock := &Connection{} + mock.Mock.Test(t) - time "time" + t.Cleanup(func() { mock.AssertExpectations(t) }) - types "github.com/dashpay/tenderdash/types" -) + return mock +} // Connection is an autogenerated mock type for the Connection type type Connection struct { @@ -28,21 +41,20 @@ func (_m *Connection) EXPECT() *Connection_Expecter { return &Connection_Expecter{mock: &_m.Mock} } -// Close provides a mock function with no fields -func (_m *Connection) Close() error { - ret := _m.Called() +// Close provides a mock function for the type Connection +func (_mock *Connection) Close() error { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Close") } var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() error); ok { + r0 = returnFunc() } else { r0 = ret.Error(0) } - return r0 } @@ -63,8 +75,8 @@ func (_c *Connection_Close_Call) Run(run func()) *Connection_Close_Call { return _c } -func (_c *Connection_Close_Call) Return(_a0 error) *Connection_Close_Call { - _c.Call.Return(_a0) +func (_c *Connection_Close_Call) Return(err error) *Connection_Close_Call { + _c.Call.Return(err) return _c } @@ -73,9 +85,9 @@ func (_c *Connection_Close_Call) RunAndReturn(run func() error) *Connection_Clos return _c } -// Handshake provides a mock function with given fields: _a0, _a1, _a2, _a3 -func (_m *Connection) Handshake(_a0 context.Context, _a1 time.Duration, _a2 types.NodeInfo, _a3 crypto.PrivKey) (types.NodeInfo, crypto.PubKey, error) { - ret := _m.Called(_a0, _a1, _a2, _a3) +// Handshake provides a mock function for the type Connection +func (_mock *Connection) Handshake(context1 context.Context, duration time.Duration, nodeInfo types.NodeInfo, privKey crypto.PrivKey) (types.NodeInfo, crypto.PubKey, error) { + ret := _mock.Called(context1, duration, nodeInfo, privKey) if len(ret) == 0 { panic("no return value specified for Handshake") @@ -84,29 +96,26 @@ func (_m *Connection) Handshake(_a0 context.Context, _a1 time.Duration, _a2 type var r0 types.NodeInfo var r1 crypto.PubKey var r2 error - if rf, ok := ret.Get(0).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) (types.NodeInfo, crypto.PubKey, error)); ok { - return rf(_a0, _a1, _a2, _a3) + if returnFunc, ok := ret.Get(0).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) (types.NodeInfo, crypto.PubKey, error)); ok { + return returnFunc(context1, duration, nodeInfo, privKey) } - if rf, ok := ret.Get(0).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) types.NodeInfo); ok { - r0 = rf(_a0, _a1, _a2, _a3) + if returnFunc, ok := ret.Get(0).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) types.NodeInfo); ok { + r0 = returnFunc(context1, duration, nodeInfo, privKey) } else { r0 = ret.Get(0).(types.NodeInfo) } - - if rf, ok := ret.Get(1).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) crypto.PubKey); ok { - r1 = rf(_a0, _a1, _a2, _a3) + if returnFunc, ok := ret.Get(1).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) crypto.PubKey); ok { + r1 = returnFunc(context1, duration, nodeInfo, privKey) } else { if ret.Get(1) != nil { r1 = ret.Get(1).(crypto.PubKey) } } - - if rf, ok := ret.Get(2).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) error); ok { - r2 = rf(_a0, _a1, _a2, _a3) + if returnFunc, ok := ret.Get(2).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) error); ok { + r2 = returnFunc(context1, duration, nodeInfo, privKey) } else { r2 = ret.Error(2) } - return r0, r1, r2 } @@ -116,46 +125,45 @@ type Connection_Handshake_Call struct { } // Handshake is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 time.Duration -// - _a2 types.NodeInfo -// - _a3 crypto.PrivKey -func (_e *Connection_Expecter) Handshake(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *Connection_Handshake_Call { - return &Connection_Handshake_Call{Call: _e.mock.On("Handshake", _a0, _a1, _a2, _a3)} +// - context1 +// - duration +// - nodeInfo +// - privKey +func (_e *Connection_Expecter) Handshake(context1 interface{}, duration interface{}, nodeInfo interface{}, privKey interface{}) *Connection_Handshake_Call { + return &Connection_Handshake_Call{Call: _e.mock.On("Handshake", context1, duration, nodeInfo, privKey)} } -func (_c *Connection_Handshake_Call) Run(run func(_a0 context.Context, _a1 time.Duration, _a2 types.NodeInfo, _a3 crypto.PrivKey)) *Connection_Handshake_Call { +func (_c *Connection_Handshake_Call) Run(run func(context1 context.Context, duration time.Duration, nodeInfo types.NodeInfo, privKey crypto.PrivKey)) *Connection_Handshake_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(time.Duration), args[2].(types.NodeInfo), args[3].(crypto.PrivKey)) }) return _c } -func (_c *Connection_Handshake_Call) Return(_a0 types.NodeInfo, _a1 crypto.PubKey, _a2 error) *Connection_Handshake_Call { - _c.Call.Return(_a0, _a1, _a2) +func (_c *Connection_Handshake_Call) Return(nodeInfo1 types.NodeInfo, pubKey crypto.PubKey, err error) *Connection_Handshake_Call { + _c.Call.Return(nodeInfo1, pubKey, err) return _c } -func (_c *Connection_Handshake_Call) RunAndReturn(run func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) (types.NodeInfo, crypto.PubKey, error)) *Connection_Handshake_Call { +func (_c *Connection_Handshake_Call) RunAndReturn(run func(context1 context.Context, duration time.Duration, nodeInfo types.NodeInfo, privKey crypto.PrivKey) (types.NodeInfo, crypto.PubKey, error)) *Connection_Handshake_Call { _c.Call.Return(run) return _c } -// LocalEndpoint provides a mock function with no fields -func (_m *Connection) LocalEndpoint() p2p.Endpoint { - ret := _m.Called() +// LocalEndpoint provides a mock function for the type Connection +func (_mock *Connection) LocalEndpoint() p2p.Endpoint { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for LocalEndpoint") } var r0 p2p.Endpoint - if rf, ok := ret.Get(0).(func() p2p.Endpoint); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() p2p.Endpoint); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(p2p.Endpoint) } - return r0 } @@ -176,8 +184,8 @@ func (_c *Connection_LocalEndpoint_Call) Run(run func()) *Connection_LocalEndpoi return _c } -func (_c *Connection_LocalEndpoint_Call) Return(_a0 p2p.Endpoint) *Connection_LocalEndpoint_Call { - _c.Call.Return(_a0) +func (_c *Connection_LocalEndpoint_Call) Return(endpoint p2p.Endpoint) *Connection_LocalEndpoint_Call { + _c.Call.Return(endpoint) return _c } @@ -186,9 +194,9 @@ func (_c *Connection_LocalEndpoint_Call) RunAndReturn(run func() p2p.Endpoint) * return _c } -// ReceiveMessage provides a mock function with given fields: _a0 -func (_m *Connection) ReceiveMessage(_a0 context.Context) (p2p.ChannelID, []byte, error) { - ret := _m.Called(_a0) +// ReceiveMessage provides a mock function for the type Connection +func (_mock *Connection) ReceiveMessage(context1 context.Context) (p2p.ChannelID, []byte, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for ReceiveMessage") @@ -197,29 +205,26 @@ func (_m *Connection) ReceiveMessage(_a0 context.Context) (p2p.ChannelID, []byte var r0 p2p.ChannelID var r1 []byte var r2 error - if rf, ok := ret.Get(0).(func(context.Context) (p2p.ChannelID, []byte, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (p2p.ChannelID, []byte, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) p2p.ChannelID); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) p2p.ChannelID); ok { + r0 = returnFunc(context1) } else { r0 = ret.Get(0).(p2p.ChannelID) } - - if rf, ok := ret.Get(1).(func(context.Context) []byte); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) []byte); ok { + r1 = returnFunc(context1) } else { if ret.Get(1) != nil { r1 = ret.Get(1).([]byte) } } - - if rf, ok := ret.Get(2).(func(context.Context) error); ok { - r2 = rf(_a0) + if returnFunc, ok := ret.Get(2).(func(context.Context) error); ok { + r2 = returnFunc(context1) } else { r2 = ret.Error(2) } - return r0, r1, r2 } @@ -229,43 +234,42 @@ type Connection_ReceiveMessage_Call struct { } // ReceiveMessage is a helper method to define mock.On call -// - _a0 context.Context -func (_e *Connection_Expecter) ReceiveMessage(_a0 interface{}) *Connection_ReceiveMessage_Call { - return &Connection_ReceiveMessage_Call{Call: _e.mock.On("ReceiveMessage", _a0)} +// - context1 +func (_e *Connection_Expecter) ReceiveMessage(context1 interface{}) *Connection_ReceiveMessage_Call { + return &Connection_ReceiveMessage_Call{Call: _e.mock.On("ReceiveMessage", context1)} } -func (_c *Connection_ReceiveMessage_Call) Run(run func(_a0 context.Context)) *Connection_ReceiveMessage_Call { +func (_c *Connection_ReceiveMessage_Call) Run(run func(context1 context.Context)) *Connection_ReceiveMessage_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *Connection_ReceiveMessage_Call) Return(_a0 p2p.ChannelID, _a1 []byte, _a2 error) *Connection_ReceiveMessage_Call { - _c.Call.Return(_a0, _a1, _a2) +func (_c *Connection_ReceiveMessage_Call) Return(v p2p.ChannelID, bytes []byte, err error) *Connection_ReceiveMessage_Call { + _c.Call.Return(v, bytes, err) return _c } -func (_c *Connection_ReceiveMessage_Call) RunAndReturn(run func(context.Context) (p2p.ChannelID, []byte, error)) *Connection_ReceiveMessage_Call { +func (_c *Connection_ReceiveMessage_Call) RunAndReturn(run func(context1 context.Context) (p2p.ChannelID, []byte, error)) *Connection_ReceiveMessage_Call { _c.Call.Return(run) return _c } -// RemoteEndpoint provides a mock function with no fields -func (_m *Connection) RemoteEndpoint() p2p.Endpoint { - ret := _m.Called() +// RemoteEndpoint provides a mock function for the type Connection +func (_mock *Connection) RemoteEndpoint() p2p.Endpoint { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for RemoteEndpoint") } var r0 p2p.Endpoint - if rf, ok := ret.Get(0).(func() p2p.Endpoint); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() p2p.Endpoint); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(p2p.Endpoint) } - return r0 } @@ -286,8 +290,8 @@ func (_c *Connection_RemoteEndpoint_Call) Run(run func()) *Connection_RemoteEndp return _c } -func (_c *Connection_RemoteEndpoint_Call) Return(_a0 p2p.Endpoint) *Connection_RemoteEndpoint_Call { - _c.Call.Return(_a0) +func (_c *Connection_RemoteEndpoint_Call) Return(endpoint p2p.Endpoint) *Connection_RemoteEndpoint_Call { + _c.Call.Return(endpoint) return _c } @@ -296,21 +300,20 @@ func (_c *Connection_RemoteEndpoint_Call) RunAndReturn(run func() p2p.Endpoint) return _c } -// SendMessage provides a mock function with given fields: _a0, _a1, _a2 -func (_m *Connection) SendMessage(_a0 context.Context, _a1 p2p.ChannelID, _a2 []byte) error { - ret := _m.Called(_a0, _a1, _a2) +// SendMessage provides a mock function for the type Connection +func (_mock *Connection) SendMessage(context1 context.Context, v p2p.ChannelID, bytes []byte) error { + ret := _mock.Called(context1, v, bytes) if len(ret) == 0 { panic("no return value specified for SendMessage") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, p2p.ChannelID, []byte) error); ok { - r0 = rf(_a0, _a1, _a2) + if returnFunc, ok := ret.Get(0).(func(context.Context, p2p.ChannelID, []byte) error); ok { + r0 = returnFunc(context1, v, bytes) } else { r0 = ret.Error(0) } - return r0 } @@ -320,45 +323,44 @@ type Connection_SendMessage_Call struct { } // SendMessage is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 p2p.ChannelID -// - _a2 []byte -func (_e *Connection_Expecter) SendMessage(_a0 interface{}, _a1 interface{}, _a2 interface{}) *Connection_SendMessage_Call { - return &Connection_SendMessage_Call{Call: _e.mock.On("SendMessage", _a0, _a1, _a2)} +// - context1 +// - v +// - bytes +func (_e *Connection_Expecter) SendMessage(context1 interface{}, v interface{}, bytes interface{}) *Connection_SendMessage_Call { + return &Connection_SendMessage_Call{Call: _e.mock.On("SendMessage", context1, v, bytes)} } -func (_c *Connection_SendMessage_Call) Run(run func(_a0 context.Context, _a1 p2p.ChannelID, _a2 []byte)) *Connection_SendMessage_Call { +func (_c *Connection_SendMessage_Call) Run(run func(context1 context.Context, v p2p.ChannelID, bytes []byte)) *Connection_SendMessage_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(p2p.ChannelID), args[2].([]byte)) }) return _c } -func (_c *Connection_SendMessage_Call) Return(_a0 error) *Connection_SendMessage_Call { - _c.Call.Return(_a0) +func (_c *Connection_SendMessage_Call) Return(err error) *Connection_SendMessage_Call { + _c.Call.Return(err) return _c } -func (_c *Connection_SendMessage_Call) RunAndReturn(run func(context.Context, p2p.ChannelID, []byte) error) *Connection_SendMessage_Call { +func (_c *Connection_SendMessage_Call) RunAndReturn(run func(context1 context.Context, v p2p.ChannelID, bytes []byte) error) *Connection_SendMessage_Call { _c.Call.Return(run) return _c } -// String provides a mock function with no fields -func (_m *Connection) String() string { - ret := _m.Called() +// String provides a mock function for the type Connection +func (_mock *Connection) String() string { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for String") } var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(string) } - return r0 } @@ -379,8 +381,8 @@ func (_c *Connection_String_Call) Run(run func()) *Connection_String_Call { return _c } -func (_c *Connection_String_Call) Return(_a0 string) *Connection_String_Call { - _c.Call.Return(_a0) +func (_c *Connection_String_Call) Return(s string) *Connection_String_Call { + _c.Call.Return(s) return _c } @@ -388,17 +390,3 @@ func (_c *Connection_String_Call) RunAndReturn(run func() string) *Connection_St _c.Call.Return(run) return _c } - -// NewConnection creates a new instance of Connection. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewConnection(t interface { - mock.TestingT - Cleanup(func()) -}) *Connection { - mock := &Connection{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/p2p/mocks/transport.go b/internal/p2p/mocks/transport.go index 9ad3323d8d..c556429a4a 100644 --- a/internal/p2p/mocks/transport.go +++ b/internal/p2p/mocks/transport.go @@ -1,14 +1,30 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" - p2p "github.com/dashpay/tenderdash/internal/p2p" + "github.com/dashpay/tenderdash/internal/p2p" mock "github.com/stretchr/testify/mock" ) +// NewTransport creates a new instance of Transport. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewTransport(t interface { + mock.TestingT + Cleanup(func()) +}) *Transport { + mock := &Transport{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Transport is an autogenerated mock type for the Transport type type Transport struct { mock.Mock @@ -22,9 +38,9 @@ func (_m *Transport) EXPECT() *Transport_Expecter { return &Transport_Expecter{mock: &_m.Mock} } -// Accept provides a mock function with given fields: _a0 -func (_m *Transport) Accept(_a0 context.Context) (p2p.Connection, error) { - ret := _m.Called(_a0) +// Accept provides a mock function for the type Transport +func (_mock *Transport) Accept(context1 context.Context) (p2p.Connection, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for Accept") @@ -32,23 +48,21 @@ func (_m *Transport) Accept(_a0 context.Context) (p2p.Connection, error) { var r0 p2p.Connection var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (p2p.Connection, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (p2p.Connection, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) p2p.Connection); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) p2p.Connection); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(p2p.Connection) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -58,31 +72,32 @@ type Transport_Accept_Call struct { } // Accept is a helper method to define mock.On call -// - _a0 context.Context -func (_e *Transport_Expecter) Accept(_a0 interface{}) *Transport_Accept_Call { - return &Transport_Accept_Call{Call: _e.mock.On("Accept", _a0)} +// - context1 +func (_e *Transport_Expecter) Accept(context1 interface{}) *Transport_Accept_Call { + return &Transport_Accept_Call{Call: _e.mock.On("Accept", context1)} } -func (_c *Transport_Accept_Call) Run(run func(_a0 context.Context)) *Transport_Accept_Call { +func (_c *Transport_Accept_Call) Run(run func(context1 context.Context)) *Transport_Accept_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *Transport_Accept_Call) Return(_a0 p2p.Connection, _a1 error) *Transport_Accept_Call { - _c.Call.Return(_a0, _a1) +func (_c *Transport_Accept_Call) Return(connection p2p.Connection, err error) *Transport_Accept_Call { + _c.Call.Return(connection, err) return _c } -func (_c *Transport_Accept_Call) RunAndReturn(run func(context.Context) (p2p.Connection, error)) *Transport_Accept_Call { +func (_c *Transport_Accept_Call) RunAndReturn(run func(context1 context.Context) (p2p.Connection, error)) *Transport_Accept_Call { _c.Call.Return(run) return _c } -// AddChannelDescriptors provides a mock function with given fields: _a0 -func (_m *Transport) AddChannelDescriptors(_a0 []*p2p.ChannelDescriptor) { - _m.Called(_a0) +// AddChannelDescriptors provides a mock function for the type Transport +func (_mock *Transport) AddChannelDescriptors(vs []*p2p.ChannelDescriptor) { + _mock.Called(vs) + return } // Transport_AddChannelDescriptors_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddChannelDescriptors' @@ -91,12 +106,12 @@ type Transport_AddChannelDescriptors_Call struct { } // AddChannelDescriptors is a helper method to define mock.On call -// - _a0 []*p2p.ChannelDescriptor -func (_e *Transport_Expecter) AddChannelDescriptors(_a0 interface{}) *Transport_AddChannelDescriptors_Call { - return &Transport_AddChannelDescriptors_Call{Call: _e.mock.On("AddChannelDescriptors", _a0)} +// - vs +func (_e *Transport_Expecter) AddChannelDescriptors(vs interface{}) *Transport_AddChannelDescriptors_Call { + return &Transport_AddChannelDescriptors_Call{Call: _e.mock.On("AddChannelDescriptors", vs)} } -func (_c *Transport_AddChannelDescriptors_Call) Run(run func(_a0 []*p2p.ChannelDescriptor)) *Transport_AddChannelDescriptors_Call { +func (_c *Transport_AddChannelDescriptors_Call) Run(run func(vs []*p2p.ChannelDescriptor)) *Transport_AddChannelDescriptors_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]*p2p.ChannelDescriptor)) }) @@ -108,26 +123,25 @@ func (_c *Transport_AddChannelDescriptors_Call) Return() *Transport_AddChannelDe return _c } -func (_c *Transport_AddChannelDescriptors_Call) RunAndReturn(run func([]*p2p.ChannelDescriptor)) *Transport_AddChannelDescriptors_Call { +func (_c *Transport_AddChannelDescriptors_Call) RunAndReturn(run func(vs []*p2p.ChannelDescriptor)) *Transport_AddChannelDescriptors_Call { _c.Run(run) return _c } -// Close provides a mock function with no fields -func (_m *Transport) Close() error { - ret := _m.Called() +// Close provides a mock function for the type Transport +func (_mock *Transport) Close() error { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Close") } var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() error); ok { + r0 = returnFunc() } else { r0 = ret.Error(0) } - return r0 } @@ -148,8 +162,8 @@ func (_c *Transport_Close_Call) Run(run func()) *Transport_Close_Call { return _c } -func (_c *Transport_Close_Call) Return(_a0 error) *Transport_Close_Call { - _c.Call.Return(_a0) +func (_c *Transport_Close_Call) Return(err error) *Transport_Close_Call { + _c.Call.Return(err) return _c } @@ -158,9 +172,9 @@ func (_c *Transport_Close_Call) RunAndReturn(run func() error) *Transport_Close_ return _c } -// Dial provides a mock function with given fields: _a0, _a1 -func (_m *Transport) Dial(_a0 context.Context, _a1 *p2p.Endpoint) (p2p.Connection, error) { - ret := _m.Called(_a0, _a1) +// Dial provides a mock function for the type Transport +func (_mock *Transport) Dial(context1 context.Context, endpoint *p2p.Endpoint) (p2p.Connection, error) { + ret := _mock.Called(context1, endpoint) if len(ret) == 0 { panic("no return value specified for Dial") @@ -168,23 +182,21 @@ func (_m *Transport) Dial(_a0 context.Context, _a1 *p2p.Endpoint) (p2p.Connectio var r0 p2p.Connection var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *p2p.Endpoint) (p2p.Connection, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *p2p.Endpoint) (p2p.Connection, error)); ok { + return returnFunc(context1, endpoint) } - if rf, ok := ret.Get(0).(func(context.Context, *p2p.Endpoint) p2p.Connection); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *p2p.Endpoint) p2p.Connection); ok { + r0 = returnFunc(context1, endpoint) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(p2p.Connection) } } - - if rf, ok := ret.Get(1).(func(context.Context, *p2p.Endpoint) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *p2p.Endpoint) error); ok { + r1 = returnFunc(context1, endpoint) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -194,32 +206,32 @@ type Transport_Dial_Call struct { } // Dial is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *p2p.Endpoint -func (_e *Transport_Expecter) Dial(_a0 interface{}, _a1 interface{}) *Transport_Dial_Call { - return &Transport_Dial_Call{Call: _e.mock.On("Dial", _a0, _a1)} +// - context1 +// - endpoint +func (_e *Transport_Expecter) Dial(context1 interface{}, endpoint interface{}) *Transport_Dial_Call { + return &Transport_Dial_Call{Call: _e.mock.On("Dial", context1, endpoint)} } -func (_c *Transport_Dial_Call) Run(run func(_a0 context.Context, _a1 *p2p.Endpoint)) *Transport_Dial_Call { +func (_c *Transport_Dial_Call) Run(run func(context1 context.Context, endpoint *p2p.Endpoint)) *Transport_Dial_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*p2p.Endpoint)) }) return _c } -func (_c *Transport_Dial_Call) Return(_a0 p2p.Connection, _a1 error) *Transport_Dial_Call { - _c.Call.Return(_a0, _a1) +func (_c *Transport_Dial_Call) Return(connection p2p.Connection, err error) *Transport_Dial_Call { + _c.Call.Return(connection, err) return _c } -func (_c *Transport_Dial_Call) RunAndReturn(run func(context.Context, *p2p.Endpoint) (p2p.Connection, error)) *Transport_Dial_Call { +func (_c *Transport_Dial_Call) RunAndReturn(run func(context1 context.Context, endpoint *p2p.Endpoint) (p2p.Connection, error)) *Transport_Dial_Call { _c.Call.Return(run) return _c } -// Endpoint provides a mock function with no fields -func (_m *Transport) Endpoint() (*p2p.Endpoint, error) { - ret := _m.Called() +// Endpoint provides a mock function for the type Transport +func (_mock *Transport) Endpoint() (*p2p.Endpoint, error) { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Endpoint") @@ -227,23 +239,21 @@ func (_m *Transport) Endpoint() (*p2p.Endpoint, error) { var r0 *p2p.Endpoint var r1 error - if rf, ok := ret.Get(0).(func() (*p2p.Endpoint, error)); ok { - return rf() + if returnFunc, ok := ret.Get(0).(func() (*p2p.Endpoint, error)); ok { + return returnFunc() } - if rf, ok := ret.Get(0).(func() *p2p.Endpoint); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() *p2p.Endpoint); ok { + r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*p2p.Endpoint) } } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() } else { r1 = ret.Error(1) } - return r0, r1 } @@ -264,8 +274,8 @@ func (_c *Transport_Endpoint_Call) Run(run func()) *Transport_Endpoint_Call { return _c } -func (_c *Transport_Endpoint_Call) Return(_a0 *p2p.Endpoint, _a1 error) *Transport_Endpoint_Call { - _c.Call.Return(_a0, _a1) +func (_c *Transport_Endpoint_Call) Return(endpoint *p2p.Endpoint, err error) *Transport_Endpoint_Call { + _c.Call.Return(endpoint, err) return _c } @@ -274,21 +284,20 @@ func (_c *Transport_Endpoint_Call) RunAndReturn(run func() (*p2p.Endpoint, error return _c } -// Listen provides a mock function with given fields: _a0 -func (_m *Transport) Listen(_a0 *p2p.Endpoint) error { - ret := _m.Called(_a0) +// Listen provides a mock function for the type Transport +func (_mock *Transport) Listen(endpoint *p2p.Endpoint) error { + ret := _mock.Called(endpoint) if len(ret) == 0 { panic("no return value specified for Listen") } var r0 error - if rf, ok := ret.Get(0).(func(*p2p.Endpoint) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(*p2p.Endpoint) error); ok { + r0 = returnFunc(endpoint) } else { r0 = ret.Error(0) } - return r0 } @@ -298,45 +307,44 @@ type Transport_Listen_Call struct { } // Listen is a helper method to define mock.On call -// - _a0 *p2p.Endpoint -func (_e *Transport_Expecter) Listen(_a0 interface{}) *Transport_Listen_Call { - return &Transport_Listen_Call{Call: _e.mock.On("Listen", _a0)} +// - endpoint +func (_e *Transport_Expecter) Listen(endpoint interface{}) *Transport_Listen_Call { + return &Transport_Listen_Call{Call: _e.mock.On("Listen", endpoint)} } -func (_c *Transport_Listen_Call) Run(run func(_a0 *p2p.Endpoint)) *Transport_Listen_Call { +func (_c *Transport_Listen_Call) Run(run func(endpoint *p2p.Endpoint)) *Transport_Listen_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(*p2p.Endpoint)) }) return _c } -func (_c *Transport_Listen_Call) Return(_a0 error) *Transport_Listen_Call { - _c.Call.Return(_a0) +func (_c *Transport_Listen_Call) Return(err error) *Transport_Listen_Call { + _c.Call.Return(err) return _c } -func (_c *Transport_Listen_Call) RunAndReturn(run func(*p2p.Endpoint) error) *Transport_Listen_Call { +func (_c *Transport_Listen_Call) RunAndReturn(run func(endpoint *p2p.Endpoint) error) *Transport_Listen_Call { _c.Call.Return(run) return _c } -// Protocols provides a mock function with no fields -func (_m *Transport) Protocols() []p2p.Protocol { - ret := _m.Called() +// Protocols provides a mock function for the type Transport +func (_mock *Transport) Protocols() []p2p.Protocol { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Protocols") } var r0 []p2p.Protocol - if rf, ok := ret.Get(0).(func() []p2p.Protocol); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() []p2p.Protocol); ok { + r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]p2p.Protocol) } } - return r0 } @@ -357,8 +365,8 @@ func (_c *Transport_Protocols_Call) Run(run func()) *Transport_Protocols_Call { return _c } -func (_c *Transport_Protocols_Call) Return(_a0 []p2p.Protocol) *Transport_Protocols_Call { - _c.Call.Return(_a0) +func (_c *Transport_Protocols_Call) Return(protocols []p2p.Protocol) *Transport_Protocols_Call { + _c.Call.Return(protocols) return _c } @@ -367,21 +375,20 @@ func (_c *Transport_Protocols_Call) RunAndReturn(run func() []p2p.Protocol) *Tra return _c } -// String provides a mock function with no fields -func (_m *Transport) String() string { - ret := _m.Called() +// String provides a mock function for the type Transport +func (_mock *Transport) String() string { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for String") } var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(string) } - return r0 } @@ -402,8 +409,8 @@ func (_c *Transport_String_Call) Run(run func()) *Transport_String_Call { return _c } -func (_c *Transport_String_Call) Return(_a0 string) *Transport_String_Call { - _c.Call.Return(_a0) +func (_c *Transport_String_Call) Return(s string) *Transport_String_Call { + _c.Call.Return(s) return _c } @@ -411,17 +418,3 @@ func (_c *Transport_String_Call) RunAndReturn(run func() string) *Transport_Stri _c.Call.Return(run) return _c } - -// NewTransport creates a new instance of Transport. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewTransport(t interface { - mock.TestingT - Cleanup(func()) -}) *Transport { - mock := &Transport{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/state/indexer/mocks/eventsink.go b/internal/state/indexer/mocks/eventsink.go index 1d9d86ec3b..cc2451360d 100644 --- a/internal/state/indexer/mocks/eventsink.go +++ b/internal/state/indexer/mocks/eventsink.go @@ -1,19 +1,32 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" - indexer "github.com/dashpay/tenderdash/internal/state/indexer" + "github.com/dashpay/tenderdash/abci/types" + "github.com/dashpay/tenderdash/internal/pubsub/query" + "github.com/dashpay/tenderdash/internal/state/indexer" + types0 "github.com/dashpay/tenderdash/types" mock "github.com/stretchr/testify/mock" +) - query "github.com/dashpay/tenderdash/internal/pubsub/query" +// NewEventSink creates a new instance of EventSink. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewEventSink(t interface { + mock.TestingT + Cleanup(func()) +}) *EventSink { + mock := &EventSink{} + mock.Mock.Test(t) - tenderdashtypes "github.com/dashpay/tenderdash/types" + t.Cleanup(func() { mock.AssertExpectations(t) }) - types "github.com/dashpay/tenderdash/abci/types" -) + return mock +} // EventSink is an autogenerated mock type for the EventSink type type EventSink struct { @@ -28,9 +41,9 @@ func (_m *EventSink) EXPECT() *EventSink_Expecter { return &EventSink_Expecter{mock: &_m.Mock} } -// GetTxByHash provides a mock function with given fields: _a0 -func (_m *EventSink) GetTxByHash(_a0 []byte) (*types.TxResult, error) { - ret := _m.Called(_a0) +// GetTxByHash provides a mock function for the type EventSink +func (_mock *EventSink) GetTxByHash(bytes []byte) (*types.TxResult, error) { + ret := _mock.Called(bytes) if len(ret) == 0 { panic("no return value specified for GetTxByHash") @@ -38,23 +51,21 @@ func (_m *EventSink) GetTxByHash(_a0 []byte) (*types.TxResult, error) { var r0 *types.TxResult var r1 error - if rf, ok := ret.Get(0).(func([]byte) (*types.TxResult, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func([]byte) (*types.TxResult, error)); ok { + return returnFunc(bytes) } - if rf, ok := ret.Get(0).(func([]byte) *types.TxResult); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func([]byte) *types.TxResult); ok { + r0 = returnFunc(bytes) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.TxResult) } } - - if rf, ok := ret.Get(1).(func([]byte) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func([]byte) error); ok { + r1 = returnFunc(bytes) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -64,31 +75,31 @@ type EventSink_GetTxByHash_Call struct { } // GetTxByHash is a helper method to define mock.On call -// - _a0 []byte -func (_e *EventSink_Expecter) GetTxByHash(_a0 interface{}) *EventSink_GetTxByHash_Call { - return &EventSink_GetTxByHash_Call{Call: _e.mock.On("GetTxByHash", _a0)} +// - bytes +func (_e *EventSink_Expecter) GetTxByHash(bytes interface{}) *EventSink_GetTxByHash_Call { + return &EventSink_GetTxByHash_Call{Call: _e.mock.On("GetTxByHash", bytes)} } -func (_c *EventSink_GetTxByHash_Call) Run(run func(_a0 []byte)) *EventSink_GetTxByHash_Call { +func (_c *EventSink_GetTxByHash_Call) Run(run func(bytes []byte)) *EventSink_GetTxByHash_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]byte)) }) return _c } -func (_c *EventSink_GetTxByHash_Call) Return(_a0 *types.TxResult, _a1 error) *EventSink_GetTxByHash_Call { - _c.Call.Return(_a0, _a1) +func (_c *EventSink_GetTxByHash_Call) Return(txResult *types.TxResult, err error) *EventSink_GetTxByHash_Call { + _c.Call.Return(txResult, err) return _c } -func (_c *EventSink_GetTxByHash_Call) RunAndReturn(run func([]byte) (*types.TxResult, error)) *EventSink_GetTxByHash_Call { +func (_c *EventSink_GetTxByHash_Call) RunAndReturn(run func(bytes []byte) (*types.TxResult, error)) *EventSink_GetTxByHash_Call { _c.Call.Return(run) return _c } -// HasBlock provides a mock function with given fields: _a0 -func (_m *EventSink) HasBlock(_a0 int64) (bool, error) { - ret := _m.Called(_a0) +// HasBlock provides a mock function for the type EventSink +func (_mock *EventSink) HasBlock(n int64) (bool, error) { + ret := _mock.Called(n) if len(ret) == 0 { panic("no return value specified for HasBlock") @@ -96,21 +107,19 @@ func (_m *EventSink) HasBlock(_a0 int64) (bool, error) { var r0 bool var r1 error - if rf, ok := ret.Get(0).(func(int64) (bool, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(int64) (bool, error)); ok { + return returnFunc(n) } - if rf, ok := ret.Get(0).(func(int64) bool); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(int64) bool); ok { + r0 = returnFunc(n) } else { r0 = ret.Get(0).(bool) } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(n) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -120,43 +129,42 @@ type EventSink_HasBlock_Call struct { } // HasBlock is a helper method to define mock.On call -// - _a0 int64 -func (_e *EventSink_Expecter) HasBlock(_a0 interface{}) *EventSink_HasBlock_Call { - return &EventSink_HasBlock_Call{Call: _e.mock.On("HasBlock", _a0)} +// - n +func (_e *EventSink_Expecter) HasBlock(n interface{}) *EventSink_HasBlock_Call { + return &EventSink_HasBlock_Call{Call: _e.mock.On("HasBlock", n)} } -func (_c *EventSink_HasBlock_Call) Run(run func(_a0 int64)) *EventSink_HasBlock_Call { +func (_c *EventSink_HasBlock_Call) Run(run func(n int64)) *EventSink_HasBlock_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(int64)) }) return _c } -func (_c *EventSink_HasBlock_Call) Return(_a0 bool, _a1 error) *EventSink_HasBlock_Call { - _c.Call.Return(_a0, _a1) +func (_c *EventSink_HasBlock_Call) Return(b bool, err error) *EventSink_HasBlock_Call { + _c.Call.Return(b, err) return _c } -func (_c *EventSink_HasBlock_Call) RunAndReturn(run func(int64) (bool, error)) *EventSink_HasBlock_Call { +func (_c *EventSink_HasBlock_Call) RunAndReturn(run func(n int64) (bool, error)) *EventSink_HasBlock_Call { _c.Call.Return(run) return _c } -// IndexBlockEvents provides a mock function with given fields: _a0 -func (_m *EventSink) IndexBlockEvents(_a0 tenderdashtypes.EventDataNewBlockHeader) error { - ret := _m.Called(_a0) +// IndexBlockEvents provides a mock function for the type EventSink +func (_mock *EventSink) IndexBlockEvents(eventDataNewBlockHeader types0.EventDataNewBlockHeader) error { + ret := _mock.Called(eventDataNewBlockHeader) if len(ret) == 0 { panic("no return value specified for IndexBlockEvents") } var r0 error - if rf, ok := ret.Get(0).(func(tenderdashtypes.EventDataNewBlockHeader) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(types0.EventDataNewBlockHeader) error); ok { + r0 = returnFunc(eventDataNewBlockHeader) } else { r0 = ret.Error(0) } - return r0 } @@ -166,43 +174,42 @@ type EventSink_IndexBlockEvents_Call struct { } // IndexBlockEvents is a helper method to define mock.On call -// - _a0 tenderdashtypes.EventDataNewBlockHeader -func (_e *EventSink_Expecter) IndexBlockEvents(_a0 interface{}) *EventSink_IndexBlockEvents_Call { - return &EventSink_IndexBlockEvents_Call{Call: _e.mock.On("IndexBlockEvents", _a0)} +// - eventDataNewBlockHeader +func (_e *EventSink_Expecter) IndexBlockEvents(eventDataNewBlockHeader interface{}) *EventSink_IndexBlockEvents_Call { + return &EventSink_IndexBlockEvents_Call{Call: _e.mock.On("IndexBlockEvents", eventDataNewBlockHeader)} } -func (_c *EventSink_IndexBlockEvents_Call) Run(run func(_a0 tenderdashtypes.EventDataNewBlockHeader)) *EventSink_IndexBlockEvents_Call { +func (_c *EventSink_IndexBlockEvents_Call) Run(run func(eventDataNewBlockHeader types0.EventDataNewBlockHeader)) *EventSink_IndexBlockEvents_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(tenderdashtypes.EventDataNewBlockHeader)) + run(args[0].(types0.EventDataNewBlockHeader)) }) return _c } -func (_c *EventSink_IndexBlockEvents_Call) Return(_a0 error) *EventSink_IndexBlockEvents_Call { - _c.Call.Return(_a0) +func (_c *EventSink_IndexBlockEvents_Call) Return(err error) *EventSink_IndexBlockEvents_Call { + _c.Call.Return(err) return _c } -func (_c *EventSink_IndexBlockEvents_Call) RunAndReturn(run func(tenderdashtypes.EventDataNewBlockHeader) error) *EventSink_IndexBlockEvents_Call { +func (_c *EventSink_IndexBlockEvents_Call) RunAndReturn(run func(eventDataNewBlockHeader types0.EventDataNewBlockHeader) error) *EventSink_IndexBlockEvents_Call { _c.Call.Return(run) return _c } -// IndexTxEvents provides a mock function with given fields: _a0 -func (_m *EventSink) IndexTxEvents(_a0 []*types.TxResult) error { - ret := _m.Called(_a0) +// IndexTxEvents provides a mock function for the type EventSink +func (_mock *EventSink) IndexTxEvents(txResults []*types.TxResult) error { + ret := _mock.Called(txResults) if len(ret) == 0 { panic("no return value specified for IndexTxEvents") } var r0 error - if rf, ok := ret.Get(0).(func([]*types.TxResult) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func([]*types.TxResult) error); ok { + r0 = returnFunc(txResults) } else { r0 = ret.Error(0) } - return r0 } @@ -212,31 +219,31 @@ type EventSink_IndexTxEvents_Call struct { } // IndexTxEvents is a helper method to define mock.On call -// - _a0 []*types.TxResult -func (_e *EventSink_Expecter) IndexTxEvents(_a0 interface{}) *EventSink_IndexTxEvents_Call { - return &EventSink_IndexTxEvents_Call{Call: _e.mock.On("IndexTxEvents", _a0)} +// - txResults +func (_e *EventSink_Expecter) IndexTxEvents(txResults interface{}) *EventSink_IndexTxEvents_Call { + return &EventSink_IndexTxEvents_Call{Call: _e.mock.On("IndexTxEvents", txResults)} } -func (_c *EventSink_IndexTxEvents_Call) Run(run func(_a0 []*types.TxResult)) *EventSink_IndexTxEvents_Call { +func (_c *EventSink_IndexTxEvents_Call) Run(run func(txResults []*types.TxResult)) *EventSink_IndexTxEvents_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].([]*types.TxResult)) }) return _c } -func (_c *EventSink_IndexTxEvents_Call) Return(_a0 error) *EventSink_IndexTxEvents_Call { - _c.Call.Return(_a0) +func (_c *EventSink_IndexTxEvents_Call) Return(err error) *EventSink_IndexTxEvents_Call { + _c.Call.Return(err) return _c } -func (_c *EventSink_IndexTxEvents_Call) RunAndReturn(run func([]*types.TxResult) error) *EventSink_IndexTxEvents_Call { +func (_c *EventSink_IndexTxEvents_Call) RunAndReturn(run func(txResults []*types.TxResult) error) *EventSink_IndexTxEvents_Call { _c.Call.Return(run) return _c } -// SearchBlockEvents provides a mock function with given fields: _a0, _a1 -func (_m *EventSink) SearchBlockEvents(_a0 context.Context, _a1 *query.Query) ([]int64, error) { - ret := _m.Called(_a0, _a1) +// SearchBlockEvents provides a mock function for the type EventSink +func (_mock *EventSink) SearchBlockEvents(context1 context.Context, query1 *query.Query) ([]int64, error) { + ret := _mock.Called(context1, query1) if len(ret) == 0 { panic("no return value specified for SearchBlockEvents") @@ -244,23 +251,21 @@ func (_m *EventSink) SearchBlockEvents(_a0 context.Context, _a1 *query.Query) ([ var r0 []int64 var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *query.Query) ([]int64, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *query.Query) ([]int64, error)); ok { + return returnFunc(context1, query1) } - if rf, ok := ret.Get(0).(func(context.Context, *query.Query) []int64); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *query.Query) []int64); ok { + r0 = returnFunc(context1, query1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]int64) } } - - if rf, ok := ret.Get(1).(func(context.Context, *query.Query) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *query.Query) error); ok { + r1 = returnFunc(context1, query1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -270,32 +275,32 @@ type EventSink_SearchBlockEvents_Call struct { } // SearchBlockEvents is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *query.Query -func (_e *EventSink_Expecter) SearchBlockEvents(_a0 interface{}, _a1 interface{}) *EventSink_SearchBlockEvents_Call { - return &EventSink_SearchBlockEvents_Call{Call: _e.mock.On("SearchBlockEvents", _a0, _a1)} +// - context1 +// - query1 +func (_e *EventSink_Expecter) SearchBlockEvents(context1 interface{}, query1 interface{}) *EventSink_SearchBlockEvents_Call { + return &EventSink_SearchBlockEvents_Call{Call: _e.mock.On("SearchBlockEvents", context1, query1)} } -func (_c *EventSink_SearchBlockEvents_Call) Run(run func(_a0 context.Context, _a1 *query.Query)) *EventSink_SearchBlockEvents_Call { +func (_c *EventSink_SearchBlockEvents_Call) Run(run func(context1 context.Context, query1 *query.Query)) *EventSink_SearchBlockEvents_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*query.Query)) }) return _c } -func (_c *EventSink_SearchBlockEvents_Call) Return(_a0 []int64, _a1 error) *EventSink_SearchBlockEvents_Call { - _c.Call.Return(_a0, _a1) +func (_c *EventSink_SearchBlockEvents_Call) Return(int64s []int64, err error) *EventSink_SearchBlockEvents_Call { + _c.Call.Return(int64s, err) return _c } -func (_c *EventSink_SearchBlockEvents_Call) RunAndReturn(run func(context.Context, *query.Query) ([]int64, error)) *EventSink_SearchBlockEvents_Call { +func (_c *EventSink_SearchBlockEvents_Call) RunAndReturn(run func(context1 context.Context, query1 *query.Query) ([]int64, error)) *EventSink_SearchBlockEvents_Call { _c.Call.Return(run) return _c } -// SearchTxEvents provides a mock function with given fields: _a0, _a1 -func (_m *EventSink) SearchTxEvents(_a0 context.Context, _a1 *query.Query) ([]*types.TxResult, error) { - ret := _m.Called(_a0, _a1) +// SearchTxEvents provides a mock function for the type EventSink +func (_mock *EventSink) SearchTxEvents(context1 context.Context, query1 *query.Query) ([]*types.TxResult, error) { + ret := _mock.Called(context1, query1) if len(ret) == 0 { panic("no return value specified for SearchTxEvents") @@ -303,23 +308,21 @@ func (_m *EventSink) SearchTxEvents(_a0 context.Context, _a1 *query.Query) ([]*t var r0 []*types.TxResult var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *query.Query) ([]*types.TxResult, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *query.Query) ([]*types.TxResult, error)); ok { + return returnFunc(context1, query1) } - if rf, ok := ret.Get(0).(func(context.Context, *query.Query) []*types.TxResult); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, *query.Query) []*types.TxResult); ok { + r0 = returnFunc(context1, query1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]*types.TxResult) } } - - if rf, ok := ret.Get(1).(func(context.Context, *query.Query) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, *query.Query) error); ok { + r1 = returnFunc(context1, query1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -329,44 +332,43 @@ type EventSink_SearchTxEvents_Call struct { } // SearchTxEvents is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *query.Query -func (_e *EventSink_Expecter) SearchTxEvents(_a0 interface{}, _a1 interface{}) *EventSink_SearchTxEvents_Call { - return &EventSink_SearchTxEvents_Call{Call: _e.mock.On("SearchTxEvents", _a0, _a1)} +// - context1 +// - query1 +func (_e *EventSink_Expecter) SearchTxEvents(context1 interface{}, query1 interface{}) *EventSink_SearchTxEvents_Call { + return &EventSink_SearchTxEvents_Call{Call: _e.mock.On("SearchTxEvents", context1, query1)} } -func (_c *EventSink_SearchTxEvents_Call) Run(run func(_a0 context.Context, _a1 *query.Query)) *EventSink_SearchTxEvents_Call { +func (_c *EventSink_SearchTxEvents_Call) Run(run func(context1 context.Context, query1 *query.Query)) *EventSink_SearchTxEvents_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*query.Query)) }) return _c } -func (_c *EventSink_SearchTxEvents_Call) Return(_a0 []*types.TxResult, _a1 error) *EventSink_SearchTxEvents_Call { - _c.Call.Return(_a0, _a1) +func (_c *EventSink_SearchTxEvents_Call) Return(txResults []*types.TxResult, err error) *EventSink_SearchTxEvents_Call { + _c.Call.Return(txResults, err) return _c } -func (_c *EventSink_SearchTxEvents_Call) RunAndReturn(run func(context.Context, *query.Query) ([]*types.TxResult, error)) *EventSink_SearchTxEvents_Call { +func (_c *EventSink_SearchTxEvents_Call) RunAndReturn(run func(context1 context.Context, query1 *query.Query) ([]*types.TxResult, error)) *EventSink_SearchTxEvents_Call { _c.Call.Return(run) return _c } -// Stop provides a mock function with no fields -func (_m *EventSink) Stop() error { - ret := _m.Called() +// Stop provides a mock function for the type EventSink +func (_mock *EventSink) Stop() error { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Stop") } var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() error); ok { + r0 = returnFunc() } else { r0 = ret.Error(0) } - return r0 } @@ -387,8 +389,8 @@ func (_c *EventSink_Stop_Call) Run(run func()) *EventSink_Stop_Call { return _c } -func (_c *EventSink_Stop_Call) Return(_a0 error) *EventSink_Stop_Call { - _c.Call.Return(_a0) +func (_c *EventSink_Stop_Call) Return(err error) *EventSink_Stop_Call { + _c.Call.Return(err) return _c } @@ -397,21 +399,20 @@ func (_c *EventSink_Stop_Call) RunAndReturn(run func() error) *EventSink_Stop_Ca return _c } -// Type provides a mock function with no fields -func (_m *EventSink) Type() indexer.EventSinkType { - ret := _m.Called() +// Type provides a mock function for the type EventSink +func (_mock *EventSink) Type() indexer.EventSinkType { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Type") } var r0 indexer.EventSinkType - if rf, ok := ret.Get(0).(func() indexer.EventSinkType); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() indexer.EventSinkType); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(indexer.EventSinkType) } - return r0 } @@ -432,8 +433,8 @@ func (_c *EventSink_Type_Call) Run(run func()) *EventSink_Type_Call { return _c } -func (_c *EventSink_Type_Call) Return(_a0 indexer.EventSinkType) *EventSink_Type_Call { - _c.Call.Return(_a0) +func (_c *EventSink_Type_Call) Return(eventSinkType indexer.EventSinkType) *EventSink_Type_Call { + _c.Call.Return(eventSinkType) return _c } @@ -441,17 +442,3 @@ func (_c *EventSink_Type_Call) RunAndReturn(run func() indexer.EventSinkType) *E _c.Call.Return(run) return _c } - -// NewEventSink creates a new instance of EventSink. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewEventSink(t interface { - mock.TestingT - Cleanup(func()) -}) *EventSink { - mock := &EventSink{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/state/mocks/blockstore.go b/internal/state/mocks/blockstore.go index 388e81e133..8c4b09fd19 100644 --- a/internal/state/mocks/blockstore.go +++ b/internal/state/mocks/blockstore.go @@ -1,13 +1,28 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( + "github.com/dashpay/tenderdash/types" mock "github.com/stretchr/testify/mock" - - types "github.com/dashpay/tenderdash/types" ) +// NewBlockStore creates a new instance of BlockStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBlockStore(t interface { + mock.TestingT + Cleanup(func()) +}) *BlockStore { + mock := &BlockStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // BlockStore is an autogenerated mock type for the BlockStore type type BlockStore struct { mock.Mock @@ -21,21 +36,20 @@ func (_m *BlockStore) EXPECT() *BlockStore_Expecter { return &BlockStore_Expecter{mock: &_m.Mock} } -// Base provides a mock function with no fields -func (_m *BlockStore) Base() int64 { - ret := _m.Called() +// Base provides a mock function for the type BlockStore +func (_mock *BlockStore) Base() int64 { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Base") } var r0 int64 - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() int64); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(int64) } - return r0 } @@ -56,8 +70,8 @@ func (_c *BlockStore_Base_Call) Run(run func()) *BlockStore_Base_Call { return _c } -func (_c *BlockStore_Base_Call) Return(_a0 int64) *BlockStore_Base_Call { - _c.Call.Return(_a0) +func (_c *BlockStore_Base_Call) Return(n int64) *BlockStore_Base_Call { + _c.Call.Return(n) return _c } @@ -66,21 +80,20 @@ func (_c *BlockStore_Base_Call) RunAndReturn(run func() int64) *BlockStore_Base_ return _c } -// CoreChainLockedHeight provides a mock function with no fields -func (_m *BlockStore) CoreChainLockedHeight() uint32 { - ret := _m.Called() +// CoreChainLockedHeight provides a mock function for the type BlockStore +func (_mock *BlockStore) CoreChainLockedHeight() uint32 { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for CoreChainLockedHeight") } var r0 uint32 - if rf, ok := ret.Get(0).(func() uint32); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() uint32); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(uint32) } - return r0 } @@ -101,8 +114,8 @@ func (_c *BlockStore_CoreChainLockedHeight_Call) Run(run func()) *BlockStore_Cor return _c } -func (_c *BlockStore_CoreChainLockedHeight_Call) Return(_a0 uint32) *BlockStore_CoreChainLockedHeight_Call { - _c.Call.Return(_a0) +func (_c *BlockStore_CoreChainLockedHeight_Call) Return(v uint32) *BlockStore_CoreChainLockedHeight_Call { + _c.Call.Return(v) return _c } @@ -111,21 +124,20 @@ func (_c *BlockStore_CoreChainLockedHeight_Call) RunAndReturn(run func() uint32) return _c } -// Height provides a mock function with no fields -func (_m *BlockStore) Height() int64 { - ret := _m.Called() +// Height provides a mock function for the type BlockStore +func (_mock *BlockStore) Height() int64 { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Height") } var r0 int64 - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() int64); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(int64) } - return r0 } @@ -146,8 +158,8 @@ func (_c *BlockStore_Height_Call) Run(run func()) *BlockStore_Height_Call { return _c } -func (_c *BlockStore_Height_Call) Return(_a0 int64) *BlockStore_Height_Call { - _c.Call.Return(_a0) +func (_c *BlockStore_Height_Call) Return(n int64) *BlockStore_Height_Call { + _c.Call.Return(n) return _c } @@ -156,23 +168,22 @@ func (_c *BlockStore_Height_Call) RunAndReturn(run func() int64) *BlockStore_Hei return _c } -// LoadBaseMeta provides a mock function with no fields -func (_m *BlockStore) LoadBaseMeta() *types.BlockMeta { - ret := _m.Called() +// LoadBaseMeta provides a mock function for the type BlockStore +func (_mock *BlockStore) LoadBaseMeta() *types.BlockMeta { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for LoadBaseMeta") } var r0 *types.BlockMeta - if rf, ok := ret.Get(0).(func() *types.BlockMeta); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() *types.BlockMeta); ok { + r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.BlockMeta) } } - return r0 } @@ -193,8 +204,8 @@ func (_c *BlockStore_LoadBaseMeta_Call) Run(run func()) *BlockStore_LoadBaseMeta return _c } -func (_c *BlockStore_LoadBaseMeta_Call) Return(_a0 *types.BlockMeta) *BlockStore_LoadBaseMeta_Call { - _c.Call.Return(_a0) +func (_c *BlockStore_LoadBaseMeta_Call) Return(blockMeta *types.BlockMeta) *BlockStore_LoadBaseMeta_Call { + _c.Call.Return(blockMeta) return _c } @@ -203,23 +214,22 @@ func (_c *BlockStore_LoadBaseMeta_Call) RunAndReturn(run func() *types.BlockMeta return _c } -// LoadBlock provides a mock function with given fields: height -func (_m *BlockStore) LoadBlock(height int64) *types.Block { - ret := _m.Called(height) +// LoadBlock provides a mock function for the type BlockStore +func (_mock *BlockStore) LoadBlock(height int64) *types.Block { + ret := _mock.Called(height) if len(ret) == 0 { panic("no return value specified for LoadBlock") } var r0 *types.Block - if rf, ok := ret.Get(0).(func(int64) *types.Block); ok { - r0 = rf(height) + if returnFunc, ok := ret.Get(0).(func(int64) *types.Block); ok { + r0 = returnFunc(height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.Block) } } - return r0 } @@ -229,7 +239,7 @@ type BlockStore_LoadBlock_Call struct { } // LoadBlock is a helper method to define mock.On call -// - height int64 +// - height func (_e *BlockStore_Expecter) LoadBlock(height interface{}) *BlockStore_LoadBlock_Call { return &BlockStore_LoadBlock_Call{Call: _e.mock.On("LoadBlock", height)} } @@ -241,33 +251,32 @@ func (_c *BlockStore_LoadBlock_Call) Run(run func(height int64)) *BlockStore_Loa return _c } -func (_c *BlockStore_LoadBlock_Call) Return(_a0 *types.Block) *BlockStore_LoadBlock_Call { - _c.Call.Return(_a0) +func (_c *BlockStore_LoadBlock_Call) Return(block *types.Block) *BlockStore_LoadBlock_Call { + _c.Call.Return(block) return _c } -func (_c *BlockStore_LoadBlock_Call) RunAndReturn(run func(int64) *types.Block) *BlockStore_LoadBlock_Call { +func (_c *BlockStore_LoadBlock_Call) RunAndReturn(run func(height int64) *types.Block) *BlockStore_LoadBlock_Call { _c.Call.Return(run) return _c } -// LoadBlockByHash provides a mock function with given fields: hash -func (_m *BlockStore) LoadBlockByHash(hash []byte) *types.Block { - ret := _m.Called(hash) +// LoadBlockByHash provides a mock function for the type BlockStore +func (_mock *BlockStore) LoadBlockByHash(hash []byte) *types.Block { + ret := _mock.Called(hash) if len(ret) == 0 { panic("no return value specified for LoadBlockByHash") } var r0 *types.Block - if rf, ok := ret.Get(0).(func([]byte) *types.Block); ok { - r0 = rf(hash) + if returnFunc, ok := ret.Get(0).(func([]byte) *types.Block); ok { + r0 = returnFunc(hash) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.Block) } } - return r0 } @@ -277,7 +286,7 @@ type BlockStore_LoadBlockByHash_Call struct { } // LoadBlockByHash is a helper method to define mock.On call -// - hash []byte +// - hash func (_e *BlockStore_Expecter) LoadBlockByHash(hash interface{}) *BlockStore_LoadBlockByHash_Call { return &BlockStore_LoadBlockByHash_Call{Call: _e.mock.On("LoadBlockByHash", hash)} } @@ -289,33 +298,32 @@ func (_c *BlockStore_LoadBlockByHash_Call) Run(run func(hash []byte)) *BlockStor return _c } -func (_c *BlockStore_LoadBlockByHash_Call) Return(_a0 *types.Block) *BlockStore_LoadBlockByHash_Call { - _c.Call.Return(_a0) +func (_c *BlockStore_LoadBlockByHash_Call) Return(block *types.Block) *BlockStore_LoadBlockByHash_Call { + _c.Call.Return(block) return _c } -func (_c *BlockStore_LoadBlockByHash_Call) RunAndReturn(run func([]byte) *types.Block) *BlockStore_LoadBlockByHash_Call { +func (_c *BlockStore_LoadBlockByHash_Call) RunAndReturn(run func(hash []byte) *types.Block) *BlockStore_LoadBlockByHash_Call { _c.Call.Return(run) return _c } -// LoadBlockCommit provides a mock function with given fields: height -func (_m *BlockStore) LoadBlockCommit(height int64) *types.Commit { - ret := _m.Called(height) +// LoadBlockCommit provides a mock function for the type BlockStore +func (_mock *BlockStore) LoadBlockCommit(height int64) *types.Commit { + ret := _mock.Called(height) if len(ret) == 0 { panic("no return value specified for LoadBlockCommit") } var r0 *types.Commit - if rf, ok := ret.Get(0).(func(int64) *types.Commit); ok { - r0 = rf(height) + if returnFunc, ok := ret.Get(0).(func(int64) *types.Commit); ok { + r0 = returnFunc(height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.Commit) } } - return r0 } @@ -325,7 +333,7 @@ type BlockStore_LoadBlockCommit_Call struct { } // LoadBlockCommit is a helper method to define mock.On call -// - height int64 +// - height func (_e *BlockStore_Expecter) LoadBlockCommit(height interface{}) *BlockStore_LoadBlockCommit_Call { return &BlockStore_LoadBlockCommit_Call{Call: _e.mock.On("LoadBlockCommit", height)} } @@ -337,33 +345,32 @@ func (_c *BlockStore_LoadBlockCommit_Call) Run(run func(height int64)) *BlockSto return _c } -func (_c *BlockStore_LoadBlockCommit_Call) Return(_a0 *types.Commit) *BlockStore_LoadBlockCommit_Call { - _c.Call.Return(_a0) +func (_c *BlockStore_LoadBlockCommit_Call) Return(commit *types.Commit) *BlockStore_LoadBlockCommit_Call { + _c.Call.Return(commit) return _c } -func (_c *BlockStore_LoadBlockCommit_Call) RunAndReturn(run func(int64) *types.Commit) *BlockStore_LoadBlockCommit_Call { +func (_c *BlockStore_LoadBlockCommit_Call) RunAndReturn(run func(height int64) *types.Commit) *BlockStore_LoadBlockCommit_Call { _c.Call.Return(run) return _c } -// LoadBlockMeta provides a mock function with given fields: height -func (_m *BlockStore) LoadBlockMeta(height int64) *types.BlockMeta { - ret := _m.Called(height) +// LoadBlockMeta provides a mock function for the type BlockStore +func (_mock *BlockStore) LoadBlockMeta(height int64) *types.BlockMeta { + ret := _mock.Called(height) if len(ret) == 0 { panic("no return value specified for LoadBlockMeta") } var r0 *types.BlockMeta - if rf, ok := ret.Get(0).(func(int64) *types.BlockMeta); ok { - r0 = rf(height) + if returnFunc, ok := ret.Get(0).(func(int64) *types.BlockMeta); ok { + r0 = returnFunc(height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.BlockMeta) } } - return r0 } @@ -373,7 +380,7 @@ type BlockStore_LoadBlockMeta_Call struct { } // LoadBlockMeta is a helper method to define mock.On call -// - height int64 +// - height func (_e *BlockStore_Expecter) LoadBlockMeta(height interface{}) *BlockStore_LoadBlockMeta_Call { return &BlockStore_LoadBlockMeta_Call{Call: _e.mock.On("LoadBlockMeta", height)} } @@ -385,33 +392,32 @@ func (_c *BlockStore_LoadBlockMeta_Call) Run(run func(height int64)) *BlockStore return _c } -func (_c *BlockStore_LoadBlockMeta_Call) Return(_a0 *types.BlockMeta) *BlockStore_LoadBlockMeta_Call { - _c.Call.Return(_a0) +func (_c *BlockStore_LoadBlockMeta_Call) Return(blockMeta *types.BlockMeta) *BlockStore_LoadBlockMeta_Call { + _c.Call.Return(blockMeta) return _c } -func (_c *BlockStore_LoadBlockMeta_Call) RunAndReturn(run func(int64) *types.BlockMeta) *BlockStore_LoadBlockMeta_Call { +func (_c *BlockStore_LoadBlockMeta_Call) RunAndReturn(run func(height int64) *types.BlockMeta) *BlockStore_LoadBlockMeta_Call { _c.Call.Return(run) return _c } -// LoadBlockMetaByHash provides a mock function with given fields: hash -func (_m *BlockStore) LoadBlockMetaByHash(hash []byte) *types.BlockMeta { - ret := _m.Called(hash) +// LoadBlockMetaByHash provides a mock function for the type BlockStore +func (_mock *BlockStore) LoadBlockMetaByHash(hash []byte) *types.BlockMeta { + ret := _mock.Called(hash) if len(ret) == 0 { panic("no return value specified for LoadBlockMetaByHash") } var r0 *types.BlockMeta - if rf, ok := ret.Get(0).(func([]byte) *types.BlockMeta); ok { - r0 = rf(hash) + if returnFunc, ok := ret.Get(0).(func([]byte) *types.BlockMeta); ok { + r0 = returnFunc(hash) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.BlockMeta) } } - return r0 } @@ -421,7 +427,7 @@ type BlockStore_LoadBlockMetaByHash_Call struct { } // LoadBlockMetaByHash is a helper method to define mock.On call -// - hash []byte +// - hash func (_e *BlockStore_Expecter) LoadBlockMetaByHash(hash interface{}) *BlockStore_LoadBlockMetaByHash_Call { return &BlockStore_LoadBlockMetaByHash_Call{Call: _e.mock.On("LoadBlockMetaByHash", hash)} } @@ -433,33 +439,32 @@ func (_c *BlockStore_LoadBlockMetaByHash_Call) Run(run func(hash []byte)) *Block return _c } -func (_c *BlockStore_LoadBlockMetaByHash_Call) Return(_a0 *types.BlockMeta) *BlockStore_LoadBlockMetaByHash_Call { - _c.Call.Return(_a0) +func (_c *BlockStore_LoadBlockMetaByHash_Call) Return(blockMeta *types.BlockMeta) *BlockStore_LoadBlockMetaByHash_Call { + _c.Call.Return(blockMeta) return _c } -func (_c *BlockStore_LoadBlockMetaByHash_Call) RunAndReturn(run func([]byte) *types.BlockMeta) *BlockStore_LoadBlockMetaByHash_Call { +func (_c *BlockStore_LoadBlockMetaByHash_Call) RunAndReturn(run func(hash []byte) *types.BlockMeta) *BlockStore_LoadBlockMetaByHash_Call { _c.Call.Return(run) return _c } -// LoadBlockPart provides a mock function with given fields: height, index -func (_m *BlockStore) LoadBlockPart(height int64, index int) *types.Part { - ret := _m.Called(height, index) +// LoadBlockPart provides a mock function for the type BlockStore +func (_mock *BlockStore) LoadBlockPart(height int64, index int) *types.Part { + ret := _mock.Called(height, index) if len(ret) == 0 { panic("no return value specified for LoadBlockPart") } var r0 *types.Part - if rf, ok := ret.Get(0).(func(int64, int) *types.Part); ok { - r0 = rf(height, index) + if returnFunc, ok := ret.Get(0).(func(int64, int) *types.Part); ok { + r0 = returnFunc(height, index) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.Part) } } - return r0 } @@ -469,8 +474,8 @@ type BlockStore_LoadBlockPart_Call struct { } // LoadBlockPart is a helper method to define mock.On call -// - height int64 -// - index int +// - height +// - index func (_e *BlockStore_Expecter) LoadBlockPart(height interface{}, index interface{}) *BlockStore_LoadBlockPart_Call { return &BlockStore_LoadBlockPart_Call{Call: _e.mock.On("LoadBlockPart", height, index)} } @@ -482,33 +487,32 @@ func (_c *BlockStore_LoadBlockPart_Call) Run(run func(height int64, index int)) return _c } -func (_c *BlockStore_LoadBlockPart_Call) Return(_a0 *types.Part) *BlockStore_LoadBlockPart_Call { - _c.Call.Return(_a0) +func (_c *BlockStore_LoadBlockPart_Call) Return(part *types.Part) *BlockStore_LoadBlockPart_Call { + _c.Call.Return(part) return _c } -func (_c *BlockStore_LoadBlockPart_Call) RunAndReturn(run func(int64, int) *types.Part) *BlockStore_LoadBlockPart_Call { +func (_c *BlockStore_LoadBlockPart_Call) RunAndReturn(run func(height int64, index int) *types.Part) *BlockStore_LoadBlockPart_Call { _c.Call.Return(run) return _c } -// LoadSeenCommit provides a mock function with no fields -func (_m *BlockStore) LoadSeenCommit() *types.Commit { - ret := _m.Called() +// LoadSeenCommit provides a mock function for the type BlockStore +func (_mock *BlockStore) LoadSeenCommit() *types.Commit { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for LoadSeenCommit") } var r0 *types.Commit - if rf, ok := ret.Get(0).(func() *types.Commit); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() *types.Commit); ok { + r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.Commit) } } - return r0 } @@ -529,8 +533,8 @@ func (_c *BlockStore_LoadSeenCommit_Call) Run(run func()) *BlockStore_LoadSeenCo return _c } -func (_c *BlockStore_LoadSeenCommit_Call) Return(_a0 *types.Commit) *BlockStore_LoadSeenCommit_Call { - _c.Call.Return(_a0) +func (_c *BlockStore_LoadSeenCommit_Call) Return(commit *types.Commit) *BlockStore_LoadSeenCommit_Call { + _c.Call.Return(commit) return _c } @@ -539,23 +543,22 @@ func (_c *BlockStore_LoadSeenCommit_Call) RunAndReturn(run func() *types.Commit) return _c } -// LoadSeenCommitAt provides a mock function with given fields: height -func (_m *BlockStore) LoadSeenCommitAt(height int64) *types.Commit { - ret := _m.Called(height) +// LoadSeenCommitAt provides a mock function for the type BlockStore +func (_mock *BlockStore) LoadSeenCommitAt(height int64) *types.Commit { + ret := _mock.Called(height) if len(ret) == 0 { panic("no return value specified for LoadSeenCommitAt") } var r0 *types.Commit - if rf, ok := ret.Get(0).(func(int64) *types.Commit); ok { - r0 = rf(height) + if returnFunc, ok := ret.Get(0).(func(int64) *types.Commit); ok { + r0 = returnFunc(height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.Commit) } } - return r0 } @@ -565,7 +568,7 @@ type BlockStore_LoadSeenCommitAt_Call struct { } // LoadSeenCommitAt is a helper method to define mock.On call -// - height int64 +// - height func (_e *BlockStore_Expecter) LoadSeenCommitAt(height interface{}) *BlockStore_LoadSeenCommitAt_Call { return &BlockStore_LoadSeenCommitAt_Call{Call: _e.mock.On("LoadSeenCommitAt", height)} } @@ -577,19 +580,19 @@ func (_c *BlockStore_LoadSeenCommitAt_Call) Run(run func(height int64)) *BlockSt return _c } -func (_c *BlockStore_LoadSeenCommitAt_Call) Return(_a0 *types.Commit) *BlockStore_LoadSeenCommitAt_Call { - _c.Call.Return(_a0) +func (_c *BlockStore_LoadSeenCommitAt_Call) Return(commit *types.Commit) *BlockStore_LoadSeenCommitAt_Call { + _c.Call.Return(commit) return _c } -func (_c *BlockStore_LoadSeenCommitAt_Call) RunAndReturn(run func(int64) *types.Commit) *BlockStore_LoadSeenCommitAt_Call { +func (_c *BlockStore_LoadSeenCommitAt_Call) RunAndReturn(run func(height int64) *types.Commit) *BlockStore_LoadSeenCommitAt_Call { _c.Call.Return(run) return _c } -// PruneBlocks provides a mock function with given fields: height -func (_m *BlockStore) PruneBlocks(height int64) (uint64, error) { - ret := _m.Called(height) +// PruneBlocks provides a mock function for the type BlockStore +func (_mock *BlockStore) PruneBlocks(height int64) (uint64, error) { + ret := _mock.Called(height) if len(ret) == 0 { panic("no return value specified for PruneBlocks") @@ -597,21 +600,19 @@ func (_m *BlockStore) PruneBlocks(height int64) (uint64, error) { var r0 uint64 var r1 error - if rf, ok := ret.Get(0).(func(int64) (uint64, error)); ok { - return rf(height) + if returnFunc, ok := ret.Get(0).(func(int64) (uint64, error)); ok { + return returnFunc(height) } - if rf, ok := ret.Get(0).(func(int64) uint64); ok { - r0 = rf(height) + if returnFunc, ok := ret.Get(0).(func(int64) uint64); ok { + r0 = returnFunc(height) } else { r0 = ret.Get(0).(uint64) } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(height) + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(height) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -621,7 +622,7 @@ type BlockStore_PruneBlocks_Call struct { } // PruneBlocks is a helper method to define mock.On call -// - height int64 +// - height func (_e *BlockStore_Expecter) PruneBlocks(height interface{}) *BlockStore_PruneBlocks_Call { return &BlockStore_PruneBlocks_Call{Call: _e.mock.On("PruneBlocks", height)} } @@ -633,19 +634,20 @@ func (_c *BlockStore_PruneBlocks_Call) Run(run func(height int64)) *BlockStore_P return _c } -func (_c *BlockStore_PruneBlocks_Call) Return(_a0 uint64, _a1 error) *BlockStore_PruneBlocks_Call { - _c.Call.Return(_a0, _a1) +func (_c *BlockStore_PruneBlocks_Call) Return(v uint64, err error) *BlockStore_PruneBlocks_Call { + _c.Call.Return(v, err) return _c } -func (_c *BlockStore_PruneBlocks_Call) RunAndReturn(run func(int64) (uint64, error)) *BlockStore_PruneBlocks_Call { +func (_c *BlockStore_PruneBlocks_Call) RunAndReturn(run func(height int64) (uint64, error)) *BlockStore_PruneBlocks_Call { _c.Call.Return(run) return _c } -// SaveBlock provides a mock function with given fields: block, blockParts, seenCommit -func (_m *BlockStore) SaveBlock(block *types.Block, blockParts *types.PartSet, seenCommit *types.Commit) { - _m.Called(block, blockParts, seenCommit) +// SaveBlock provides a mock function for the type BlockStore +func (_mock *BlockStore) SaveBlock(block *types.Block, blockParts *types.PartSet, seenCommit *types.Commit) { + _mock.Called(block, blockParts, seenCommit) + return } // BlockStore_SaveBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveBlock' @@ -654,9 +656,9 @@ type BlockStore_SaveBlock_Call struct { } // SaveBlock is a helper method to define mock.On call -// - block *types.Block -// - blockParts *types.PartSet -// - seenCommit *types.Commit +// - block +// - blockParts +// - seenCommit func (_e *BlockStore_Expecter) SaveBlock(block interface{}, blockParts interface{}, seenCommit interface{}) *BlockStore_SaveBlock_Call { return &BlockStore_SaveBlock_Call{Call: _e.mock.On("SaveBlock", block, blockParts, seenCommit)} } @@ -673,26 +675,25 @@ func (_c *BlockStore_SaveBlock_Call) Return() *BlockStore_SaveBlock_Call { return _c } -func (_c *BlockStore_SaveBlock_Call) RunAndReturn(run func(*types.Block, *types.PartSet, *types.Commit)) *BlockStore_SaveBlock_Call { +func (_c *BlockStore_SaveBlock_Call) RunAndReturn(run func(block *types.Block, blockParts *types.PartSet, seenCommit *types.Commit)) *BlockStore_SaveBlock_Call { _c.Run(run) return _c } -// Size provides a mock function with no fields -func (_m *BlockStore) Size() int64 { - ret := _m.Called() +// Size provides a mock function for the type BlockStore +func (_mock *BlockStore) Size() int64 { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Size") } var r0 int64 - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() int64); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(int64) } - return r0 } @@ -713,8 +714,8 @@ func (_c *BlockStore_Size_Call) Run(run func()) *BlockStore_Size_Call { return _c } -func (_c *BlockStore_Size_Call) Return(_a0 int64) *BlockStore_Size_Call { - _c.Call.Return(_a0) +func (_c *BlockStore_Size_Call) Return(n int64) *BlockStore_Size_Call { + _c.Call.Return(n) return _c } @@ -722,17 +723,3 @@ func (_c *BlockStore_Size_Call) RunAndReturn(run func() int64) *BlockStore_Size_ _c.Call.Return(run) return _c } - -// NewBlockStore creates a new instance of BlockStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewBlockStore(t interface { - mock.TestingT - Cleanup(func()) -}) *BlockStore { - mock := &BlockStore{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/state/mocks/evidencepool.go b/internal/state/mocks/evidencepool.go index 1491806b7d..c86e12afb9 100644 --- a/internal/state/mocks/evidencepool.go +++ b/internal/state/mocks/evidencepool.go @@ -1,16 +1,31 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" - state "github.com/dashpay/tenderdash/internal/state" + "github.com/dashpay/tenderdash/internal/state" + "github.com/dashpay/tenderdash/types" mock "github.com/stretchr/testify/mock" - - types "github.com/dashpay/tenderdash/types" ) +// NewEvidencePool creates a new instance of EvidencePool. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewEvidencePool(t interface { + mock.TestingT + Cleanup(func()) +}) *EvidencePool { + mock := &EvidencePool{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // EvidencePool is an autogenerated mock type for the EvidencePool type type EvidencePool struct { mock.Mock @@ -24,21 +39,20 @@ func (_m *EvidencePool) EXPECT() *EvidencePool_Expecter { return &EvidencePool_Expecter{mock: &_m.Mock} } -// AddEvidence provides a mock function with given fields: _a0, _a1 -func (_m *EvidencePool) AddEvidence(_a0 context.Context, _a1 types.Evidence) error { - ret := _m.Called(_a0, _a1) +// AddEvidence provides a mock function for the type EvidencePool +func (_mock *EvidencePool) AddEvidence(context1 context.Context, evidence types.Evidence) error { + ret := _mock.Called(context1, evidence) if len(ret) == 0 { panic("no return value specified for AddEvidence") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) error); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Evidence) error); ok { + r0 = returnFunc(context1, evidence) } else { r0 = ret.Error(0) } - return r0 } @@ -48,44 +62,43 @@ type EvidencePool_AddEvidence_Call struct { } // AddEvidence is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.Evidence -func (_e *EvidencePool_Expecter) AddEvidence(_a0 interface{}, _a1 interface{}) *EvidencePool_AddEvidence_Call { - return &EvidencePool_AddEvidence_Call{Call: _e.mock.On("AddEvidence", _a0, _a1)} +// - context1 +// - evidence +func (_e *EvidencePool_Expecter) AddEvidence(context1 interface{}, evidence interface{}) *EvidencePool_AddEvidence_Call { + return &EvidencePool_AddEvidence_Call{Call: _e.mock.On("AddEvidence", context1, evidence)} } -func (_c *EvidencePool_AddEvidence_Call) Run(run func(_a0 context.Context, _a1 types.Evidence)) *EvidencePool_AddEvidence_Call { +func (_c *EvidencePool_AddEvidence_Call) Run(run func(context1 context.Context, evidence types.Evidence)) *EvidencePool_AddEvidence_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.Evidence)) }) return _c } -func (_c *EvidencePool_AddEvidence_Call) Return(_a0 error) *EvidencePool_AddEvidence_Call { - _c.Call.Return(_a0) +func (_c *EvidencePool_AddEvidence_Call) Return(err error) *EvidencePool_AddEvidence_Call { + _c.Call.Return(err) return _c } -func (_c *EvidencePool_AddEvidence_Call) RunAndReturn(run func(context.Context, types.Evidence) error) *EvidencePool_AddEvidence_Call { +func (_c *EvidencePool_AddEvidence_Call) RunAndReturn(run func(context1 context.Context, evidence types.Evidence) error) *EvidencePool_AddEvidence_Call { _c.Call.Return(run) return _c } -// CheckEvidence provides a mock function with given fields: _a0, _a1 -func (_m *EvidencePool) CheckEvidence(_a0 context.Context, _a1 types.EvidenceList) error { - ret := _m.Called(_a0, _a1) +// CheckEvidence provides a mock function for the type EvidencePool +func (_mock *EvidencePool) CheckEvidence(context1 context.Context, evidenceList types.EvidenceList) error { + ret := _mock.Called(context1, evidenceList) if len(ret) == 0 { panic("no return value specified for CheckEvidence") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, types.EvidenceList) error); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.EvidenceList) error); ok { + r0 = returnFunc(context1, evidenceList) } else { r0 = ret.Error(0) } - return r0 } @@ -95,32 +108,32 @@ type EvidencePool_CheckEvidence_Call struct { } // CheckEvidence is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.EvidenceList -func (_e *EvidencePool_Expecter) CheckEvidence(_a0 interface{}, _a1 interface{}) *EvidencePool_CheckEvidence_Call { - return &EvidencePool_CheckEvidence_Call{Call: _e.mock.On("CheckEvidence", _a0, _a1)} +// - context1 +// - evidenceList +func (_e *EvidencePool_Expecter) CheckEvidence(context1 interface{}, evidenceList interface{}) *EvidencePool_CheckEvidence_Call { + return &EvidencePool_CheckEvidence_Call{Call: _e.mock.On("CheckEvidence", context1, evidenceList)} } -func (_c *EvidencePool_CheckEvidence_Call) Run(run func(_a0 context.Context, _a1 types.EvidenceList)) *EvidencePool_CheckEvidence_Call { +func (_c *EvidencePool_CheckEvidence_Call) Run(run func(context1 context.Context, evidenceList types.EvidenceList)) *EvidencePool_CheckEvidence_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.EvidenceList)) }) return _c } -func (_c *EvidencePool_CheckEvidence_Call) Return(_a0 error) *EvidencePool_CheckEvidence_Call { - _c.Call.Return(_a0) +func (_c *EvidencePool_CheckEvidence_Call) Return(err error) *EvidencePool_CheckEvidence_Call { + _c.Call.Return(err) return _c } -func (_c *EvidencePool_CheckEvidence_Call) RunAndReturn(run func(context.Context, types.EvidenceList) error) *EvidencePool_CheckEvidence_Call { +func (_c *EvidencePool_CheckEvidence_Call) RunAndReturn(run func(context1 context.Context, evidenceList types.EvidenceList) error) *EvidencePool_CheckEvidence_Call { _c.Call.Return(run) return _c } -// PendingEvidence provides a mock function with given fields: maxBytes -func (_m *EvidencePool) PendingEvidence(maxBytes int64) ([]types.Evidence, int64) { - ret := _m.Called(maxBytes) +// PendingEvidence provides a mock function for the type EvidencePool +func (_mock *EvidencePool) PendingEvidence(maxBytes int64) ([]types.Evidence, int64) { + ret := _mock.Called(maxBytes) if len(ret) == 0 { panic("no return value specified for PendingEvidence") @@ -128,23 +141,21 @@ func (_m *EvidencePool) PendingEvidence(maxBytes int64) ([]types.Evidence, int64 var r0 []types.Evidence var r1 int64 - if rf, ok := ret.Get(0).(func(int64) ([]types.Evidence, int64)); ok { - return rf(maxBytes) + if returnFunc, ok := ret.Get(0).(func(int64) ([]types.Evidence, int64)); ok { + return returnFunc(maxBytes) } - if rf, ok := ret.Get(0).(func(int64) []types.Evidence); ok { - r0 = rf(maxBytes) + if returnFunc, ok := ret.Get(0).(func(int64) []types.Evidence); ok { + r0 = returnFunc(maxBytes) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]types.Evidence) } } - - if rf, ok := ret.Get(1).(func(int64) int64); ok { - r1 = rf(maxBytes) + if returnFunc, ok := ret.Get(1).(func(int64) int64); ok { + r1 = returnFunc(maxBytes) } else { r1 = ret.Get(1).(int64) } - return r0, r1 } @@ -154,7 +165,7 @@ type EvidencePool_PendingEvidence_Call struct { } // PendingEvidence is a helper method to define mock.On call -// - maxBytes int64 +// - maxBytes func (_e *EvidencePool_Expecter) PendingEvidence(maxBytes interface{}) *EvidencePool_PendingEvidence_Call { return &EvidencePool_PendingEvidence_Call{Call: _e.mock.On("PendingEvidence", maxBytes)} } @@ -171,14 +182,15 @@ func (_c *EvidencePool_PendingEvidence_Call) Return(ev []types.Evidence, size in return _c } -func (_c *EvidencePool_PendingEvidence_Call) RunAndReturn(run func(int64) ([]types.Evidence, int64)) *EvidencePool_PendingEvidence_Call { +func (_c *EvidencePool_PendingEvidence_Call) RunAndReturn(run func(maxBytes int64) ([]types.Evidence, int64)) *EvidencePool_PendingEvidence_Call { _c.Call.Return(run) return _c } -// Update provides a mock function with given fields: _a0, _a1, _a2 -func (_m *EvidencePool) Update(_a0 context.Context, _a1 state.State, _a2 types.EvidenceList) { - _m.Called(_a0, _a1, _a2) +// Update provides a mock function for the type EvidencePool +func (_mock *EvidencePool) Update(context1 context.Context, state1 state.State, evidenceList types.EvidenceList) { + _mock.Called(context1, state1, evidenceList) + return } // EvidencePool_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' @@ -187,14 +199,14 @@ type EvidencePool_Update_Call struct { } // Update is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 state.State -// - _a2 types.EvidenceList -func (_e *EvidencePool_Expecter) Update(_a0 interface{}, _a1 interface{}, _a2 interface{}) *EvidencePool_Update_Call { - return &EvidencePool_Update_Call{Call: _e.mock.On("Update", _a0, _a1, _a2)} +// - context1 +// - state1 +// - evidenceList +func (_e *EvidencePool_Expecter) Update(context1 interface{}, state1 interface{}, evidenceList interface{}) *EvidencePool_Update_Call { + return &EvidencePool_Update_Call{Call: _e.mock.On("Update", context1, state1, evidenceList)} } -func (_c *EvidencePool_Update_Call) Run(run func(_a0 context.Context, _a1 state.State, _a2 types.EvidenceList)) *EvidencePool_Update_Call { +func (_c *EvidencePool_Update_Call) Run(run func(context1 context.Context, state1 state.State, evidenceList types.EvidenceList)) *EvidencePool_Update_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(state.State), args[2].(types.EvidenceList)) }) @@ -206,21 +218,7 @@ func (_c *EvidencePool_Update_Call) Return() *EvidencePool_Update_Call { return _c } -func (_c *EvidencePool_Update_Call) RunAndReturn(run func(context.Context, state.State, types.EvidenceList)) *EvidencePool_Update_Call { +func (_c *EvidencePool_Update_Call) RunAndReturn(run func(context1 context.Context, state1 state.State, evidenceList types.EvidenceList)) *EvidencePool_Update_Call { _c.Run(run) return _c } - -// NewEvidencePool creates a new instance of EvidencePool. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewEvidencePool(t interface { - mock.TestingT - Cleanup(func()) -}) *EvidencePool { - mock := &EvidencePool{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/state/mocks/executor.go b/internal/state/mocks/executor.go index a1a19d63ec..02d5edb0f1 100644 --- a/internal/state/mocks/executor.go +++ b/internal/state/mocks/executor.go @@ -1,16 +1,31 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" - state "github.com/dashpay/tenderdash/internal/state" + "github.com/dashpay/tenderdash/internal/state" + "github.com/dashpay/tenderdash/types" mock "github.com/stretchr/testify/mock" - - types "github.com/dashpay/tenderdash/types" ) +// NewExecutor creates a new instance of Executor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewExecutor(t interface { + mock.TestingT + Cleanup(func()) +}) *Executor { + mock := &Executor{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Executor is an autogenerated mock type for the Executor type type Executor struct { mock.Mock @@ -24,9 +39,9 @@ func (_m *Executor) EXPECT() *Executor_Expecter { return &Executor_Expecter{mock: &_m.Mock} } -// ApplyBlock provides a mock function with given fields: ctx, _a1, blockID, block, commit -func (_m *Executor) ApplyBlock(ctx context.Context, _a1 state.State, blockID types.BlockID, block *types.Block, commit *types.Commit) (state.State, error) { - ret := _m.Called(ctx, _a1, blockID, block, commit) +// ApplyBlock provides a mock function for the type Executor +func (_mock *Executor) ApplyBlock(ctx context.Context, state1 state.State, blockID types.BlockID, block *types.Block, commit *types.Commit) (state.State, error) { + ret := _mock.Called(ctx, state1, blockID, block, commit) if len(ret) == 0 { panic("no return value specified for ApplyBlock") @@ -34,21 +49,19 @@ func (_m *Executor) ApplyBlock(ctx context.Context, _a1 state.State, blockID typ var r0 state.State var r1 error - if rf, ok := ret.Get(0).(func(context.Context, state.State, types.BlockID, *types.Block, *types.Commit) (state.State, error)); ok { - return rf(ctx, _a1, blockID, block, commit) + if returnFunc, ok := ret.Get(0).(func(context.Context, state.State, types.BlockID, *types.Block, *types.Commit) (state.State, error)); ok { + return returnFunc(ctx, state1, blockID, block, commit) } - if rf, ok := ret.Get(0).(func(context.Context, state.State, types.BlockID, *types.Block, *types.Commit) state.State); ok { - r0 = rf(ctx, _a1, blockID, block, commit) + if returnFunc, ok := ret.Get(0).(func(context.Context, state.State, types.BlockID, *types.Block, *types.Commit) state.State); ok { + r0 = returnFunc(ctx, state1, blockID, block, commit) } else { r0 = ret.Get(0).(state.State) } - - if rf, ok := ret.Get(1).(func(context.Context, state.State, types.BlockID, *types.Block, *types.Commit) error); ok { - r1 = rf(ctx, _a1, blockID, block, commit) + if returnFunc, ok := ret.Get(1).(func(context.Context, state.State, types.BlockID, *types.Block, *types.Commit) error); ok { + r1 = returnFunc(ctx, state1, blockID, block, commit) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -58,35 +71,35 @@ type Executor_ApplyBlock_Call struct { } // ApplyBlock is a helper method to define mock.On call -// - ctx context.Context -// - _a1 state.State -// - blockID types.BlockID -// - block *types.Block -// - commit *types.Commit -func (_e *Executor_Expecter) ApplyBlock(ctx interface{}, _a1 interface{}, blockID interface{}, block interface{}, commit interface{}) *Executor_ApplyBlock_Call { - return &Executor_ApplyBlock_Call{Call: _e.mock.On("ApplyBlock", ctx, _a1, blockID, block, commit)} +// - ctx +// - state1 +// - blockID +// - block +// - commit +func (_e *Executor_Expecter) ApplyBlock(ctx interface{}, state1 interface{}, blockID interface{}, block interface{}, commit interface{}) *Executor_ApplyBlock_Call { + return &Executor_ApplyBlock_Call{Call: _e.mock.On("ApplyBlock", ctx, state1, blockID, block, commit)} } -func (_c *Executor_ApplyBlock_Call) Run(run func(ctx context.Context, _a1 state.State, blockID types.BlockID, block *types.Block, commit *types.Commit)) *Executor_ApplyBlock_Call { +func (_c *Executor_ApplyBlock_Call) Run(run func(ctx context.Context, state1 state.State, blockID types.BlockID, block *types.Block, commit *types.Commit)) *Executor_ApplyBlock_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(state.State), args[2].(types.BlockID), args[3].(*types.Block), args[4].(*types.Commit)) }) return _c } -func (_c *Executor_ApplyBlock_Call) Return(_a0 state.State, _a1 error) *Executor_ApplyBlock_Call { - _c.Call.Return(_a0, _a1) +func (_c *Executor_ApplyBlock_Call) Return(state11 state.State, err error) *Executor_ApplyBlock_Call { + _c.Call.Return(state11, err) return _c } -func (_c *Executor_ApplyBlock_Call) RunAndReturn(run func(context.Context, state.State, types.BlockID, *types.Block, *types.Commit) (state.State, error)) *Executor_ApplyBlock_Call { +func (_c *Executor_ApplyBlock_Call) RunAndReturn(run func(ctx context.Context, state1 state.State, blockID types.BlockID, block *types.Block, commit *types.Commit) (state.State, error)) *Executor_ApplyBlock_Call { _c.Call.Return(run) return _c } -// CreateProposalBlock provides a mock function with given fields: ctx, height, round, _a3, commit, proposerProTxHash, proposedAppVersion -func (_m *Executor) CreateProposalBlock(ctx context.Context, height int64, round int32, _a3 state.State, commit *types.Commit, proposerProTxHash []byte, proposedAppVersion uint64) (*types.Block, state.CurrentRoundState, error) { - ret := _m.Called(ctx, height, round, _a3, commit, proposerProTxHash, proposedAppVersion) +// CreateProposalBlock provides a mock function for the type Executor +func (_mock *Executor) CreateProposalBlock(ctx context.Context, height int64, round int32, state1 state.State, commit *types.Commit, proposerProTxHash []byte, proposedAppVersion uint64) (*types.Block, state.CurrentRoundState, error) { + ret := _mock.Called(ctx, height, round, state1, commit, proposerProTxHash, proposedAppVersion) if len(ret) == 0 { panic("no return value specified for CreateProposalBlock") @@ -95,29 +108,26 @@ func (_m *Executor) CreateProposalBlock(ctx context.Context, height int64, round var r0 *types.Block var r1 state.CurrentRoundState var r2 error - if rf, ok := ret.Get(0).(func(context.Context, int64, int32, state.State, *types.Commit, []byte, uint64) (*types.Block, state.CurrentRoundState, error)); ok { - return rf(ctx, height, round, _a3, commit, proposerProTxHash, proposedAppVersion) + if returnFunc, ok := ret.Get(0).(func(context.Context, int64, int32, state.State, *types.Commit, []byte, uint64) (*types.Block, state.CurrentRoundState, error)); ok { + return returnFunc(ctx, height, round, state1, commit, proposerProTxHash, proposedAppVersion) } - if rf, ok := ret.Get(0).(func(context.Context, int64, int32, state.State, *types.Commit, []byte, uint64) *types.Block); ok { - r0 = rf(ctx, height, round, _a3, commit, proposerProTxHash, proposedAppVersion) + if returnFunc, ok := ret.Get(0).(func(context.Context, int64, int32, state.State, *types.Commit, []byte, uint64) *types.Block); ok { + r0 = returnFunc(ctx, height, round, state1, commit, proposerProTxHash, proposedAppVersion) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.Block) } } - - if rf, ok := ret.Get(1).(func(context.Context, int64, int32, state.State, *types.Commit, []byte, uint64) state.CurrentRoundState); ok { - r1 = rf(ctx, height, round, _a3, commit, proposerProTxHash, proposedAppVersion) + if returnFunc, ok := ret.Get(1).(func(context.Context, int64, int32, state.State, *types.Commit, []byte, uint64) state.CurrentRoundState); ok { + r1 = returnFunc(ctx, height, round, state1, commit, proposerProTxHash, proposedAppVersion) } else { r1 = ret.Get(1).(state.CurrentRoundState) } - - if rf, ok := ret.Get(2).(func(context.Context, int64, int32, state.State, *types.Commit, []byte, uint64) error); ok { - r2 = rf(ctx, height, round, _a3, commit, proposerProTxHash, proposedAppVersion) + if returnFunc, ok := ret.Get(2).(func(context.Context, int64, int32, state.State, *types.Commit, []byte, uint64) error); ok { + r2 = returnFunc(ctx, height, round, state1, commit, proposerProTxHash, proposedAppVersion) } else { r2 = ret.Error(2) } - return r0, r1, r2 } @@ -127,37 +137,38 @@ type Executor_CreateProposalBlock_Call struct { } // CreateProposalBlock is a helper method to define mock.On call -// - ctx context.Context -// - height int64 -// - round int32 -// - _a3 state.State -// - commit *types.Commit -// - proposerProTxHash []byte -// - proposedAppVersion uint64 -func (_e *Executor_Expecter) CreateProposalBlock(ctx interface{}, height interface{}, round interface{}, _a3 interface{}, commit interface{}, proposerProTxHash interface{}, proposedAppVersion interface{}) *Executor_CreateProposalBlock_Call { - return &Executor_CreateProposalBlock_Call{Call: _e.mock.On("CreateProposalBlock", ctx, height, round, _a3, commit, proposerProTxHash, proposedAppVersion)} -} - -func (_c *Executor_CreateProposalBlock_Call) Run(run func(ctx context.Context, height int64, round int32, _a3 state.State, commit *types.Commit, proposerProTxHash []byte, proposedAppVersion uint64)) *Executor_CreateProposalBlock_Call { +// - ctx +// - height +// - round +// - state1 +// - commit +// - proposerProTxHash +// - proposedAppVersion +func (_e *Executor_Expecter) CreateProposalBlock(ctx interface{}, height interface{}, round interface{}, state1 interface{}, commit interface{}, proposerProTxHash interface{}, proposedAppVersion interface{}) *Executor_CreateProposalBlock_Call { + return &Executor_CreateProposalBlock_Call{Call: _e.mock.On("CreateProposalBlock", ctx, height, round, state1, commit, proposerProTxHash, proposedAppVersion)} +} + +func (_c *Executor_CreateProposalBlock_Call) Run(run func(ctx context.Context, height int64, round int32, state1 state.State, commit *types.Commit, proposerProTxHash []byte, proposedAppVersion uint64)) *Executor_CreateProposalBlock_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(int64), args[2].(int32), args[3].(state.State), args[4].(*types.Commit), args[5].([]byte), args[6].(uint64)) }) return _c } -func (_c *Executor_CreateProposalBlock_Call) Return(_a0 *types.Block, _a1 state.CurrentRoundState, _a2 error) *Executor_CreateProposalBlock_Call { - _c.Call.Return(_a0, _a1, _a2) +func (_c *Executor_CreateProposalBlock_Call) Return(block *types.Block, currentRoundState state.CurrentRoundState, err error) *Executor_CreateProposalBlock_Call { + _c.Call.Return(block, currentRoundState, err) return _c } -func (_c *Executor_CreateProposalBlock_Call) RunAndReturn(run func(context.Context, int64, int32, state.State, *types.Commit, []byte, uint64) (*types.Block, state.CurrentRoundState, error)) *Executor_CreateProposalBlock_Call { +func (_c *Executor_CreateProposalBlock_Call) RunAndReturn(run func(ctx context.Context, height int64, round int32, state1 state.State, commit *types.Commit, proposerProTxHash []byte, proposedAppVersion uint64) (*types.Block, state.CurrentRoundState, error)) *Executor_CreateProposalBlock_Call { _c.Call.Return(run) return _c } -// ExtendVote provides a mock function with given fields: ctx, vote -func (_m *Executor) ExtendVote(ctx context.Context, vote *types.Vote) { - _m.Called(ctx, vote) +// ExtendVote provides a mock function for the type Executor +func (_mock *Executor) ExtendVote(ctx context.Context, vote *types.Vote) { + _mock.Called(ctx, vote) + return } // Executor_ExtendVote_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExtendVote' @@ -166,8 +177,8 @@ type Executor_ExtendVote_Call struct { } // ExtendVote is a helper method to define mock.On call -// - ctx context.Context -// - vote *types.Vote +// - ctx +// - vote func (_e *Executor_Expecter) ExtendVote(ctx interface{}, vote interface{}) *Executor_ExtendVote_Call { return &Executor_ExtendVote_Call{Call: _e.mock.On("ExtendVote", ctx, vote)} } @@ -184,14 +195,14 @@ func (_c *Executor_ExtendVote_Call) Return() *Executor_ExtendVote_Call { return _c } -func (_c *Executor_ExtendVote_Call) RunAndReturn(run func(context.Context, *types.Vote)) *Executor_ExtendVote_Call { +func (_c *Executor_ExtendVote_Call) RunAndReturn(run func(ctx context.Context, vote *types.Vote)) *Executor_ExtendVote_Call { _c.Run(run) return _c } -// FinalizeBlock provides a mock function with given fields: ctx, _a1, uncommittedState, blockID, block, commit -func (_m *Executor) FinalizeBlock(ctx context.Context, _a1 state.State, uncommittedState state.CurrentRoundState, blockID types.BlockID, block *types.Block, commit *types.Commit) (state.State, error) { - ret := _m.Called(ctx, _a1, uncommittedState, blockID, block, commit) +// FinalizeBlock provides a mock function for the type Executor +func (_mock *Executor) FinalizeBlock(ctx context.Context, state1 state.State, uncommittedState state.CurrentRoundState, blockID types.BlockID, block *types.Block, commit *types.Commit) (state.State, error) { + ret := _mock.Called(ctx, state1, uncommittedState, blockID, block, commit) if len(ret) == 0 { panic("no return value specified for FinalizeBlock") @@ -199,21 +210,19 @@ func (_m *Executor) FinalizeBlock(ctx context.Context, _a1 state.State, uncommit var r0 state.State var r1 error - if rf, ok := ret.Get(0).(func(context.Context, state.State, state.CurrentRoundState, types.BlockID, *types.Block, *types.Commit) (state.State, error)); ok { - return rf(ctx, _a1, uncommittedState, blockID, block, commit) + if returnFunc, ok := ret.Get(0).(func(context.Context, state.State, state.CurrentRoundState, types.BlockID, *types.Block, *types.Commit) (state.State, error)); ok { + return returnFunc(ctx, state1, uncommittedState, blockID, block, commit) } - if rf, ok := ret.Get(0).(func(context.Context, state.State, state.CurrentRoundState, types.BlockID, *types.Block, *types.Commit) state.State); ok { - r0 = rf(ctx, _a1, uncommittedState, blockID, block, commit) + if returnFunc, ok := ret.Get(0).(func(context.Context, state.State, state.CurrentRoundState, types.BlockID, *types.Block, *types.Commit) state.State); ok { + r0 = returnFunc(ctx, state1, uncommittedState, blockID, block, commit) } else { r0 = ret.Get(0).(state.State) } - - if rf, ok := ret.Get(1).(func(context.Context, state.State, state.CurrentRoundState, types.BlockID, *types.Block, *types.Commit) error); ok { - r1 = rf(ctx, _a1, uncommittedState, blockID, block, commit) + if returnFunc, ok := ret.Get(1).(func(context.Context, state.State, state.CurrentRoundState, types.BlockID, *types.Block, *types.Commit) error); ok { + r1 = returnFunc(ctx, state1, uncommittedState, blockID, block, commit) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -223,36 +232,36 @@ type Executor_FinalizeBlock_Call struct { } // FinalizeBlock is a helper method to define mock.On call -// - ctx context.Context -// - _a1 state.State -// - uncommittedState state.CurrentRoundState -// - blockID types.BlockID -// - block *types.Block -// - commit *types.Commit -func (_e *Executor_Expecter) FinalizeBlock(ctx interface{}, _a1 interface{}, uncommittedState interface{}, blockID interface{}, block interface{}, commit interface{}) *Executor_FinalizeBlock_Call { - return &Executor_FinalizeBlock_Call{Call: _e.mock.On("FinalizeBlock", ctx, _a1, uncommittedState, blockID, block, commit)} +// - ctx +// - state1 +// - uncommittedState +// - blockID +// - block +// - commit +func (_e *Executor_Expecter) FinalizeBlock(ctx interface{}, state1 interface{}, uncommittedState interface{}, blockID interface{}, block interface{}, commit interface{}) *Executor_FinalizeBlock_Call { + return &Executor_FinalizeBlock_Call{Call: _e.mock.On("FinalizeBlock", ctx, state1, uncommittedState, blockID, block, commit)} } -func (_c *Executor_FinalizeBlock_Call) Run(run func(ctx context.Context, _a1 state.State, uncommittedState state.CurrentRoundState, blockID types.BlockID, block *types.Block, commit *types.Commit)) *Executor_FinalizeBlock_Call { +func (_c *Executor_FinalizeBlock_Call) Run(run func(ctx context.Context, state1 state.State, uncommittedState state.CurrentRoundState, blockID types.BlockID, block *types.Block, commit *types.Commit)) *Executor_FinalizeBlock_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(state.State), args[2].(state.CurrentRoundState), args[3].(types.BlockID), args[4].(*types.Block), args[5].(*types.Commit)) }) return _c } -func (_c *Executor_FinalizeBlock_Call) Return(_a0 state.State, _a1 error) *Executor_FinalizeBlock_Call { - _c.Call.Return(_a0, _a1) +func (_c *Executor_FinalizeBlock_Call) Return(state11 state.State, err error) *Executor_FinalizeBlock_Call { + _c.Call.Return(state11, err) return _c } -func (_c *Executor_FinalizeBlock_Call) RunAndReturn(run func(context.Context, state.State, state.CurrentRoundState, types.BlockID, *types.Block, *types.Commit) (state.State, error)) *Executor_FinalizeBlock_Call { +func (_c *Executor_FinalizeBlock_Call) RunAndReturn(run func(ctx context.Context, state1 state.State, uncommittedState state.CurrentRoundState, blockID types.BlockID, block *types.Block, commit *types.Commit) (state.State, error)) *Executor_FinalizeBlock_Call { _c.Call.Return(run) return _c } -// ProcessProposal provides a mock function with given fields: ctx, block, round, _a3, verify -func (_m *Executor) ProcessProposal(ctx context.Context, block *types.Block, round int32, _a3 state.State, verify bool) (state.CurrentRoundState, error) { - ret := _m.Called(ctx, block, round, _a3, verify) +// ProcessProposal provides a mock function for the type Executor +func (_mock *Executor) ProcessProposal(ctx context.Context, block *types.Block, round int32, state1 state.State, verify bool) (state.CurrentRoundState, error) { + ret := _mock.Called(ctx, block, round, state1, verify) if len(ret) == 0 { panic("no return value specified for ProcessProposal") @@ -260,21 +269,19 @@ func (_m *Executor) ProcessProposal(ctx context.Context, block *types.Block, rou var r0 state.CurrentRoundState var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.Block, int32, state.State, bool) (state.CurrentRoundState, error)); ok { - return rf(ctx, block, round, _a3, verify) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.Block, int32, state.State, bool) (state.CurrentRoundState, error)); ok { + return returnFunc(ctx, block, round, state1, verify) } - if rf, ok := ret.Get(0).(func(context.Context, *types.Block, int32, state.State, bool) state.CurrentRoundState); ok { - r0 = rf(ctx, block, round, _a3, verify) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.Block, int32, state.State, bool) state.CurrentRoundState); ok { + r0 = returnFunc(ctx, block, round, state1, verify) } else { r0 = ret.Get(0).(state.CurrentRoundState) } - - if rf, ok := ret.Get(1).(func(context.Context, *types.Block, int32, state.State, bool) error); ok { - r1 = rf(ctx, block, round, _a3, verify) + if returnFunc, ok := ret.Get(1).(func(context.Context, *types.Block, int32, state.State, bool) error); ok { + r1 = returnFunc(ctx, block, round, state1, verify) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -284,47 +291,46 @@ type Executor_ProcessProposal_Call struct { } // ProcessProposal is a helper method to define mock.On call -// - ctx context.Context -// - block *types.Block -// - round int32 -// - _a3 state.State -// - verify bool -func (_e *Executor_Expecter) ProcessProposal(ctx interface{}, block interface{}, round interface{}, _a3 interface{}, verify interface{}) *Executor_ProcessProposal_Call { - return &Executor_ProcessProposal_Call{Call: _e.mock.On("ProcessProposal", ctx, block, round, _a3, verify)} +// - ctx +// - block +// - round +// - state1 +// - verify +func (_e *Executor_Expecter) ProcessProposal(ctx interface{}, block interface{}, round interface{}, state1 interface{}, verify interface{}) *Executor_ProcessProposal_Call { + return &Executor_ProcessProposal_Call{Call: _e.mock.On("ProcessProposal", ctx, block, round, state1, verify)} } -func (_c *Executor_ProcessProposal_Call) Run(run func(ctx context.Context, block *types.Block, round int32, _a3 state.State, verify bool)) *Executor_ProcessProposal_Call { +func (_c *Executor_ProcessProposal_Call) Run(run func(ctx context.Context, block *types.Block, round int32, state1 state.State, verify bool)) *Executor_ProcessProposal_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.Block), args[2].(int32), args[3].(state.State), args[4].(bool)) }) return _c } -func (_c *Executor_ProcessProposal_Call) Return(_a0 state.CurrentRoundState, _a1 error) *Executor_ProcessProposal_Call { - _c.Call.Return(_a0, _a1) +func (_c *Executor_ProcessProposal_Call) Return(currentRoundState state.CurrentRoundState, err error) *Executor_ProcessProposal_Call { + _c.Call.Return(currentRoundState, err) return _c } -func (_c *Executor_ProcessProposal_Call) RunAndReturn(run func(context.Context, *types.Block, int32, state.State, bool) (state.CurrentRoundState, error)) *Executor_ProcessProposal_Call { +func (_c *Executor_ProcessProposal_Call) RunAndReturn(run func(ctx context.Context, block *types.Block, round int32, state1 state.State, verify bool) (state.CurrentRoundState, error)) *Executor_ProcessProposal_Call { _c.Call.Return(run) return _c } -// ValidateBlock provides a mock function with given fields: ctx, _a1, block -func (_m *Executor) ValidateBlock(ctx context.Context, _a1 state.State, block *types.Block) error { - ret := _m.Called(ctx, _a1, block) +// ValidateBlock provides a mock function for the type Executor +func (_mock *Executor) ValidateBlock(ctx context.Context, state1 state.State, block *types.Block) error { + ret := _mock.Called(ctx, state1, block) if len(ret) == 0 { panic("no return value specified for ValidateBlock") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, state.State, *types.Block) error); ok { - r0 = rf(ctx, _a1, block) + if returnFunc, ok := ret.Get(0).(func(context.Context, state.State, *types.Block) error); ok { + r0 = returnFunc(ctx, state1, block) } else { r0 = ret.Error(0) } - return r0 } @@ -334,45 +340,44 @@ type Executor_ValidateBlock_Call struct { } // ValidateBlock is a helper method to define mock.On call -// - ctx context.Context -// - _a1 state.State -// - block *types.Block -func (_e *Executor_Expecter) ValidateBlock(ctx interface{}, _a1 interface{}, block interface{}) *Executor_ValidateBlock_Call { - return &Executor_ValidateBlock_Call{Call: _e.mock.On("ValidateBlock", ctx, _a1, block)} +// - ctx +// - state1 +// - block +func (_e *Executor_Expecter) ValidateBlock(ctx interface{}, state1 interface{}, block interface{}) *Executor_ValidateBlock_Call { + return &Executor_ValidateBlock_Call{Call: _e.mock.On("ValidateBlock", ctx, state1, block)} } -func (_c *Executor_ValidateBlock_Call) Run(run func(ctx context.Context, _a1 state.State, block *types.Block)) *Executor_ValidateBlock_Call { +func (_c *Executor_ValidateBlock_Call) Run(run func(ctx context.Context, state1 state.State, block *types.Block)) *Executor_ValidateBlock_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(state.State), args[2].(*types.Block)) }) return _c } -func (_c *Executor_ValidateBlock_Call) Return(_a0 error) *Executor_ValidateBlock_Call { - _c.Call.Return(_a0) +func (_c *Executor_ValidateBlock_Call) Return(err error) *Executor_ValidateBlock_Call { + _c.Call.Return(err) return _c } -func (_c *Executor_ValidateBlock_Call) RunAndReturn(run func(context.Context, state.State, *types.Block) error) *Executor_ValidateBlock_Call { +func (_c *Executor_ValidateBlock_Call) RunAndReturn(run func(ctx context.Context, state1 state.State, block *types.Block) error) *Executor_ValidateBlock_Call { _c.Call.Return(run) return _c } -// ValidateBlockWithRoundState provides a mock function with given fields: ctx, _a1, uncommittedState, block -func (_m *Executor) ValidateBlockWithRoundState(ctx context.Context, _a1 state.State, uncommittedState state.CurrentRoundState, block *types.Block) error { - ret := _m.Called(ctx, _a1, uncommittedState, block) +// ValidateBlockWithRoundState provides a mock function for the type Executor +func (_mock *Executor) ValidateBlockWithRoundState(ctx context.Context, state1 state.State, uncommittedState state.CurrentRoundState, block *types.Block) error { + ret := _mock.Called(ctx, state1, uncommittedState, block) if len(ret) == 0 { panic("no return value specified for ValidateBlockWithRoundState") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, state.State, state.CurrentRoundState, *types.Block) error); ok { - r0 = rf(ctx, _a1, uncommittedState, block) + if returnFunc, ok := ret.Get(0).(func(context.Context, state.State, state.CurrentRoundState, *types.Block) error); ok { + r0 = returnFunc(ctx, state1, uncommittedState, block) } else { r0 = ret.Error(0) } - return r0 } @@ -382,46 +387,45 @@ type Executor_ValidateBlockWithRoundState_Call struct { } // ValidateBlockWithRoundState is a helper method to define mock.On call -// - ctx context.Context -// - _a1 state.State -// - uncommittedState state.CurrentRoundState -// - block *types.Block -func (_e *Executor_Expecter) ValidateBlockWithRoundState(ctx interface{}, _a1 interface{}, uncommittedState interface{}, block interface{}) *Executor_ValidateBlockWithRoundState_Call { - return &Executor_ValidateBlockWithRoundState_Call{Call: _e.mock.On("ValidateBlockWithRoundState", ctx, _a1, uncommittedState, block)} +// - ctx +// - state1 +// - uncommittedState +// - block +func (_e *Executor_Expecter) ValidateBlockWithRoundState(ctx interface{}, state1 interface{}, uncommittedState interface{}, block interface{}) *Executor_ValidateBlockWithRoundState_Call { + return &Executor_ValidateBlockWithRoundState_Call{Call: _e.mock.On("ValidateBlockWithRoundState", ctx, state1, uncommittedState, block)} } -func (_c *Executor_ValidateBlockWithRoundState_Call) Run(run func(ctx context.Context, _a1 state.State, uncommittedState state.CurrentRoundState, block *types.Block)) *Executor_ValidateBlockWithRoundState_Call { +func (_c *Executor_ValidateBlockWithRoundState_Call) Run(run func(ctx context.Context, state1 state.State, uncommittedState state.CurrentRoundState, block *types.Block)) *Executor_ValidateBlockWithRoundState_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(state.State), args[2].(state.CurrentRoundState), args[3].(*types.Block)) }) return _c } -func (_c *Executor_ValidateBlockWithRoundState_Call) Return(_a0 error) *Executor_ValidateBlockWithRoundState_Call { - _c.Call.Return(_a0) +func (_c *Executor_ValidateBlockWithRoundState_Call) Return(err error) *Executor_ValidateBlockWithRoundState_Call { + _c.Call.Return(err) return _c } -func (_c *Executor_ValidateBlockWithRoundState_Call) RunAndReturn(run func(context.Context, state.State, state.CurrentRoundState, *types.Block) error) *Executor_ValidateBlockWithRoundState_Call { +func (_c *Executor_ValidateBlockWithRoundState_Call) RunAndReturn(run func(ctx context.Context, state1 state.State, uncommittedState state.CurrentRoundState, block *types.Block) error) *Executor_ValidateBlockWithRoundState_Call { _c.Call.Return(run) return _c } -// VerifyVoteExtension provides a mock function with given fields: ctx, vote -func (_m *Executor) VerifyVoteExtension(ctx context.Context, vote *types.Vote) error { - ret := _m.Called(ctx, vote) +// VerifyVoteExtension provides a mock function for the type Executor +func (_mock *Executor) VerifyVoteExtension(ctx context.Context, vote *types.Vote) error { + ret := _mock.Called(ctx, vote) if len(ret) == 0 { panic("no return value specified for VerifyVoteExtension") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *types.Vote) error); ok { - r0 = rf(ctx, vote) + if returnFunc, ok := ret.Get(0).(func(context.Context, *types.Vote) error); ok { + r0 = returnFunc(ctx, vote) } else { r0 = ret.Error(0) } - return r0 } @@ -431,8 +435,8 @@ type Executor_VerifyVoteExtension_Call struct { } // VerifyVoteExtension is a helper method to define mock.On call -// - ctx context.Context -// - vote *types.Vote +// - ctx +// - vote func (_e *Executor_Expecter) VerifyVoteExtension(ctx interface{}, vote interface{}) *Executor_VerifyVoteExtension_Call { return &Executor_VerifyVoteExtension_Call{Call: _e.mock.On("VerifyVoteExtension", ctx, vote)} } @@ -444,26 +448,12 @@ func (_c *Executor_VerifyVoteExtension_Call) Run(run func(ctx context.Context, v return _c } -func (_c *Executor_VerifyVoteExtension_Call) Return(_a0 error) *Executor_VerifyVoteExtension_Call { - _c.Call.Return(_a0) +func (_c *Executor_VerifyVoteExtension_Call) Return(err error) *Executor_VerifyVoteExtension_Call { + _c.Call.Return(err) return _c } -func (_c *Executor_VerifyVoteExtension_Call) RunAndReturn(run func(context.Context, *types.Vote) error) *Executor_VerifyVoteExtension_Call { +func (_c *Executor_VerifyVoteExtension_Call) RunAndReturn(run func(ctx context.Context, vote *types.Vote) error) *Executor_VerifyVoteExtension_Call { _c.Call.Return(run) return _c } - -// NewExecutor creates a new instance of Executor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewExecutor(t interface { - mock.TestingT - Cleanup(func()) -}) *Executor { - mock := &Executor{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/state/mocks/store.go b/internal/state/mocks/store.go index 499ce2c313..2248361979 100644 --- a/internal/state/mocks/store.go +++ b/internal/state/mocks/store.go @@ -1,16 +1,30 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - selectproposer "github.com/dashpay/tenderdash/internal/consensus/versioned/selectproposer" - state "github.com/dashpay/tenderdash/internal/state" + "github.com/dashpay/tenderdash/internal/consensus/versioned/selectproposer" + "github.com/dashpay/tenderdash/internal/state" + state0 "github.com/dashpay/tenderdash/proto/tendermint/state" + "github.com/dashpay/tenderdash/types" mock "github.com/stretchr/testify/mock" +) - tendermintstate "github.com/dashpay/tenderdash/proto/tendermint/state" +// NewStore creates a new instance of Store. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewStore(t interface { + mock.TestingT + Cleanup(func()) +}) *Store { + mock := &Store{} + mock.Mock.Test(t) - types "github.com/dashpay/tenderdash/types" -) + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} // Store is an autogenerated mock type for the Store type type Store struct { @@ -25,21 +39,20 @@ func (_m *Store) EXPECT() *Store_Expecter { return &Store_Expecter{mock: &_m.Mock} } -// Bootstrap provides a mock function with given fields: _a0 -func (_m *Store) Bootstrap(_a0 state.State) error { - ret := _m.Called(_a0) +// Bootstrap provides a mock function for the type Store +func (_mock *Store) Bootstrap(state1 state.State) error { + ret := _mock.Called(state1) if len(ret) == 0 { panic("no return value specified for Bootstrap") } var r0 error - if rf, ok := ret.Get(0).(func(state.State) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(state.State) error); ok { + r0 = returnFunc(state1) } else { r0 = ret.Error(0) } - return r0 } @@ -49,43 +62,42 @@ type Store_Bootstrap_Call struct { } // Bootstrap is a helper method to define mock.On call -// - _a0 state.State -func (_e *Store_Expecter) Bootstrap(_a0 interface{}) *Store_Bootstrap_Call { - return &Store_Bootstrap_Call{Call: _e.mock.On("Bootstrap", _a0)} +// - state1 +func (_e *Store_Expecter) Bootstrap(state1 interface{}) *Store_Bootstrap_Call { + return &Store_Bootstrap_Call{Call: _e.mock.On("Bootstrap", state1)} } -func (_c *Store_Bootstrap_Call) Run(run func(_a0 state.State)) *Store_Bootstrap_Call { +func (_c *Store_Bootstrap_Call) Run(run func(state1 state.State)) *Store_Bootstrap_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(state.State)) }) return _c } -func (_c *Store_Bootstrap_Call) Return(_a0 error) *Store_Bootstrap_Call { - _c.Call.Return(_a0) +func (_c *Store_Bootstrap_Call) Return(err error) *Store_Bootstrap_Call { + _c.Call.Return(err) return _c } -func (_c *Store_Bootstrap_Call) RunAndReturn(run func(state.State) error) *Store_Bootstrap_Call { +func (_c *Store_Bootstrap_Call) RunAndReturn(run func(state1 state.State) error) *Store_Bootstrap_Call { _c.Call.Return(run) return _c } -// Close provides a mock function with no fields -func (_m *Store) Close() error { - ret := _m.Called() +// Close provides a mock function for the type Store +func (_mock *Store) Close() error { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Close") } var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() error); ok { + r0 = returnFunc() } else { r0 = ret.Error(0) } - return r0 } @@ -106,8 +118,8 @@ func (_c *Store_Close_Call) Run(run func()) *Store_Close_Call { return _c } -func (_c *Store_Close_Call) Return(_a0 error) *Store_Close_Call { - _c.Call.Return(_a0) +func (_c *Store_Close_Call) Return(err error) *Store_Close_Call { + _c.Call.Return(err) return _c } @@ -116,9 +128,9 @@ func (_c *Store_Close_Call) RunAndReturn(run func() error) *Store_Close_Call { return _c } -// Load provides a mock function with no fields -func (_m *Store) Load() (state.State, error) { - ret := _m.Called() +// Load provides a mock function for the type Store +func (_mock *Store) Load() (state.State, error) { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Load") @@ -126,21 +138,19 @@ func (_m *Store) Load() (state.State, error) { var r0 state.State var r1 error - if rf, ok := ret.Get(0).(func() (state.State, error)); ok { - return rf() + if returnFunc, ok := ret.Get(0).(func() (state.State, error)); ok { + return returnFunc() } - if rf, ok := ret.Get(0).(func() state.State); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() state.State); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(state.State) } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() + if returnFunc, ok := ret.Get(1).(func() error); ok { + r1 = returnFunc() } else { r1 = ret.Error(1) } - return r0, r1 } @@ -161,8 +171,8 @@ func (_c *Store_Load_Call) Run(run func()) *Store_Load_Call { return _c } -func (_c *Store_Load_Call) Return(_a0 state.State, _a1 error) *Store_Load_Call { - _c.Call.Return(_a0, _a1) +func (_c *Store_Load_Call) Return(state1 state.State, err error) *Store_Load_Call { + _c.Call.Return(state1, err) return _c } @@ -171,33 +181,31 @@ func (_c *Store_Load_Call) RunAndReturn(run func() (state.State, error)) *Store_ return _c } -// LoadABCIResponses provides a mock function with given fields: _a0 -func (_m *Store) LoadABCIResponses(_a0 int64) (*tendermintstate.ABCIResponses, error) { - ret := _m.Called(_a0) +// LoadABCIResponses provides a mock function for the type Store +func (_mock *Store) LoadABCIResponses(n int64) (*state0.ABCIResponses, error) { + ret := _mock.Called(n) if len(ret) == 0 { panic("no return value specified for LoadABCIResponses") } - var r0 *tendermintstate.ABCIResponses + var r0 *state0.ABCIResponses var r1 error - if rf, ok := ret.Get(0).(func(int64) (*tendermintstate.ABCIResponses, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(int64) (*state0.ABCIResponses, error)); ok { + return returnFunc(n) } - if rf, ok := ret.Get(0).(func(int64) *tendermintstate.ABCIResponses); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(int64) *state0.ABCIResponses); ok { + r0 = returnFunc(n) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tendermintstate.ABCIResponses) + r0 = ret.Get(0).(*state0.ABCIResponses) } } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(n) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -207,31 +215,31 @@ type Store_LoadABCIResponses_Call struct { } // LoadABCIResponses is a helper method to define mock.On call -// - _a0 int64 -func (_e *Store_Expecter) LoadABCIResponses(_a0 interface{}) *Store_LoadABCIResponses_Call { - return &Store_LoadABCIResponses_Call{Call: _e.mock.On("LoadABCIResponses", _a0)} +// - n +func (_e *Store_Expecter) LoadABCIResponses(n interface{}) *Store_LoadABCIResponses_Call { + return &Store_LoadABCIResponses_Call{Call: _e.mock.On("LoadABCIResponses", n)} } -func (_c *Store_LoadABCIResponses_Call) Run(run func(_a0 int64)) *Store_LoadABCIResponses_Call { +func (_c *Store_LoadABCIResponses_Call) Run(run func(n int64)) *Store_LoadABCIResponses_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(int64)) }) return _c } -func (_c *Store_LoadABCIResponses_Call) Return(_a0 *tendermintstate.ABCIResponses, _a1 error) *Store_LoadABCIResponses_Call { - _c.Call.Return(_a0, _a1) +func (_c *Store_LoadABCIResponses_Call) Return(aBCIResponses *state0.ABCIResponses, err error) *Store_LoadABCIResponses_Call { + _c.Call.Return(aBCIResponses, err) return _c } -func (_c *Store_LoadABCIResponses_Call) RunAndReturn(run func(int64) (*tendermintstate.ABCIResponses, error)) *Store_LoadABCIResponses_Call { +func (_c *Store_LoadABCIResponses_Call) RunAndReturn(run func(n int64) (*state0.ABCIResponses, error)) *Store_LoadABCIResponses_Call { _c.Call.Return(run) return _c } -// LoadConsensusParams provides a mock function with given fields: _a0 -func (_m *Store) LoadConsensusParams(_a0 int64) (types.ConsensusParams, error) { - ret := _m.Called(_a0) +// LoadConsensusParams provides a mock function for the type Store +func (_mock *Store) LoadConsensusParams(n int64) (types.ConsensusParams, error) { + ret := _mock.Called(n) if len(ret) == 0 { panic("no return value specified for LoadConsensusParams") @@ -239,21 +247,19 @@ func (_m *Store) LoadConsensusParams(_a0 int64) (types.ConsensusParams, error) { var r0 types.ConsensusParams var r1 error - if rf, ok := ret.Get(0).(func(int64) (types.ConsensusParams, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(int64) (types.ConsensusParams, error)); ok { + return returnFunc(n) } - if rf, ok := ret.Get(0).(func(int64) types.ConsensusParams); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(int64) types.ConsensusParams); ok { + r0 = returnFunc(n) } else { r0 = ret.Get(0).(types.ConsensusParams) } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(n) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -263,31 +269,31 @@ type Store_LoadConsensusParams_Call struct { } // LoadConsensusParams is a helper method to define mock.On call -// - _a0 int64 -func (_e *Store_Expecter) LoadConsensusParams(_a0 interface{}) *Store_LoadConsensusParams_Call { - return &Store_LoadConsensusParams_Call{Call: _e.mock.On("LoadConsensusParams", _a0)} +// - n +func (_e *Store_Expecter) LoadConsensusParams(n interface{}) *Store_LoadConsensusParams_Call { + return &Store_LoadConsensusParams_Call{Call: _e.mock.On("LoadConsensusParams", n)} } -func (_c *Store_LoadConsensusParams_Call) Run(run func(_a0 int64)) *Store_LoadConsensusParams_Call { +func (_c *Store_LoadConsensusParams_Call) Run(run func(n int64)) *Store_LoadConsensusParams_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(int64)) }) return _c } -func (_c *Store_LoadConsensusParams_Call) Return(_a0 types.ConsensusParams, _a1 error) *Store_LoadConsensusParams_Call { - _c.Call.Return(_a0, _a1) +func (_c *Store_LoadConsensusParams_Call) Return(consensusParams types.ConsensusParams, err error) *Store_LoadConsensusParams_Call { + _c.Call.Return(consensusParams, err) return _c } -func (_c *Store_LoadConsensusParams_Call) RunAndReturn(run func(int64) (types.ConsensusParams, error)) *Store_LoadConsensusParams_Call { +func (_c *Store_LoadConsensusParams_Call) RunAndReturn(run func(n int64) (types.ConsensusParams, error)) *Store_LoadConsensusParams_Call { _c.Call.Return(run) return _c } -// LoadValidators provides a mock function with given fields: _a0, _a1 -func (_m *Store) LoadValidators(_a0 int64, _a1 selectproposer.BlockStore) (*types.ValidatorSet, error) { - ret := _m.Called(_a0, _a1) +// LoadValidators provides a mock function for the type Store +func (_mock *Store) LoadValidators(n int64, blockStore selectproposer.BlockStore) (*types.ValidatorSet, error) { + ret := _mock.Called(n, blockStore) if len(ret) == 0 { panic("no return value specified for LoadValidators") @@ -295,23 +301,21 @@ func (_m *Store) LoadValidators(_a0 int64, _a1 selectproposer.BlockStore) (*type var r0 *types.ValidatorSet var r1 error - if rf, ok := ret.Get(0).(func(int64, selectproposer.BlockStore) (*types.ValidatorSet, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(int64, selectproposer.BlockStore) (*types.ValidatorSet, error)); ok { + return returnFunc(n, blockStore) } - if rf, ok := ret.Get(0).(func(int64, selectproposer.BlockStore) *types.ValidatorSet); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(int64, selectproposer.BlockStore) *types.ValidatorSet); ok { + r0 = returnFunc(n, blockStore) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.ValidatorSet) } } - - if rf, ok := ret.Get(1).(func(int64, selectproposer.BlockStore) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(int64, selectproposer.BlockStore) error); ok { + r1 = returnFunc(n, blockStore) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -321,44 +325,43 @@ type Store_LoadValidators_Call struct { } // LoadValidators is a helper method to define mock.On call -// - _a0 int64 -// - _a1 selectproposer.BlockStore -func (_e *Store_Expecter) LoadValidators(_a0 interface{}, _a1 interface{}) *Store_LoadValidators_Call { - return &Store_LoadValidators_Call{Call: _e.mock.On("LoadValidators", _a0, _a1)} +// - n +// - blockStore +func (_e *Store_Expecter) LoadValidators(n interface{}, blockStore interface{}) *Store_LoadValidators_Call { + return &Store_LoadValidators_Call{Call: _e.mock.On("LoadValidators", n, blockStore)} } -func (_c *Store_LoadValidators_Call) Run(run func(_a0 int64, _a1 selectproposer.BlockStore)) *Store_LoadValidators_Call { +func (_c *Store_LoadValidators_Call) Run(run func(n int64, blockStore selectproposer.BlockStore)) *Store_LoadValidators_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(int64), args[1].(selectproposer.BlockStore)) }) return _c } -func (_c *Store_LoadValidators_Call) Return(_a0 *types.ValidatorSet, _a1 error) *Store_LoadValidators_Call { - _c.Call.Return(_a0, _a1) +func (_c *Store_LoadValidators_Call) Return(validatorSet *types.ValidatorSet, err error) *Store_LoadValidators_Call { + _c.Call.Return(validatorSet, err) return _c } -func (_c *Store_LoadValidators_Call) RunAndReturn(run func(int64, selectproposer.BlockStore) (*types.ValidatorSet, error)) *Store_LoadValidators_Call { +func (_c *Store_LoadValidators_Call) RunAndReturn(run func(n int64, blockStore selectproposer.BlockStore) (*types.ValidatorSet, error)) *Store_LoadValidators_Call { _c.Call.Return(run) return _c } -// PruneStates provides a mock function with given fields: _a0 -func (_m *Store) PruneStates(_a0 int64) error { - ret := _m.Called(_a0) +// PruneStates provides a mock function for the type Store +func (_mock *Store) PruneStates(n int64) error { + ret := _mock.Called(n) if len(ret) == 0 { panic("no return value specified for PruneStates") } var r0 error - if rf, ok := ret.Get(0).(func(int64) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(int64) error); ok { + r0 = returnFunc(n) } else { r0 = ret.Error(0) } - return r0 } @@ -368,43 +371,42 @@ type Store_PruneStates_Call struct { } // PruneStates is a helper method to define mock.On call -// - _a0 int64 -func (_e *Store_Expecter) PruneStates(_a0 interface{}) *Store_PruneStates_Call { - return &Store_PruneStates_Call{Call: _e.mock.On("PruneStates", _a0)} +// - n +func (_e *Store_Expecter) PruneStates(n interface{}) *Store_PruneStates_Call { + return &Store_PruneStates_Call{Call: _e.mock.On("PruneStates", n)} } -func (_c *Store_PruneStates_Call) Run(run func(_a0 int64)) *Store_PruneStates_Call { +func (_c *Store_PruneStates_Call) Run(run func(n int64)) *Store_PruneStates_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(int64)) }) return _c } -func (_c *Store_PruneStates_Call) Return(_a0 error) *Store_PruneStates_Call { - _c.Call.Return(_a0) +func (_c *Store_PruneStates_Call) Return(err error) *Store_PruneStates_Call { + _c.Call.Return(err) return _c } -func (_c *Store_PruneStates_Call) RunAndReturn(run func(int64) error) *Store_PruneStates_Call { +func (_c *Store_PruneStates_Call) RunAndReturn(run func(n int64) error) *Store_PruneStates_Call { _c.Call.Return(run) return _c } -// Save provides a mock function with given fields: _a0 -func (_m *Store) Save(_a0 state.State) error { - ret := _m.Called(_a0) +// Save provides a mock function for the type Store +func (_mock *Store) Save(state1 state.State) error { + ret := _mock.Called(state1) if len(ret) == 0 { panic("no return value specified for Save") } var r0 error - if rf, ok := ret.Get(0).(func(state.State) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(state.State) error); ok { + r0 = returnFunc(state1) } else { r0 = ret.Error(0) } - return r0 } @@ -414,43 +416,42 @@ type Store_Save_Call struct { } // Save is a helper method to define mock.On call -// - _a0 state.State -func (_e *Store_Expecter) Save(_a0 interface{}) *Store_Save_Call { - return &Store_Save_Call{Call: _e.mock.On("Save", _a0)} +// - state1 +func (_e *Store_Expecter) Save(state1 interface{}) *Store_Save_Call { + return &Store_Save_Call{Call: _e.mock.On("Save", state1)} } -func (_c *Store_Save_Call) Run(run func(_a0 state.State)) *Store_Save_Call { +func (_c *Store_Save_Call) Run(run func(state1 state.State)) *Store_Save_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(state.State)) }) return _c } -func (_c *Store_Save_Call) Return(_a0 error) *Store_Save_Call { - _c.Call.Return(_a0) +func (_c *Store_Save_Call) Return(err error) *Store_Save_Call { + _c.Call.Return(err) return _c } -func (_c *Store_Save_Call) RunAndReturn(run func(state.State) error) *Store_Save_Call { +func (_c *Store_Save_Call) RunAndReturn(run func(state1 state.State) error) *Store_Save_Call { _c.Call.Return(run) return _c } -// SaveABCIResponses provides a mock function with given fields: _a0, _a1 -func (_m *Store) SaveABCIResponses(_a0 int64, _a1 tendermintstate.ABCIResponses) error { - ret := _m.Called(_a0, _a1) +// SaveABCIResponses provides a mock function for the type Store +func (_mock *Store) SaveABCIResponses(n int64, aBCIResponses state0.ABCIResponses) error { + ret := _mock.Called(n, aBCIResponses) if len(ret) == 0 { panic("no return value specified for SaveABCIResponses") } var r0 error - if rf, ok := ret.Get(0).(func(int64, tendermintstate.ABCIResponses) error); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(int64, state0.ABCIResponses) error); ok { + r0 = returnFunc(n, aBCIResponses) } else { r0 = ret.Error(0) } - return r0 } @@ -460,44 +461,43 @@ type Store_SaveABCIResponses_Call struct { } // SaveABCIResponses is a helper method to define mock.On call -// - _a0 int64 -// - _a1 tendermintstate.ABCIResponses -func (_e *Store_Expecter) SaveABCIResponses(_a0 interface{}, _a1 interface{}) *Store_SaveABCIResponses_Call { - return &Store_SaveABCIResponses_Call{Call: _e.mock.On("SaveABCIResponses", _a0, _a1)} +// - n +// - aBCIResponses +func (_e *Store_Expecter) SaveABCIResponses(n interface{}, aBCIResponses interface{}) *Store_SaveABCIResponses_Call { + return &Store_SaveABCIResponses_Call{Call: _e.mock.On("SaveABCIResponses", n, aBCIResponses)} } -func (_c *Store_SaveABCIResponses_Call) Run(run func(_a0 int64, _a1 tendermintstate.ABCIResponses)) *Store_SaveABCIResponses_Call { +func (_c *Store_SaveABCIResponses_Call) Run(run func(n int64, aBCIResponses state0.ABCIResponses)) *Store_SaveABCIResponses_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(int64), args[1].(tendermintstate.ABCIResponses)) + run(args[0].(int64), args[1].(state0.ABCIResponses)) }) return _c } -func (_c *Store_SaveABCIResponses_Call) Return(_a0 error) *Store_SaveABCIResponses_Call { - _c.Call.Return(_a0) +func (_c *Store_SaveABCIResponses_Call) Return(err error) *Store_SaveABCIResponses_Call { + _c.Call.Return(err) return _c } -func (_c *Store_SaveABCIResponses_Call) RunAndReturn(run func(int64, tendermintstate.ABCIResponses) error) *Store_SaveABCIResponses_Call { +func (_c *Store_SaveABCIResponses_Call) RunAndReturn(run func(n int64, aBCIResponses state0.ABCIResponses) error) *Store_SaveABCIResponses_Call { _c.Call.Return(run) return _c } -// SaveValidatorSets provides a mock function with given fields: _a0, _a1, _a2 -func (_m *Store) SaveValidatorSets(_a0 int64, _a1 int64, _a2 *types.ValidatorSet) error { - ret := _m.Called(_a0, _a1, _a2) +// SaveValidatorSets provides a mock function for the type Store +func (_mock *Store) SaveValidatorSets(n int64, n1 int64, validatorSet *types.ValidatorSet) error { + ret := _mock.Called(n, n1, validatorSet) if len(ret) == 0 { panic("no return value specified for SaveValidatorSets") } var r0 error - if rf, ok := ret.Get(0).(func(int64, int64, *types.ValidatorSet) error); ok { - r0 = rf(_a0, _a1, _a2) + if returnFunc, ok := ret.Get(0).(func(int64, int64, *types.ValidatorSet) error); ok { + r0 = returnFunc(n, n1, validatorSet) } else { r0 = ret.Error(0) } - return r0 } @@ -507,40 +507,26 @@ type Store_SaveValidatorSets_Call struct { } // SaveValidatorSets is a helper method to define mock.On call -// - _a0 int64 -// - _a1 int64 -// - _a2 *types.ValidatorSet -func (_e *Store_Expecter) SaveValidatorSets(_a0 interface{}, _a1 interface{}, _a2 interface{}) *Store_SaveValidatorSets_Call { - return &Store_SaveValidatorSets_Call{Call: _e.mock.On("SaveValidatorSets", _a0, _a1, _a2)} +// - n +// - n1 +// - validatorSet +func (_e *Store_Expecter) SaveValidatorSets(n interface{}, n1 interface{}, validatorSet interface{}) *Store_SaveValidatorSets_Call { + return &Store_SaveValidatorSets_Call{Call: _e.mock.On("SaveValidatorSets", n, n1, validatorSet)} } -func (_c *Store_SaveValidatorSets_Call) Run(run func(_a0 int64, _a1 int64, _a2 *types.ValidatorSet)) *Store_SaveValidatorSets_Call { +func (_c *Store_SaveValidatorSets_Call) Run(run func(n int64, n1 int64, validatorSet *types.ValidatorSet)) *Store_SaveValidatorSets_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(int64), args[1].(int64), args[2].(*types.ValidatorSet)) }) return _c } -func (_c *Store_SaveValidatorSets_Call) Return(_a0 error) *Store_SaveValidatorSets_Call { - _c.Call.Return(_a0) +func (_c *Store_SaveValidatorSets_Call) Return(err error) *Store_SaveValidatorSets_Call { + _c.Call.Return(err) return _c } -func (_c *Store_SaveValidatorSets_Call) RunAndReturn(run func(int64, int64, *types.ValidatorSet) error) *Store_SaveValidatorSets_Call { +func (_c *Store_SaveValidatorSets_Call) RunAndReturn(run func(n int64, n1 int64, validatorSet *types.ValidatorSet) error) *Store_SaveValidatorSets_Call { _c.Call.Return(run) return _c } - -// NewStore creates a new instance of Store. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewStore(t interface { - mock.TestingT - Cleanup(func()) -}) *Store { - mock := &Store{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/statesync/mocks/consensusstateprovider.go b/internal/statesync/mocks/consensusstateprovider.go index 4f12038ac5..3ca8224372 100644 --- a/internal/statesync/mocks/consensusstateprovider.go +++ b/internal/statesync/mocks/consensusstateprovider.go @@ -1,13 +1,28 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( + "github.com/dashpay/tenderdash/types" mock "github.com/stretchr/testify/mock" - - types "github.com/dashpay/tenderdash/types" ) +// NewConsensusStateProvider creates a new instance of ConsensusStateProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewConsensusStateProvider(t interface { + mock.TestingT + Cleanup(func()) +}) *ConsensusStateProvider { + mock := &ConsensusStateProvider{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // ConsensusStateProvider is an autogenerated mock type for the ConsensusStateProvider type type ConsensusStateProvider struct { mock.Mock @@ -21,21 +36,20 @@ func (_m *ConsensusStateProvider) EXPECT() *ConsensusStateProvider_Expecter { return &ConsensusStateProvider_Expecter{mock: &_m.Mock} } -// GetCurrentHeight provides a mock function with no fields -func (_m *ConsensusStateProvider) GetCurrentHeight() int64 { - ret := _m.Called() +// GetCurrentHeight provides a mock function for the type ConsensusStateProvider +func (_mock *ConsensusStateProvider) GetCurrentHeight() int64 { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for GetCurrentHeight") } var r0 int64 - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() int64); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(int64) } - return r0 } @@ -56,8 +70,8 @@ func (_c *ConsensusStateProvider_GetCurrentHeight_Call) Run(run func()) *Consens return _c } -func (_c *ConsensusStateProvider_GetCurrentHeight_Call) Return(_a0 int64) *ConsensusStateProvider_GetCurrentHeight_Call { - _c.Call.Return(_a0) +func (_c *ConsensusStateProvider_GetCurrentHeight_Call) Return(n int64) *ConsensusStateProvider_GetCurrentHeight_Call { + _c.Call.Return(n) return _c } @@ -66,21 +80,20 @@ func (_c *ConsensusStateProvider_GetCurrentHeight_Call) RunAndReturn(run func() return _c } -// PublishCommitEvent provides a mock function with given fields: commit -func (_m *ConsensusStateProvider) PublishCommitEvent(commit *types.Commit) error { - ret := _m.Called(commit) +// PublishCommitEvent provides a mock function for the type ConsensusStateProvider +func (_mock *ConsensusStateProvider) PublishCommitEvent(commit *types.Commit) error { + ret := _mock.Called(commit) if len(ret) == 0 { panic("no return value specified for PublishCommitEvent") } var r0 error - if rf, ok := ret.Get(0).(func(*types.Commit) error); ok { - r0 = rf(commit) + if returnFunc, ok := ret.Get(0).(func(*types.Commit) error); ok { + r0 = returnFunc(commit) } else { r0 = ret.Error(0) } - return r0 } @@ -90,7 +103,7 @@ type ConsensusStateProvider_PublishCommitEvent_Call struct { } // PublishCommitEvent is a helper method to define mock.On call -// - commit *types.Commit +// - commit func (_e *ConsensusStateProvider_Expecter) PublishCommitEvent(commit interface{}) *ConsensusStateProvider_PublishCommitEvent_Call { return &ConsensusStateProvider_PublishCommitEvent_Call{Call: _e.mock.On("PublishCommitEvent", commit)} } @@ -102,26 +115,12 @@ func (_c *ConsensusStateProvider_PublishCommitEvent_Call) Run(run func(commit *t return _c } -func (_c *ConsensusStateProvider_PublishCommitEvent_Call) Return(_a0 error) *ConsensusStateProvider_PublishCommitEvent_Call { - _c.Call.Return(_a0) +func (_c *ConsensusStateProvider_PublishCommitEvent_Call) Return(err error) *ConsensusStateProvider_PublishCommitEvent_Call { + _c.Call.Return(err) return _c } -func (_c *ConsensusStateProvider_PublishCommitEvent_Call) RunAndReturn(run func(*types.Commit) error) *ConsensusStateProvider_PublishCommitEvent_Call { +func (_c *ConsensusStateProvider_PublishCommitEvent_Call) RunAndReturn(run func(commit *types.Commit) error) *ConsensusStateProvider_PublishCommitEvent_Call { _c.Call.Return(run) return _c } - -// NewConsensusStateProvider creates a new instance of ConsensusStateProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewConsensusStateProvider(t interface { - mock.TestingT - Cleanup(func()) -}) *ConsensusStateProvider { - mock := &ConsensusStateProvider{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/statesync/mocks/stateprovider.go b/internal/statesync/mocks/stateprovider.go index 8ac2b1544c..1428a5d48a 100644 --- a/internal/statesync/mocks/stateprovider.go +++ b/internal/statesync/mocks/stateprovider.go @@ -1,18 +1,31 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" - - bytes "github.com/dashpay/tenderdash/libs/bytes" + "context" + "github.com/dashpay/tenderdash/internal/state" + "github.com/dashpay/tenderdash/libs/bytes" + "github.com/dashpay/tenderdash/types" mock "github.com/stretchr/testify/mock" +) + +// NewStateProvider creates a new instance of StateProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewStateProvider(t interface { + mock.TestingT + Cleanup(func()) +}) *StateProvider { + mock := &StateProvider{} + mock.Mock.Test(t) - state "github.com/dashpay/tenderdash/internal/state" + t.Cleanup(func() { mock.AssertExpectations(t) }) - types "github.com/dashpay/tenderdash/types" -) + return mock +} // StateProvider is an autogenerated mock type for the StateProvider type type StateProvider struct { @@ -27,9 +40,9 @@ func (_m *StateProvider) EXPECT() *StateProvider_Expecter { return &StateProvider_Expecter{mock: &_m.Mock} } -// AppHash provides a mock function with given fields: ctx, height -func (_m *StateProvider) AppHash(ctx context.Context, height uint64) (bytes.HexBytes, error) { - ret := _m.Called(ctx, height) +// AppHash provides a mock function for the type StateProvider +func (_mock *StateProvider) AppHash(ctx context.Context, height uint64) (bytes.HexBytes, error) { + ret := _mock.Called(ctx, height) if len(ret) == 0 { panic("no return value specified for AppHash") @@ -37,23 +50,21 @@ func (_m *StateProvider) AppHash(ctx context.Context, height uint64) (bytes.HexB var r0 bytes.HexBytes var r1 error - if rf, ok := ret.Get(0).(func(context.Context, uint64) (bytes.HexBytes, error)); ok { - return rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, uint64) (bytes.HexBytes, error)); ok { + return returnFunc(ctx, height) } - if rf, ok := ret.Get(0).(func(context.Context, uint64) bytes.HexBytes); ok { - r0 = rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, uint64) bytes.HexBytes); ok { + r0 = returnFunc(ctx, height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(bytes.HexBytes) } } - - if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { - r1 = rf(ctx, height) + if returnFunc, ok := ret.Get(1).(func(context.Context, uint64) error); ok { + r1 = returnFunc(ctx, height) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -63,8 +74,8 @@ type StateProvider_AppHash_Call struct { } // AppHash is a helper method to define mock.On call -// - ctx context.Context -// - height uint64 +// - ctx +// - height func (_e *StateProvider_Expecter) AppHash(ctx interface{}, height interface{}) *StateProvider_AppHash_Call { return &StateProvider_AppHash_Call{Call: _e.mock.On("AppHash", ctx, height)} } @@ -76,19 +87,19 @@ func (_c *StateProvider_AppHash_Call) Run(run func(ctx context.Context, height u return _c } -func (_c *StateProvider_AppHash_Call) Return(_a0 bytes.HexBytes, _a1 error) *StateProvider_AppHash_Call { - _c.Call.Return(_a0, _a1) +func (_c *StateProvider_AppHash_Call) Return(hexBytes bytes.HexBytes, err error) *StateProvider_AppHash_Call { + _c.Call.Return(hexBytes, err) return _c } -func (_c *StateProvider_AppHash_Call) RunAndReturn(run func(context.Context, uint64) (bytes.HexBytes, error)) *StateProvider_AppHash_Call { +func (_c *StateProvider_AppHash_Call) RunAndReturn(run func(ctx context.Context, height uint64) (bytes.HexBytes, error)) *StateProvider_AppHash_Call { _c.Call.Return(run) return _c } -// Commit provides a mock function with given fields: ctx, height -func (_m *StateProvider) Commit(ctx context.Context, height uint64) (*types.Commit, error) { - ret := _m.Called(ctx, height) +// Commit provides a mock function for the type StateProvider +func (_mock *StateProvider) Commit(ctx context.Context, height uint64) (*types.Commit, error) { + ret := _mock.Called(ctx, height) if len(ret) == 0 { panic("no return value specified for Commit") @@ -96,23 +107,21 @@ func (_m *StateProvider) Commit(ctx context.Context, height uint64) (*types.Comm var r0 *types.Commit var r1 error - if rf, ok := ret.Get(0).(func(context.Context, uint64) (*types.Commit, error)); ok { - return rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, uint64) (*types.Commit, error)); ok { + return returnFunc(ctx, height) } - if rf, ok := ret.Get(0).(func(context.Context, uint64) *types.Commit); ok { - r0 = rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, uint64) *types.Commit); ok { + r0 = returnFunc(ctx, height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.Commit) } } - - if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { - r1 = rf(ctx, height) + if returnFunc, ok := ret.Get(1).(func(context.Context, uint64) error); ok { + r1 = returnFunc(ctx, height) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -122,8 +131,8 @@ type StateProvider_Commit_Call struct { } // Commit is a helper method to define mock.On call -// - ctx context.Context -// - height uint64 +// - ctx +// - height func (_e *StateProvider_Expecter) Commit(ctx interface{}, height interface{}) *StateProvider_Commit_Call { return &StateProvider_Commit_Call{Call: _e.mock.On("Commit", ctx, height)} } @@ -135,19 +144,19 @@ func (_c *StateProvider_Commit_Call) Run(run func(ctx context.Context, height ui return _c } -func (_c *StateProvider_Commit_Call) Return(_a0 *types.Commit, _a1 error) *StateProvider_Commit_Call { - _c.Call.Return(_a0, _a1) +func (_c *StateProvider_Commit_Call) Return(commit *types.Commit, err error) *StateProvider_Commit_Call { + _c.Call.Return(commit, err) return _c } -func (_c *StateProvider_Commit_Call) RunAndReturn(run func(context.Context, uint64) (*types.Commit, error)) *StateProvider_Commit_Call { +func (_c *StateProvider_Commit_Call) RunAndReturn(run func(ctx context.Context, height uint64) (*types.Commit, error)) *StateProvider_Commit_Call { _c.Call.Return(run) return _c } -// State provides a mock function with given fields: ctx, height -func (_m *StateProvider) State(ctx context.Context, height uint64) (state.State, error) { - ret := _m.Called(ctx, height) +// State provides a mock function for the type StateProvider +func (_mock *StateProvider) State(ctx context.Context, height uint64) (state.State, error) { + ret := _mock.Called(ctx, height) if len(ret) == 0 { panic("no return value specified for State") @@ -155,21 +164,19 @@ func (_m *StateProvider) State(ctx context.Context, height uint64) (state.State, var r0 state.State var r1 error - if rf, ok := ret.Get(0).(func(context.Context, uint64) (state.State, error)); ok { - return rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, uint64) (state.State, error)); ok { + return returnFunc(ctx, height) } - if rf, ok := ret.Get(0).(func(context.Context, uint64) state.State); ok { - r0 = rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, uint64) state.State); ok { + r0 = returnFunc(ctx, height) } else { r0 = ret.Get(0).(state.State) } - - if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { - r1 = rf(ctx, height) + if returnFunc, ok := ret.Get(1).(func(context.Context, uint64) error); ok { + r1 = returnFunc(ctx, height) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -179,8 +186,8 @@ type StateProvider_State_Call struct { } // State is a helper method to define mock.On call -// - ctx context.Context -// - height uint64 +// - ctx +// - height func (_e *StateProvider_Expecter) State(ctx interface{}, height interface{}) *StateProvider_State_Call { return &StateProvider_State_Call{Call: _e.mock.On("State", ctx, height)} } @@ -192,26 +199,12 @@ func (_c *StateProvider_State_Call) Run(run func(ctx context.Context, height uin return _c } -func (_c *StateProvider_State_Call) Return(_a0 state.State, _a1 error) *StateProvider_State_Call { - _c.Call.Return(_a0, _a1) +func (_c *StateProvider_State_Call) Return(state1 state.State, err error) *StateProvider_State_Call { + _c.Call.Return(state1, err) return _c } -func (_c *StateProvider_State_Call) RunAndReturn(run func(context.Context, uint64) (state.State, error)) *StateProvider_State_Call { +func (_c *StateProvider_State_Call) RunAndReturn(run func(ctx context.Context, height uint64) (state.State, error)) *StateProvider_State_Call { _c.Call.Return(run) return _c } - -// NewStateProvider creates a new instance of StateProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewStateProvider(t interface { - mock.TestingT - Cleanup(func()) -}) *StateProvider { - mock := &StateProvider{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/libs/store/mocks/store.go b/libs/store/mocks/store.go index bf43f9b904..39b7a9127f 100644 --- a/libs/store/mocks/store.go +++ b/libs/store/mocks/store.go @@ -1,12 +1,28 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - store "github.com/dashpay/tenderdash/libs/store" + "github.com/dashpay/tenderdash/libs/store" mock "github.com/stretchr/testify/mock" ) +// NewStore creates a new instance of Store. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewStore[K comparable, V any](t interface { + mock.TestingT + Cleanup(func()) +}) *Store[K, V] { + mock := &Store[K, V]{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Store is an autogenerated mock type for the Store type type Store[K comparable, V any] struct { mock.Mock @@ -20,23 +36,22 @@ func (_m *Store[K, V]) EXPECT() *Store_Expecter[K, V] { return &Store_Expecter[K, V]{mock: &_m.Mock} } -// All provides a mock function with no fields -func (_m *Store[K, V]) All() []V { - ret := _m.Called() +// All provides a mock function for the type Store +func (_mock *Store[K, V]) All() []V { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for All") } var r0 []V - if rf, ok := ret.Get(0).(func() []V); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() []V); ok { + r0 = returnFunc() } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]V) } } - return r0 } @@ -57,8 +72,8 @@ func (_c *Store_All_Call[K, V]) Run(run func()) *Store_All_Call[K, V] { return _c } -func (_c *Store_All_Call[K, V]) Return(_a0 []V) *Store_All_Call[K, V] { - _c.Call.Return(_a0) +func (_c *Store_All_Call[K, V]) Return(vs []V) *Store_All_Call[K, V] { + _c.Call.Return(vs) return _c } @@ -67,9 +82,10 @@ func (_c *Store_All_Call[K, V]) RunAndReturn(run func() []V) *Store_All_Call[K, return _c } -// Delete provides a mock function with given fields: key -func (_m *Store[K, V]) Delete(key K) { - _m.Called(key) +// Delete provides a mock function for the type Store +func (_mock *Store[K, V]) Delete(key K) { + _mock.Called(key) + return } // Store_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' @@ -78,7 +94,7 @@ type Store_Delete_Call[K comparable, V any] struct { } // Delete is a helper method to define mock.On call -// - key K +// - key func (_e *Store_Expecter[K, V]) Delete(key interface{}) *Store_Delete_Call[K, V] { return &Store_Delete_Call[K, V]{Call: _e.mock.On("Delete", key)} } @@ -95,14 +111,14 @@ func (_c *Store_Delete_Call[K, V]) Return() *Store_Delete_Call[K, V] { return _c } -func (_c *Store_Delete_Call[K, V]) RunAndReturn(run func(K)) *Store_Delete_Call[K, V] { +func (_c *Store_Delete_Call[K, V]) RunAndReturn(run func(key K)) *Store_Delete_Call[K, V] { _c.Run(run) return _c } -// Get provides a mock function with given fields: key -func (_m *Store[K, V]) Get(key K) (V, bool) { - ret := _m.Called(key) +// Get provides a mock function for the type Store +func (_mock *Store[K, V]) Get(key K) (V, bool) { + ret := _mock.Called(key) if len(ret) == 0 { panic("no return value specified for Get") @@ -110,23 +126,21 @@ func (_m *Store[K, V]) Get(key K) (V, bool) { var r0 V var r1 bool - if rf, ok := ret.Get(0).(func(K) (V, bool)); ok { - return rf(key) + if returnFunc, ok := ret.Get(0).(func(K) (V, bool)); ok { + return returnFunc(key) } - if rf, ok := ret.Get(0).(func(K) V); ok { - r0 = rf(key) + if returnFunc, ok := ret.Get(0).(func(K) V); ok { + r0 = returnFunc(key) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(V) } } - - if rf, ok := ret.Get(1).(func(K) bool); ok { - r1 = rf(key) + if returnFunc, ok := ret.Get(1).(func(K) bool); ok { + r1 = returnFunc(key) } else { r1 = ret.Get(1).(bool) } - return r0, r1 } @@ -136,7 +150,7 @@ type Store_Get_Call[K comparable, V any] struct { } // Get is a helper method to define mock.On call -// - key K +// - key func (_e *Store_Expecter[K, V]) Get(key interface{}) *Store_Get_Call[K, V] { return &Store_Get_Call[K, V]{Call: _e.mock.On("Get", key)} } @@ -148,19 +162,19 @@ func (_c *Store_Get_Call[K, V]) Run(run func(key K)) *Store_Get_Call[K, V] { return _c } -func (_c *Store_Get_Call[K, V]) Return(_a0 V, _a1 bool) *Store_Get_Call[K, V] { - _c.Call.Return(_a0, _a1) +func (_c *Store_Get_Call[K, V]) Return(v V, b bool) *Store_Get_Call[K, V] { + _c.Call.Return(v, b) return _c } -func (_c *Store_Get_Call[K, V]) RunAndReturn(run func(K) (V, bool)) *Store_Get_Call[K, V] { +func (_c *Store_Get_Call[K, V]) RunAndReturn(run func(key K) (V, bool)) *Store_Get_Call[K, V] { _c.Call.Return(run) return _c } -// GetAndDelete provides a mock function with given fields: key -func (_m *Store[K, V]) GetAndDelete(key K) (V, bool) { - ret := _m.Called(key) +// GetAndDelete provides a mock function for the type Store +func (_mock *Store[K, V]) GetAndDelete(key K) (V, bool) { + ret := _mock.Called(key) if len(ret) == 0 { panic("no return value specified for GetAndDelete") @@ -168,23 +182,21 @@ func (_m *Store[K, V]) GetAndDelete(key K) (V, bool) { var r0 V var r1 bool - if rf, ok := ret.Get(0).(func(K) (V, bool)); ok { - return rf(key) + if returnFunc, ok := ret.Get(0).(func(K) (V, bool)); ok { + return returnFunc(key) } - if rf, ok := ret.Get(0).(func(K) V); ok { - r0 = rf(key) + if returnFunc, ok := ret.Get(0).(func(K) V); ok { + r0 = returnFunc(key) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(V) } } - - if rf, ok := ret.Get(1).(func(K) bool); ok { - r1 = rf(key) + if returnFunc, ok := ret.Get(1).(func(K) bool); ok { + r1 = returnFunc(key) } else { r1 = ret.Get(1).(bool) } - return r0, r1 } @@ -194,7 +206,7 @@ type Store_GetAndDelete_Call[K comparable, V any] struct { } // GetAndDelete is a helper method to define mock.On call -// - key K +// - key func (_e *Store_Expecter[K, V]) GetAndDelete(key interface{}) *Store_GetAndDelete_Call[K, V] { return &Store_GetAndDelete_Call[K, V]{Call: _e.mock.On("GetAndDelete", key)} } @@ -206,31 +218,30 @@ func (_c *Store_GetAndDelete_Call[K, V]) Run(run func(key K)) *Store_GetAndDelet return _c } -func (_c *Store_GetAndDelete_Call[K, V]) Return(_a0 V, _a1 bool) *Store_GetAndDelete_Call[K, V] { - _c.Call.Return(_a0, _a1) +func (_c *Store_GetAndDelete_Call[K, V]) Return(v V, b bool) *Store_GetAndDelete_Call[K, V] { + _c.Call.Return(v, b) return _c } -func (_c *Store_GetAndDelete_Call[K, V]) RunAndReturn(run func(K) (V, bool)) *Store_GetAndDelete_Call[K, V] { +func (_c *Store_GetAndDelete_Call[K, V]) RunAndReturn(run func(key K) (V, bool)) *Store_GetAndDelete_Call[K, V] { _c.Call.Return(run) return _c } -// IsZero provides a mock function with no fields -func (_m *Store[K, V]) IsZero() bool { - ret := _m.Called() +// IsZero provides a mock function for the type Store +func (_mock *Store[K, V]) IsZero() bool { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for IsZero") } var r0 bool - if rf, ok := ret.Get(0).(func() bool); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() bool); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(bool) } - return r0 } @@ -251,8 +262,8 @@ func (_c *Store_IsZero_Call[K, V]) Run(run func()) *Store_IsZero_Call[K, V] { return _c } -func (_c *Store_IsZero_Call[K, V]) Return(_a0 bool) *Store_IsZero_Call[K, V] { - _c.Call.Return(_a0) +func (_c *Store_IsZero_Call[K, V]) Return(b bool) *Store_IsZero_Call[K, V] { + _c.Call.Return(b) return _c } @@ -261,21 +272,20 @@ func (_c *Store_IsZero_Call[K, V]) RunAndReturn(run func() bool) *Store_IsZero_C return _c } -// Len provides a mock function with no fields -func (_m *Store[K, V]) Len() int { - ret := _m.Called() +// Len provides a mock function for the type Store +func (_mock *Store[K, V]) Len() int { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Len") } var r0 int - if rf, ok := ret.Get(0).(func() int); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() int); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(int) } - return r0 } @@ -296,8 +306,8 @@ func (_c *Store_Len_Call[K, V]) Run(run func()) *Store_Len_Call[K, V] { return _c } -func (_c *Store_Len_Call[K, V]) Return(_a0 int) *Store_Len_Call[K, V] { - _c.Call.Return(_a0) +func (_c *Store_Len_Call[K, V]) Return(n int) *Store_Len_Call[K, V] { + _c.Call.Return(n) return _c } @@ -306,9 +316,10 @@ func (_c *Store_Len_Call[K, V]) RunAndReturn(run func() int) *Store_Len_Call[K, return _c } -// Put provides a mock function with given fields: key, data -func (_m *Store[K, V]) Put(key K, data V) { - _m.Called(key, data) +// Put provides a mock function for the type Store +func (_mock *Store[K, V]) Put(key K, data V) { + _mock.Called(key, data) + return } // Store_Put_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Put' @@ -317,8 +328,8 @@ type Store_Put_Call[K comparable, V any] struct { } // Put is a helper method to define mock.On call -// - key K -// - data V +// - key +// - data func (_e *Store_Expecter[K, V]) Put(key interface{}, data interface{}) *Store_Put_Call[K, V] { return &Store_Put_Call[K, V]{Call: _e.mock.On("Put", key, data)} } @@ -335,28 +346,27 @@ func (_c *Store_Put_Call[K, V]) Return() *Store_Put_Call[K, V] { return _c } -func (_c *Store_Put_Call[K, V]) RunAndReturn(run func(K, V)) *Store_Put_Call[K, V] { +func (_c *Store_Put_Call[K, V]) RunAndReturn(run func(key K, data V)) *Store_Put_Call[K, V] { _c.Run(run) return _c } -// Query provides a mock function with given fields: spec, limit -func (_m *Store[K, V]) Query(spec store.QueryFunc[K, V], limit int) []V { - ret := _m.Called(spec, limit) +// Query provides a mock function for the type Store +func (_mock *Store[K, V]) Query(spec store.QueryFunc[K, V], limit int) []V { + ret := _mock.Called(spec, limit) if len(ret) == 0 { panic("no return value specified for Query") } var r0 []V - if rf, ok := ret.Get(0).(func(store.QueryFunc[K, V], int) []V); ok { - r0 = rf(spec, limit) + if returnFunc, ok := ret.Get(0).(func(store.QueryFunc[K, V], int) []V); ok { + r0 = returnFunc(spec, limit) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]V) } } - return r0 } @@ -366,8 +376,8 @@ type Store_Query_Call[K comparable, V any] struct { } // Query is a helper method to define mock.On call -// - spec store.QueryFunc[K,V] -// - limit int +// - spec +// - limit func (_e *Store_Expecter[K, V]) Query(spec interface{}, limit interface{}) *Store_Query_Call[K, V] { return &Store_Query_Call[K, V]{Call: _e.mock.On("Query", spec, limit)} } @@ -379,26 +389,25 @@ func (_c *Store_Query_Call[K, V]) Run(run func(spec store.QueryFunc[K, V], limit return _c } -func (_c *Store_Query_Call[K, V]) Return(_a0 []V) *Store_Query_Call[K, V] { - _c.Call.Return(_a0) +func (_c *Store_Query_Call[K, V]) Return(vs []V) *Store_Query_Call[K, V] { + _c.Call.Return(vs) return _c } -func (_c *Store_Query_Call[K, V]) RunAndReturn(run func(store.QueryFunc[K, V], int) []V) *Store_Query_Call[K, V] { +func (_c *Store_Query_Call[K, V]) RunAndReturn(run func(spec store.QueryFunc[K, V], limit int) []V) *Store_Query_Call[K, V] { _c.Call.Return(run) return _c } -// Update provides a mock function with given fields: key, updates -func (_m *Store[K, V]) Update(key K, updates ...store.UpdateFunc[K, V]) { - _va := make([]interface{}, len(updates)) - for _i := range updates { - _va[_i] = updates[_i] +// Update provides a mock function for the type Store +func (_mock *Store[K, V]) Update(key K, updates ...store.UpdateFunc[K, V]) { + if len(updates) > 0 { + _mock.Called(key, updates) + } else { + _mock.Called(key) } - var _ca []interface{} - _ca = append(_ca, key) - _ca = append(_ca, _va...) - _m.Called(_ca...) + + return } // Store_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' @@ -407,8 +416,8 @@ type Store_Update_Call[K comparable, V any] struct { } // Update is a helper method to define mock.On call -// - key K -// - updates ...store.UpdateFunc[K,V] +// - key +// - updates func (_e *Store_Expecter[K, V]) Update(key interface{}, updates ...interface{}) *Store_Update_Call[K, V] { return &Store_Update_Call[K, V]{Call: _e.mock.On("Update", append([]interface{}{key}, updates...)...)} @@ -416,12 +425,7 @@ func (_e *Store_Expecter[K, V]) Update(key interface{}, updates ...interface{}) func (_c *Store_Update_Call[K, V]) Run(run func(key K, updates ...store.UpdateFunc[K, V])) *Store_Update_Call[K, V] { _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]store.UpdateFunc[K, V], len(args)-1) - for i, a := range args[1:] { - if a != nil { - variadicArgs[i] = a.(store.UpdateFunc[K, V]) - } - } + variadicArgs := args[1].([]store.UpdateFunc[K, V]) run(args[0].(K), variadicArgs...) }) return _c @@ -432,21 +436,7 @@ func (_c *Store_Update_Call[K, V]) Return() *Store_Update_Call[K, V] { return _c } -func (_c *Store_Update_Call[K, V]) RunAndReturn(run func(K, ...store.UpdateFunc[K, V])) *Store_Update_Call[K, V] { +func (_c *Store_Update_Call[K, V]) RunAndReturn(run func(key K, updates ...store.UpdateFunc[K, V])) *Store_Update_Call[K, V] { _c.Run(run) return _c } - -// NewStore creates a new instance of Store. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewStore[K comparable, V any](t interface { - mock.TestingT - Cleanup(func()) -}) *Store[K, V] { - mock := &Store[K, V]{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/light/provider/mocks/provider.go b/light/provider/mocks/provider.go index 08e6a15f5e..d8775300ea 100644 --- a/light/provider/mocks/provider.go +++ b/light/provider/mocks/provider.go @@ -1,15 +1,30 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" + "github.com/dashpay/tenderdash/types" mock "github.com/stretchr/testify/mock" - - types "github.com/dashpay/tenderdash/types" ) +// NewProvider creates a new instance of Provider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewProvider(t interface { + mock.TestingT + Cleanup(func()) +}) *Provider { + mock := &Provider{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // Provider is an autogenerated mock type for the Provider type type Provider struct { mock.Mock @@ -23,21 +38,20 @@ func (_m *Provider) EXPECT() *Provider_Expecter { return &Provider_Expecter{mock: &_m.Mock} } -// ID provides a mock function with no fields -func (_m *Provider) ID() string { - ret := _m.Called() +// ID provides a mock function for the type Provider +func (_mock *Provider) ID() string { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for ID") } var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(string) } - return r0 } @@ -58,8 +72,8 @@ func (_c *Provider_ID_Call) Run(run func()) *Provider_ID_Call { return _c } -func (_c *Provider_ID_Call) Return(_a0 string) *Provider_ID_Call { - _c.Call.Return(_a0) +func (_c *Provider_ID_Call) Return(s string) *Provider_ID_Call { + _c.Call.Return(s) return _c } @@ -68,9 +82,9 @@ func (_c *Provider_ID_Call) RunAndReturn(run func() string) *Provider_ID_Call { return _c } -// LightBlock provides a mock function with given fields: ctx, height -func (_m *Provider) LightBlock(ctx context.Context, height int64) (*types.LightBlock, error) { - ret := _m.Called(ctx, height) +// LightBlock provides a mock function for the type Provider +func (_mock *Provider) LightBlock(ctx context.Context, height int64) (*types.LightBlock, error) { + ret := _mock.Called(ctx, height) if len(ret) == 0 { panic("no return value specified for LightBlock") @@ -78,23 +92,21 @@ func (_m *Provider) LightBlock(ctx context.Context, height int64) (*types.LightB var r0 *types.LightBlock var r1 error - if rf, ok := ret.Get(0).(func(context.Context, int64) (*types.LightBlock, error)); ok { - return rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, int64) (*types.LightBlock, error)); ok { + return returnFunc(ctx, height) } - if rf, ok := ret.Get(0).(func(context.Context, int64) *types.LightBlock); ok { - r0 = rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, int64) *types.LightBlock); ok { + r0 = returnFunc(ctx, height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.LightBlock) } } - - if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok { - r1 = rf(ctx, height) + if returnFunc, ok := ret.Get(1).(func(context.Context, int64) error); ok { + r1 = returnFunc(ctx, height) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -104,8 +116,8 @@ type Provider_LightBlock_Call struct { } // LightBlock is a helper method to define mock.On call -// - ctx context.Context -// - height int64 +// - ctx +// - height func (_e *Provider_Expecter) LightBlock(ctx interface{}, height interface{}) *Provider_LightBlock_Call { return &Provider_LightBlock_Call{Call: _e.mock.On("LightBlock", ctx, height)} } @@ -117,31 +129,30 @@ func (_c *Provider_LightBlock_Call) Run(run func(ctx context.Context, height int return _c } -func (_c *Provider_LightBlock_Call) Return(_a0 *types.LightBlock, _a1 error) *Provider_LightBlock_Call { - _c.Call.Return(_a0, _a1) +func (_c *Provider_LightBlock_Call) Return(lightBlock *types.LightBlock, err error) *Provider_LightBlock_Call { + _c.Call.Return(lightBlock, err) return _c } -func (_c *Provider_LightBlock_Call) RunAndReturn(run func(context.Context, int64) (*types.LightBlock, error)) *Provider_LightBlock_Call { +func (_c *Provider_LightBlock_Call) RunAndReturn(run func(ctx context.Context, height int64) (*types.LightBlock, error)) *Provider_LightBlock_Call { _c.Call.Return(run) return _c } -// ReportEvidence provides a mock function with given fields: _a0, _a1 -func (_m *Provider) ReportEvidence(_a0 context.Context, _a1 types.Evidence) error { - ret := _m.Called(_a0, _a1) +// ReportEvidence provides a mock function for the type Provider +func (_mock *Provider) ReportEvidence(context1 context.Context, evidence types.Evidence) error { + ret := _mock.Called(context1, evidence) if len(ret) == 0 { panic("no return value specified for ReportEvidence") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) error); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Evidence) error); ok { + r0 = returnFunc(context1, evidence) } else { r0 = ret.Error(0) } - return r0 } @@ -151,39 +162,25 @@ type Provider_ReportEvidence_Call struct { } // ReportEvidence is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.Evidence -func (_e *Provider_Expecter) ReportEvidence(_a0 interface{}, _a1 interface{}) *Provider_ReportEvidence_Call { - return &Provider_ReportEvidence_Call{Call: _e.mock.On("ReportEvidence", _a0, _a1)} +// - context1 +// - evidence +func (_e *Provider_Expecter) ReportEvidence(context1 interface{}, evidence interface{}) *Provider_ReportEvidence_Call { + return &Provider_ReportEvidence_Call{Call: _e.mock.On("ReportEvidence", context1, evidence)} } -func (_c *Provider_ReportEvidence_Call) Run(run func(_a0 context.Context, _a1 types.Evidence)) *Provider_ReportEvidence_Call { +func (_c *Provider_ReportEvidence_Call) Run(run func(context1 context.Context, evidence types.Evidence)) *Provider_ReportEvidence_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.Evidence)) }) return _c } -func (_c *Provider_ReportEvidence_Call) Return(_a0 error) *Provider_ReportEvidence_Call { - _c.Call.Return(_a0) +func (_c *Provider_ReportEvidence_Call) Return(err error) *Provider_ReportEvidence_Call { + _c.Call.Return(err) return _c } -func (_c *Provider_ReportEvidence_Call) RunAndReturn(run func(context.Context, types.Evidence) error) *Provider_ReportEvidence_Call { +func (_c *Provider_ReportEvidence_Call) RunAndReturn(run func(context1 context.Context, evidence types.Evidence) error) *Provider_ReportEvidence_Call { _c.Call.Return(run) return _c } - -// NewProvider creates a new instance of Provider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewProvider(t interface { - mock.TestingT - Cleanup(func()) -}) *Provider { - mock := &Provider{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/light/rpc/mocks/lightclient.go b/light/rpc/mocks/lightclient.go index 0856f41f81..cab3d456d3 100644 --- a/light/rpc/mocks/lightclient.go +++ b/light/rpc/mocks/lightclient.go @@ -1,16 +1,30 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - context "context" + "context" + "time" + "github.com/dashpay/tenderdash/types" mock "github.com/stretchr/testify/mock" +) + +// NewLightClient creates a new instance of LightClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewLightClient(t interface { + mock.TestingT + Cleanup(func()) +}) *LightClient { + mock := &LightClient{} + mock.Mock.Test(t) - time "time" + t.Cleanup(func() { mock.AssertExpectations(t) }) - types "github.com/dashpay/tenderdash/types" -) + return mock +} // LightClient is an autogenerated mock type for the LightClient type type LightClient struct { @@ -25,21 +39,20 @@ func (_m *LightClient) EXPECT() *LightClient_Expecter { return &LightClient_Expecter{mock: &_m.Mock} } -// ChainID provides a mock function with no fields -func (_m *LightClient) ChainID() string { - ret := _m.Called() +// ChainID provides a mock function for the type LightClient +func (_mock *LightClient) ChainID() string { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for ChainID") } var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(string) } - return r0 } @@ -60,8 +73,8 @@ func (_c *LightClient_ChainID_Call) Run(run func()) *LightClient_ChainID_Call { return _c } -func (_c *LightClient_ChainID_Call) Return(_a0 string) *LightClient_ChainID_Call { - _c.Call.Return(_a0) +func (_c *LightClient_ChainID_Call) Return(s string) *LightClient_ChainID_Call { + _c.Call.Return(s) return _c } @@ -70,23 +83,22 @@ func (_c *LightClient_ChainID_Call) RunAndReturn(run func() string) *LightClient return _c } -// Status provides a mock function with given fields: ctx -func (_m *LightClient) Status(ctx context.Context) *types.LightClientInfo { - ret := _m.Called(ctx) +// Status provides a mock function for the type LightClient +func (_mock *LightClient) Status(ctx context.Context) *types.LightClientInfo { + ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for Status") } var r0 *types.LightClientInfo - if rf, ok := ret.Get(0).(func(context.Context) *types.LightClientInfo); ok { - r0 = rf(ctx) + if returnFunc, ok := ret.Get(0).(func(context.Context) *types.LightClientInfo); ok { + r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.LightClientInfo) } } - return r0 } @@ -96,7 +108,7 @@ type LightClient_Status_Call struct { } // Status is a helper method to define mock.On call -// - ctx context.Context +// - ctx func (_e *LightClient_Expecter) Status(ctx interface{}) *LightClient_Status_Call { return &LightClient_Status_Call{Call: _e.mock.On("Status", ctx)} } @@ -108,19 +120,19 @@ func (_c *LightClient_Status_Call) Run(run func(ctx context.Context)) *LightClie return _c } -func (_c *LightClient_Status_Call) Return(_a0 *types.LightClientInfo) *LightClient_Status_Call { - _c.Call.Return(_a0) +func (_c *LightClient_Status_Call) Return(lightClientInfo *types.LightClientInfo) *LightClient_Status_Call { + _c.Call.Return(lightClientInfo) return _c } -func (_c *LightClient_Status_Call) RunAndReturn(run func(context.Context) *types.LightClientInfo) *LightClient_Status_Call { +func (_c *LightClient_Status_Call) RunAndReturn(run func(ctx context.Context) *types.LightClientInfo) *LightClient_Status_Call { _c.Call.Return(run) return _c } -// TrustedLightBlock provides a mock function with given fields: height -func (_m *LightClient) TrustedLightBlock(height int64) (*types.LightBlock, error) { - ret := _m.Called(height) +// TrustedLightBlock provides a mock function for the type LightClient +func (_mock *LightClient) TrustedLightBlock(height int64) (*types.LightBlock, error) { + ret := _mock.Called(height) if len(ret) == 0 { panic("no return value specified for TrustedLightBlock") @@ -128,23 +140,21 @@ func (_m *LightClient) TrustedLightBlock(height int64) (*types.LightBlock, error var r0 *types.LightBlock var r1 error - if rf, ok := ret.Get(0).(func(int64) (*types.LightBlock, error)); ok { - return rf(height) + if returnFunc, ok := ret.Get(0).(func(int64) (*types.LightBlock, error)); ok { + return returnFunc(height) } - if rf, ok := ret.Get(0).(func(int64) *types.LightBlock); ok { - r0 = rf(height) + if returnFunc, ok := ret.Get(0).(func(int64) *types.LightBlock); ok { + r0 = returnFunc(height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.LightBlock) } } - - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(height) + if returnFunc, ok := ret.Get(1).(func(int64) error); ok { + r1 = returnFunc(height) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -154,7 +164,7 @@ type LightClient_TrustedLightBlock_Call struct { } // TrustedLightBlock is a helper method to define mock.On call -// - height int64 +// - height func (_e *LightClient_Expecter) TrustedLightBlock(height interface{}) *LightClient_TrustedLightBlock_Call { return &LightClient_TrustedLightBlock_Call{Call: _e.mock.On("TrustedLightBlock", height)} } @@ -166,19 +176,19 @@ func (_c *LightClient_TrustedLightBlock_Call) Run(run func(height int64)) *Light return _c } -func (_c *LightClient_TrustedLightBlock_Call) Return(_a0 *types.LightBlock, _a1 error) *LightClient_TrustedLightBlock_Call { - _c.Call.Return(_a0, _a1) +func (_c *LightClient_TrustedLightBlock_Call) Return(lightBlock *types.LightBlock, err error) *LightClient_TrustedLightBlock_Call { + _c.Call.Return(lightBlock, err) return _c } -func (_c *LightClient_TrustedLightBlock_Call) RunAndReturn(run func(int64) (*types.LightBlock, error)) *LightClient_TrustedLightBlock_Call { +func (_c *LightClient_TrustedLightBlock_Call) RunAndReturn(run func(height int64) (*types.LightBlock, error)) *LightClient_TrustedLightBlock_Call { _c.Call.Return(run) return _c } -// Update provides a mock function with given fields: ctx, now -func (_m *LightClient) Update(ctx context.Context, now time.Time) (*types.LightBlock, error) { - ret := _m.Called(ctx, now) +// Update provides a mock function for the type LightClient +func (_mock *LightClient) Update(ctx context.Context, now time.Time) (*types.LightBlock, error) { + ret := _mock.Called(ctx, now) if len(ret) == 0 { panic("no return value specified for Update") @@ -186,23 +196,21 @@ func (_m *LightClient) Update(ctx context.Context, now time.Time) (*types.LightB var r0 *types.LightBlock var r1 error - if rf, ok := ret.Get(0).(func(context.Context, time.Time) (*types.LightBlock, error)); ok { - return rf(ctx, now) + if returnFunc, ok := ret.Get(0).(func(context.Context, time.Time) (*types.LightBlock, error)); ok { + return returnFunc(ctx, now) } - if rf, ok := ret.Get(0).(func(context.Context, time.Time) *types.LightBlock); ok { - r0 = rf(ctx, now) + if returnFunc, ok := ret.Get(0).(func(context.Context, time.Time) *types.LightBlock); ok { + r0 = returnFunc(ctx, now) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.LightBlock) } } - - if rf, ok := ret.Get(1).(func(context.Context, time.Time) error); ok { - r1 = rf(ctx, now) + if returnFunc, ok := ret.Get(1).(func(context.Context, time.Time) error); ok { + r1 = returnFunc(ctx, now) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -212,8 +220,8 @@ type LightClient_Update_Call struct { } // Update is a helper method to define mock.On call -// - ctx context.Context -// - now time.Time +// - ctx +// - now func (_e *LightClient_Expecter) Update(ctx interface{}, now interface{}) *LightClient_Update_Call { return &LightClient_Update_Call{Call: _e.mock.On("Update", ctx, now)} } @@ -225,19 +233,19 @@ func (_c *LightClient_Update_Call) Run(run func(ctx context.Context, now time.Ti return _c } -func (_c *LightClient_Update_Call) Return(_a0 *types.LightBlock, _a1 error) *LightClient_Update_Call { - _c.Call.Return(_a0, _a1) +func (_c *LightClient_Update_Call) Return(lightBlock *types.LightBlock, err error) *LightClient_Update_Call { + _c.Call.Return(lightBlock, err) return _c } -func (_c *LightClient_Update_Call) RunAndReturn(run func(context.Context, time.Time) (*types.LightBlock, error)) *LightClient_Update_Call { +func (_c *LightClient_Update_Call) RunAndReturn(run func(ctx context.Context, now time.Time) (*types.LightBlock, error)) *LightClient_Update_Call { _c.Call.Return(run) return _c } -// VerifyLightBlockAtHeight provides a mock function with given fields: ctx, height, now -func (_m *LightClient) VerifyLightBlockAtHeight(ctx context.Context, height int64, now time.Time) (*types.LightBlock, error) { - ret := _m.Called(ctx, height, now) +// VerifyLightBlockAtHeight provides a mock function for the type LightClient +func (_mock *LightClient) VerifyLightBlockAtHeight(ctx context.Context, height int64, now time.Time) (*types.LightBlock, error) { + ret := _mock.Called(ctx, height, now) if len(ret) == 0 { panic("no return value specified for VerifyLightBlockAtHeight") @@ -245,23 +253,21 @@ func (_m *LightClient) VerifyLightBlockAtHeight(ctx context.Context, height int6 var r0 *types.LightBlock var r1 error - if rf, ok := ret.Get(0).(func(context.Context, int64, time.Time) (*types.LightBlock, error)); ok { - return rf(ctx, height, now) + if returnFunc, ok := ret.Get(0).(func(context.Context, int64, time.Time) (*types.LightBlock, error)); ok { + return returnFunc(ctx, height, now) } - if rf, ok := ret.Get(0).(func(context.Context, int64, time.Time) *types.LightBlock); ok { - r0 = rf(ctx, height, now) + if returnFunc, ok := ret.Get(0).(func(context.Context, int64, time.Time) *types.LightBlock); ok { + r0 = returnFunc(ctx, height, now) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.LightBlock) } } - - if rf, ok := ret.Get(1).(func(context.Context, int64, time.Time) error); ok { - r1 = rf(ctx, height, now) + if returnFunc, ok := ret.Get(1).(func(context.Context, int64, time.Time) error); ok { + r1 = returnFunc(ctx, height, now) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -271,9 +277,9 @@ type LightClient_VerifyLightBlockAtHeight_Call struct { } // VerifyLightBlockAtHeight is a helper method to define mock.On call -// - ctx context.Context -// - height int64 -// - now time.Time +// - ctx +// - height +// - now func (_e *LightClient_Expecter) VerifyLightBlockAtHeight(ctx interface{}, height interface{}, now interface{}) *LightClient_VerifyLightBlockAtHeight_Call { return &LightClient_VerifyLightBlockAtHeight_Call{Call: _e.mock.On("VerifyLightBlockAtHeight", ctx, height, now)} } @@ -285,26 +291,12 @@ func (_c *LightClient_VerifyLightBlockAtHeight_Call) Run(run func(ctx context.Co return _c } -func (_c *LightClient_VerifyLightBlockAtHeight_Call) Return(_a0 *types.LightBlock, _a1 error) *LightClient_VerifyLightBlockAtHeight_Call { - _c.Call.Return(_a0, _a1) +func (_c *LightClient_VerifyLightBlockAtHeight_Call) Return(lightBlock *types.LightBlock, err error) *LightClient_VerifyLightBlockAtHeight_Call { + _c.Call.Return(lightBlock, err) return _c } -func (_c *LightClient_VerifyLightBlockAtHeight_Call) RunAndReturn(run func(context.Context, int64, time.Time) (*types.LightBlock, error)) *LightClient_VerifyLightBlockAtHeight_Call { +func (_c *LightClient_VerifyLightBlockAtHeight_Call) RunAndReturn(run func(ctx context.Context, height int64, now time.Time) (*types.LightBlock, error)) *LightClient_VerifyLightBlockAtHeight_Call { _c.Call.Return(run) return _c } - -// NewLightClient creates a new instance of LightClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewLightClient(t interface { - mock.TestingT - Cleanup(func()) -}) *LightClient { - mock := &LightClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/rpc/client/mocks/client.go b/rpc/client/mocks/client.go index 1b1aac0b9a..64d9712bde 100644 --- a/rpc/client/mocks/client.go +++ b/rpc/client/mocks/client.go @@ -1,19 +1,32 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - bytes "github.com/dashpay/tenderdash/libs/bytes" - client "github.com/dashpay/tenderdash/rpc/client" + "context" - context "context" + "github.com/dashpay/tenderdash/libs/bytes" + "github.com/dashpay/tenderdash/rpc/client" + "github.com/dashpay/tenderdash/rpc/coretypes" + "github.com/dashpay/tenderdash/types" + mock "github.com/stretchr/testify/mock" +) - coretypes "github.com/dashpay/tenderdash/rpc/coretypes" +// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewClient(t interface { + mock.TestingT + Cleanup(func()) +}) *Client { + mock := &Client{} + mock.Mock.Test(t) - mock "github.com/stretchr/testify/mock" + t.Cleanup(func() { mock.AssertExpectations(t) }) - types "github.com/dashpay/tenderdash/types" -) + return mock +} // Client is an autogenerated mock type for the Client type type Client struct { @@ -28,9 +41,9 @@ func (_m *Client) EXPECT() *Client_Expecter { return &Client_Expecter{mock: &_m.Mock} } -// ABCIInfo provides a mock function with given fields: _a0 -func (_m *Client) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo, error) { - ret := _m.Called(_a0) +// ABCIInfo provides a mock function for the type Client +func (_mock *Client) ABCIInfo(context1 context.Context) (*coretypes.ResultABCIInfo, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for ABCIInfo") @@ -38,23 +51,21 @@ func (_m *Client) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo, erro var r0 *coretypes.ResultABCIInfo var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultABCIInfo, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultABCIInfo, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultABCIInfo); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) *coretypes.ResultABCIInfo); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultABCIInfo) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -64,31 +75,31 @@ type Client_ABCIInfo_Call struct { } // ABCIInfo is a helper method to define mock.On call -// - _a0 context.Context -func (_e *Client_Expecter) ABCIInfo(_a0 interface{}) *Client_ABCIInfo_Call { - return &Client_ABCIInfo_Call{Call: _e.mock.On("ABCIInfo", _a0)} +// - context1 +func (_e *Client_Expecter) ABCIInfo(context1 interface{}) *Client_ABCIInfo_Call { + return &Client_ABCIInfo_Call{Call: _e.mock.On("ABCIInfo", context1)} } -func (_c *Client_ABCIInfo_Call) Run(run func(_a0 context.Context)) *Client_ABCIInfo_Call { +func (_c *Client_ABCIInfo_Call) Run(run func(context1 context.Context)) *Client_ABCIInfo_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *Client_ABCIInfo_Call) Return(_a0 *coretypes.ResultABCIInfo, _a1 error) *Client_ABCIInfo_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_ABCIInfo_Call) Return(resultABCIInfo *coretypes.ResultABCIInfo, err error) *Client_ABCIInfo_Call { + _c.Call.Return(resultABCIInfo, err) return _c } -func (_c *Client_ABCIInfo_Call) RunAndReturn(run func(context.Context) (*coretypes.ResultABCIInfo, error)) *Client_ABCIInfo_Call { +func (_c *Client_ABCIInfo_Call) RunAndReturn(run func(context1 context.Context) (*coretypes.ResultABCIInfo, error)) *Client_ABCIInfo_Call { _c.Call.Return(run) return _c } -// ABCIQuery provides a mock function with given fields: ctx, path, data -func (_m *Client) ABCIQuery(ctx context.Context, path string, data bytes.HexBytes) (*coretypes.ResultABCIQuery, error) { - ret := _m.Called(ctx, path, data) +// ABCIQuery provides a mock function for the type Client +func (_mock *Client) ABCIQuery(ctx context.Context, path string, data bytes.HexBytes) (*coretypes.ResultABCIQuery, error) { + ret := _mock.Called(ctx, path, data) if len(ret) == 0 { panic("no return value specified for ABCIQuery") @@ -96,23 +107,21 @@ func (_m *Client) ABCIQuery(ctx context.Context, path string, data bytes.HexByte var r0 *coretypes.ResultABCIQuery var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) (*coretypes.ResultABCIQuery, error)); ok { - return rf(ctx, path, data) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) (*coretypes.ResultABCIQuery, error)); ok { + return returnFunc(ctx, path, data) } - if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) *coretypes.ResultABCIQuery); ok { - r0 = rf(ctx, path, data) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) *coretypes.ResultABCIQuery); ok { + r0 = returnFunc(ctx, path, data) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultABCIQuery) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes) error); ok { - r1 = rf(ctx, path, data) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes) error); ok { + r1 = returnFunc(ctx, path, data) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -122,9 +131,9 @@ type Client_ABCIQuery_Call struct { } // ABCIQuery is a helper method to define mock.On call -// - ctx context.Context -// - path string -// - data bytes.HexBytes +// - ctx +// - path +// - data func (_e *Client_Expecter) ABCIQuery(ctx interface{}, path interface{}, data interface{}) *Client_ABCIQuery_Call { return &Client_ABCIQuery_Call{Call: _e.mock.On("ABCIQuery", ctx, path, data)} } @@ -136,19 +145,19 @@ func (_c *Client_ABCIQuery_Call) Run(run func(ctx context.Context, path string, return _c } -func (_c *Client_ABCIQuery_Call) Return(_a0 *coretypes.ResultABCIQuery, _a1 error) *Client_ABCIQuery_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_ABCIQuery_Call) Return(resultABCIQuery *coretypes.ResultABCIQuery, err error) *Client_ABCIQuery_Call { + _c.Call.Return(resultABCIQuery, err) return _c } -func (_c *Client_ABCIQuery_Call) RunAndReturn(run func(context.Context, string, bytes.HexBytes) (*coretypes.ResultABCIQuery, error)) *Client_ABCIQuery_Call { +func (_c *Client_ABCIQuery_Call) RunAndReturn(run func(ctx context.Context, path string, data bytes.HexBytes) (*coretypes.ResultABCIQuery, error)) *Client_ABCIQuery_Call { _c.Call.Return(run) return _c } -// ABCIQueryWithOptions provides a mock function with given fields: ctx, path, data, opts -func (_m *Client) ABCIQueryWithOptions(ctx context.Context, path string, data bytes.HexBytes, opts client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error) { - ret := _m.Called(ctx, path, data, opts) +// ABCIQueryWithOptions provides a mock function for the type Client +func (_mock *Client) ABCIQueryWithOptions(ctx context.Context, path string, data bytes.HexBytes, opts client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error) { + ret := _mock.Called(ctx, path, data, opts) if len(ret) == 0 { panic("no return value specified for ABCIQueryWithOptions") @@ -156,23 +165,21 @@ func (_m *Client) ABCIQueryWithOptions(ctx context.Context, path string, data by var r0 *coretypes.ResultABCIQuery var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)); ok { - return rf(ctx, path, data, opts) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)); ok { + return returnFunc(ctx, path, data, opts) } - if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) *coretypes.ResultABCIQuery); ok { - r0 = rf(ctx, path, data, opts) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) *coretypes.ResultABCIQuery); ok { + r0 = returnFunc(ctx, path, data, opts) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultABCIQuery) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) error); ok { - r1 = rf(ctx, path, data, opts) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) error); ok { + r1 = returnFunc(ctx, path, data, opts) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -182,10 +189,10 @@ type Client_ABCIQueryWithOptions_Call struct { } // ABCIQueryWithOptions is a helper method to define mock.On call -// - ctx context.Context -// - path string -// - data bytes.HexBytes -// - opts client.ABCIQueryOptions +// - ctx +// - path +// - data +// - opts func (_e *Client_Expecter) ABCIQueryWithOptions(ctx interface{}, path interface{}, data interface{}, opts interface{}) *Client_ABCIQueryWithOptions_Call { return &Client_ABCIQueryWithOptions_Call{Call: _e.mock.On("ABCIQueryWithOptions", ctx, path, data, opts)} } @@ -197,19 +204,19 @@ func (_c *Client_ABCIQueryWithOptions_Call) Run(run func(ctx context.Context, pa return _c } -func (_c *Client_ABCIQueryWithOptions_Call) Return(_a0 *coretypes.ResultABCIQuery, _a1 error) *Client_ABCIQueryWithOptions_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_ABCIQueryWithOptions_Call) Return(resultABCIQuery *coretypes.ResultABCIQuery, err error) *Client_ABCIQueryWithOptions_Call { + _c.Call.Return(resultABCIQuery, err) return _c } -func (_c *Client_ABCIQueryWithOptions_Call) RunAndReturn(run func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)) *Client_ABCIQueryWithOptions_Call { +func (_c *Client_ABCIQueryWithOptions_Call) RunAndReturn(run func(ctx context.Context, path string, data bytes.HexBytes, opts client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)) *Client_ABCIQueryWithOptions_Call { _c.Call.Return(run) return _c } -// Block provides a mock function with given fields: ctx, height -func (_m *Client) Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error) { - ret := _m.Called(ctx, height) +// Block provides a mock function for the type Client +func (_mock *Client) Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error) { + ret := _mock.Called(ctx, height) if len(ret) == 0 { panic("no return value specified for Block") @@ -217,23 +224,21 @@ func (_m *Client) Block(ctx context.Context, height *int64) (*coretypes.ResultBl var r0 *coretypes.ResultBlock var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlock, error)); ok { - return rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlock, error)); ok { + return returnFunc(ctx, height) } - if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlock); ok { - r0 = rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlock); ok { + r0 = returnFunc(ctx, height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBlock) } } - - if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { - r1 = rf(ctx, height) + if returnFunc, ok := ret.Get(1).(func(context.Context, *int64) error); ok { + r1 = returnFunc(ctx, height) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -243,8 +248,8 @@ type Client_Block_Call struct { } // Block is a helper method to define mock.On call -// - ctx context.Context -// - height *int64 +// - ctx +// - height func (_e *Client_Expecter) Block(ctx interface{}, height interface{}) *Client_Block_Call { return &Client_Block_Call{Call: _e.mock.On("Block", ctx, height)} } @@ -256,19 +261,19 @@ func (_c *Client_Block_Call) Run(run func(ctx context.Context, height *int64)) * return _c } -func (_c *Client_Block_Call) Return(_a0 *coretypes.ResultBlock, _a1 error) *Client_Block_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_Block_Call) Return(resultBlock *coretypes.ResultBlock, err error) *Client_Block_Call { + _c.Call.Return(resultBlock, err) return _c } -func (_c *Client_Block_Call) RunAndReturn(run func(context.Context, *int64) (*coretypes.ResultBlock, error)) *Client_Block_Call { +func (_c *Client_Block_Call) RunAndReturn(run func(ctx context.Context, height *int64) (*coretypes.ResultBlock, error)) *Client_Block_Call { _c.Call.Return(run) return _c } -// BlockByHash provides a mock function with given fields: ctx, hash -func (_m *Client) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*coretypes.ResultBlock, error) { - ret := _m.Called(ctx, hash) +// BlockByHash provides a mock function for the type Client +func (_mock *Client) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*coretypes.ResultBlock, error) { + ret := _mock.Called(ctx, hash) if len(ret) == 0 { panic("no return value specified for BlockByHash") @@ -276,23 +281,21 @@ func (_m *Client) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*corety var r0 *coretypes.ResultBlock var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultBlock, error)); ok { - return rf(ctx, hash) + if returnFunc, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultBlock, error)); ok { + return returnFunc(ctx, hash) } - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultBlock); ok { - r0 = rf(ctx, hash) + if returnFunc, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultBlock); ok { + r0 = returnFunc(ctx, hash) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBlock) } } - - if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { - r1 = rf(ctx, hash) + if returnFunc, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { + r1 = returnFunc(ctx, hash) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -302,8 +305,8 @@ type Client_BlockByHash_Call struct { } // BlockByHash is a helper method to define mock.On call -// - ctx context.Context -// - hash bytes.HexBytes +// - ctx +// - hash func (_e *Client_Expecter) BlockByHash(ctx interface{}, hash interface{}) *Client_BlockByHash_Call { return &Client_BlockByHash_Call{Call: _e.mock.On("BlockByHash", ctx, hash)} } @@ -315,19 +318,19 @@ func (_c *Client_BlockByHash_Call) Run(run func(ctx context.Context, hash bytes. return _c } -func (_c *Client_BlockByHash_Call) Return(_a0 *coretypes.ResultBlock, _a1 error) *Client_BlockByHash_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_BlockByHash_Call) Return(resultBlock *coretypes.ResultBlock, err error) *Client_BlockByHash_Call { + _c.Call.Return(resultBlock, err) return _c } -func (_c *Client_BlockByHash_Call) RunAndReturn(run func(context.Context, bytes.HexBytes) (*coretypes.ResultBlock, error)) *Client_BlockByHash_Call { +func (_c *Client_BlockByHash_Call) RunAndReturn(run func(ctx context.Context, hash bytes.HexBytes) (*coretypes.ResultBlock, error)) *Client_BlockByHash_Call { _c.Call.Return(run) return _c } -// BlockResults provides a mock function with given fields: ctx, height -func (_m *Client) BlockResults(ctx context.Context, height *int64) (*coretypes.ResultBlockResults, error) { - ret := _m.Called(ctx, height) +// BlockResults provides a mock function for the type Client +func (_mock *Client) BlockResults(ctx context.Context, height *int64) (*coretypes.ResultBlockResults, error) { + ret := _mock.Called(ctx, height) if len(ret) == 0 { panic("no return value specified for BlockResults") @@ -335,23 +338,21 @@ func (_m *Client) BlockResults(ctx context.Context, height *int64) (*coretypes.R var r0 *coretypes.ResultBlockResults var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlockResults, error)); ok { - return rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlockResults, error)); ok { + return returnFunc(ctx, height) } - if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlockResults); ok { - r0 = rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlockResults); ok { + r0 = returnFunc(ctx, height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBlockResults) } } - - if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { - r1 = rf(ctx, height) + if returnFunc, ok := ret.Get(1).(func(context.Context, *int64) error); ok { + r1 = returnFunc(ctx, height) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -361,8 +362,8 @@ type Client_BlockResults_Call struct { } // BlockResults is a helper method to define mock.On call -// - ctx context.Context -// - height *int64 +// - ctx +// - height func (_e *Client_Expecter) BlockResults(ctx interface{}, height interface{}) *Client_BlockResults_Call { return &Client_BlockResults_Call{Call: _e.mock.On("BlockResults", ctx, height)} } @@ -374,19 +375,19 @@ func (_c *Client_BlockResults_Call) Run(run func(ctx context.Context, height *in return _c } -func (_c *Client_BlockResults_Call) Return(_a0 *coretypes.ResultBlockResults, _a1 error) *Client_BlockResults_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_BlockResults_Call) Return(resultBlockResults *coretypes.ResultBlockResults, err error) *Client_BlockResults_Call { + _c.Call.Return(resultBlockResults, err) return _c } -func (_c *Client_BlockResults_Call) RunAndReturn(run func(context.Context, *int64) (*coretypes.ResultBlockResults, error)) *Client_BlockResults_Call { +func (_c *Client_BlockResults_Call) RunAndReturn(run func(ctx context.Context, height *int64) (*coretypes.ResultBlockResults, error)) *Client_BlockResults_Call { _c.Call.Return(run) return _c } -// BlockSearch provides a mock function with given fields: ctx, query, page, perPage, orderBy -func (_m *Client) BlockSearch(ctx context.Context, query string, page *int, perPage *int, orderBy string) (*coretypes.ResultBlockSearch, error) { - ret := _m.Called(ctx, query, page, perPage, orderBy) +// BlockSearch provides a mock function for the type Client +func (_mock *Client) BlockSearch(ctx context.Context, query string, page *int, perPage *int, orderBy string) (*coretypes.ResultBlockSearch, error) { + ret := _mock.Called(ctx, query, page, perPage, orderBy) if len(ret) == 0 { panic("no return value specified for BlockSearch") @@ -394,23 +395,21 @@ func (_m *Client) BlockSearch(ctx context.Context, query string, page *int, perP var r0 *coretypes.ResultBlockSearch var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) (*coretypes.ResultBlockSearch, error)); ok { - return rf(ctx, query, page, perPage, orderBy) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) (*coretypes.ResultBlockSearch, error)); ok { + return returnFunc(ctx, query, page, perPage, orderBy) } - if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) *coretypes.ResultBlockSearch); ok { - r0 = rf(ctx, query, page, perPage, orderBy) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) *coretypes.ResultBlockSearch); ok { + r0 = returnFunc(ctx, query, page, perPage, orderBy) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBlockSearch) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, *int, *int, string) error); ok { - r1 = rf(ctx, query, page, perPage, orderBy) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, *int, *int, string) error); ok { + r1 = returnFunc(ctx, query, page, perPage, orderBy) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -420,11 +419,11 @@ type Client_BlockSearch_Call struct { } // BlockSearch is a helper method to define mock.On call -// - ctx context.Context -// - query string -// - page *int -// - perPage *int -// - orderBy string +// - ctx +// - query +// - page +// - perPage +// - orderBy func (_e *Client_Expecter) BlockSearch(ctx interface{}, query interface{}, page interface{}, perPage interface{}, orderBy interface{}) *Client_BlockSearch_Call { return &Client_BlockSearch_Call{Call: _e.mock.On("BlockSearch", ctx, query, page, perPage, orderBy)} } @@ -436,19 +435,19 @@ func (_c *Client_BlockSearch_Call) Run(run func(ctx context.Context, query strin return _c } -func (_c *Client_BlockSearch_Call) Return(_a0 *coretypes.ResultBlockSearch, _a1 error) *Client_BlockSearch_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_BlockSearch_Call) Return(resultBlockSearch *coretypes.ResultBlockSearch, err error) *Client_BlockSearch_Call { + _c.Call.Return(resultBlockSearch, err) return _c } -func (_c *Client_BlockSearch_Call) RunAndReturn(run func(context.Context, string, *int, *int, string) (*coretypes.ResultBlockSearch, error)) *Client_BlockSearch_Call { +func (_c *Client_BlockSearch_Call) RunAndReturn(run func(ctx context.Context, query string, page *int, perPage *int, orderBy string) (*coretypes.ResultBlockSearch, error)) *Client_BlockSearch_Call { _c.Call.Return(run) return _c } -// BlockchainInfo provides a mock function with given fields: ctx, minHeight, maxHeight -func (_m *Client) BlockchainInfo(ctx context.Context, minHeight int64, maxHeight int64) (*coretypes.ResultBlockchainInfo, error) { - ret := _m.Called(ctx, minHeight, maxHeight) +// BlockchainInfo provides a mock function for the type Client +func (_mock *Client) BlockchainInfo(ctx context.Context, minHeight int64, maxHeight int64) (*coretypes.ResultBlockchainInfo, error) { + ret := _mock.Called(ctx, minHeight, maxHeight) if len(ret) == 0 { panic("no return value specified for BlockchainInfo") @@ -456,23 +455,21 @@ func (_m *Client) BlockchainInfo(ctx context.Context, minHeight int64, maxHeight var r0 *coretypes.ResultBlockchainInfo var r1 error - if rf, ok := ret.Get(0).(func(context.Context, int64, int64) (*coretypes.ResultBlockchainInfo, error)); ok { - return rf(ctx, minHeight, maxHeight) + if returnFunc, ok := ret.Get(0).(func(context.Context, int64, int64) (*coretypes.ResultBlockchainInfo, error)); ok { + return returnFunc(ctx, minHeight, maxHeight) } - if rf, ok := ret.Get(0).(func(context.Context, int64, int64) *coretypes.ResultBlockchainInfo); ok { - r0 = rf(ctx, minHeight, maxHeight) + if returnFunc, ok := ret.Get(0).(func(context.Context, int64, int64) *coretypes.ResultBlockchainInfo); ok { + r0 = returnFunc(ctx, minHeight, maxHeight) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBlockchainInfo) } } - - if rf, ok := ret.Get(1).(func(context.Context, int64, int64) error); ok { - r1 = rf(ctx, minHeight, maxHeight) + if returnFunc, ok := ret.Get(1).(func(context.Context, int64, int64) error); ok { + r1 = returnFunc(ctx, minHeight, maxHeight) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -482,9 +479,9 @@ type Client_BlockchainInfo_Call struct { } // BlockchainInfo is a helper method to define mock.On call -// - ctx context.Context -// - minHeight int64 -// - maxHeight int64 +// - ctx +// - minHeight +// - maxHeight func (_e *Client_Expecter) BlockchainInfo(ctx interface{}, minHeight interface{}, maxHeight interface{}) *Client_BlockchainInfo_Call { return &Client_BlockchainInfo_Call{Call: _e.mock.On("BlockchainInfo", ctx, minHeight, maxHeight)} } @@ -496,19 +493,19 @@ func (_c *Client_BlockchainInfo_Call) Run(run func(ctx context.Context, minHeigh return _c } -func (_c *Client_BlockchainInfo_Call) Return(_a0 *coretypes.ResultBlockchainInfo, _a1 error) *Client_BlockchainInfo_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_BlockchainInfo_Call) Return(resultBlockchainInfo *coretypes.ResultBlockchainInfo, err error) *Client_BlockchainInfo_Call { + _c.Call.Return(resultBlockchainInfo, err) return _c } -func (_c *Client_BlockchainInfo_Call) RunAndReturn(run func(context.Context, int64, int64) (*coretypes.ResultBlockchainInfo, error)) *Client_BlockchainInfo_Call { +func (_c *Client_BlockchainInfo_Call) RunAndReturn(run func(ctx context.Context, minHeight int64, maxHeight int64) (*coretypes.ResultBlockchainInfo, error)) *Client_BlockchainInfo_Call { _c.Call.Return(run) return _c } -// BroadcastEvidence provides a mock function with given fields: _a0, _a1 -func (_m *Client) BroadcastEvidence(_a0 context.Context, _a1 types.Evidence) (*coretypes.ResultBroadcastEvidence, error) { - ret := _m.Called(_a0, _a1) +// BroadcastEvidence provides a mock function for the type Client +func (_mock *Client) BroadcastEvidence(context1 context.Context, evidence types.Evidence) (*coretypes.ResultBroadcastEvidence, error) { + ret := _mock.Called(context1, evidence) if len(ret) == 0 { panic("no return value specified for BroadcastEvidence") @@ -516,23 +513,21 @@ func (_m *Client) BroadcastEvidence(_a0 context.Context, _a1 types.Evidence) (*c var r0 *coretypes.ResultBroadcastEvidence var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) (*coretypes.ResultBroadcastEvidence, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Evidence) (*coretypes.ResultBroadcastEvidence, error)); ok { + return returnFunc(context1, evidence) } - if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) *coretypes.ResultBroadcastEvidence); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Evidence) *coretypes.ResultBroadcastEvidence); ok { + r0 = returnFunc(context1, evidence) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBroadcastEvidence) } } - - if rf, ok := ret.Get(1).(func(context.Context, types.Evidence) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, types.Evidence) error); ok { + r1 = returnFunc(context1, evidence) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -542,32 +537,32 @@ type Client_BroadcastEvidence_Call struct { } // BroadcastEvidence is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.Evidence -func (_e *Client_Expecter) BroadcastEvidence(_a0 interface{}, _a1 interface{}) *Client_BroadcastEvidence_Call { - return &Client_BroadcastEvidence_Call{Call: _e.mock.On("BroadcastEvidence", _a0, _a1)} +// - context1 +// - evidence +func (_e *Client_Expecter) BroadcastEvidence(context1 interface{}, evidence interface{}) *Client_BroadcastEvidence_Call { + return &Client_BroadcastEvidence_Call{Call: _e.mock.On("BroadcastEvidence", context1, evidence)} } -func (_c *Client_BroadcastEvidence_Call) Run(run func(_a0 context.Context, _a1 types.Evidence)) *Client_BroadcastEvidence_Call { +func (_c *Client_BroadcastEvidence_Call) Run(run func(context1 context.Context, evidence types.Evidence)) *Client_BroadcastEvidence_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.Evidence)) }) return _c } -func (_c *Client_BroadcastEvidence_Call) Return(_a0 *coretypes.ResultBroadcastEvidence, _a1 error) *Client_BroadcastEvidence_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_BroadcastEvidence_Call) Return(resultBroadcastEvidence *coretypes.ResultBroadcastEvidence, err error) *Client_BroadcastEvidence_Call { + _c.Call.Return(resultBroadcastEvidence, err) return _c } -func (_c *Client_BroadcastEvidence_Call) RunAndReturn(run func(context.Context, types.Evidence) (*coretypes.ResultBroadcastEvidence, error)) *Client_BroadcastEvidence_Call { +func (_c *Client_BroadcastEvidence_Call) RunAndReturn(run func(context1 context.Context, evidence types.Evidence) (*coretypes.ResultBroadcastEvidence, error)) *Client_BroadcastEvidence_Call { _c.Call.Return(run) return _c } -// BroadcastTx provides a mock function with given fields: _a0, _a1 -func (_m *Client) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultBroadcastTx, error) { - ret := _m.Called(_a0, _a1) +// BroadcastTx provides a mock function for the type Client +func (_mock *Client) BroadcastTx(context1 context.Context, tx types.Tx) (*coretypes.ResultBroadcastTx, error) { + ret := _mock.Called(context1, tx) if len(ret) == 0 { panic("no return value specified for BroadcastTx") @@ -575,23 +570,21 @@ func (_m *Client) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretypes.Res var r0 *coretypes.ResultBroadcastTx var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return returnFunc(context1, tx) } - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { + r0 = returnFunc(context1, tx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBroadcastTx) } } - - if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { + r1 = returnFunc(context1, tx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -601,32 +594,32 @@ type Client_BroadcastTx_Call struct { } // BroadcastTx is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.Tx -func (_e *Client_Expecter) BroadcastTx(_a0 interface{}, _a1 interface{}) *Client_BroadcastTx_Call { - return &Client_BroadcastTx_Call{Call: _e.mock.On("BroadcastTx", _a0, _a1)} +// - context1 +// - tx +func (_e *Client_Expecter) BroadcastTx(context1 interface{}, tx interface{}) *Client_BroadcastTx_Call { + return &Client_BroadcastTx_Call{Call: _e.mock.On("BroadcastTx", context1, tx)} } -func (_c *Client_BroadcastTx_Call) Run(run func(_a0 context.Context, _a1 types.Tx)) *Client_BroadcastTx_Call { +func (_c *Client_BroadcastTx_Call) Run(run func(context1 context.Context, tx types.Tx)) *Client_BroadcastTx_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.Tx)) }) return _c } -func (_c *Client_BroadcastTx_Call) Return(_a0 *coretypes.ResultBroadcastTx, _a1 error) *Client_BroadcastTx_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_BroadcastTx_Call) Return(resultBroadcastTx *coretypes.ResultBroadcastTx, err error) *Client_BroadcastTx_Call { + _c.Call.Return(resultBroadcastTx, err) return _c } -func (_c *Client_BroadcastTx_Call) RunAndReturn(run func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)) *Client_BroadcastTx_Call { +func (_c *Client_BroadcastTx_Call) RunAndReturn(run func(context1 context.Context, tx types.Tx) (*coretypes.ResultBroadcastTx, error)) *Client_BroadcastTx_Call { _c.Call.Return(run) return _c } -// BroadcastTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *Client) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultBroadcastTx, error) { - ret := _m.Called(_a0, _a1) +// BroadcastTxAsync provides a mock function for the type Client +func (_mock *Client) BroadcastTxAsync(context1 context.Context, tx types.Tx) (*coretypes.ResultBroadcastTx, error) { + ret := _mock.Called(context1, tx) if len(ret) == 0 { panic("no return value specified for BroadcastTxAsync") @@ -634,23 +627,21 @@ func (_m *Client) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*coretype var r0 *coretypes.ResultBroadcastTx var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return returnFunc(context1, tx) } - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { + r0 = returnFunc(context1, tx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBroadcastTx) } } - - if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { + r1 = returnFunc(context1, tx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -660,32 +651,32 @@ type Client_BroadcastTxAsync_Call struct { } // BroadcastTxAsync is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.Tx -func (_e *Client_Expecter) BroadcastTxAsync(_a0 interface{}, _a1 interface{}) *Client_BroadcastTxAsync_Call { - return &Client_BroadcastTxAsync_Call{Call: _e.mock.On("BroadcastTxAsync", _a0, _a1)} +// - context1 +// - tx +func (_e *Client_Expecter) BroadcastTxAsync(context1 interface{}, tx interface{}) *Client_BroadcastTxAsync_Call { + return &Client_BroadcastTxAsync_Call{Call: _e.mock.On("BroadcastTxAsync", context1, tx)} } -func (_c *Client_BroadcastTxAsync_Call) Run(run func(_a0 context.Context, _a1 types.Tx)) *Client_BroadcastTxAsync_Call { +func (_c *Client_BroadcastTxAsync_Call) Run(run func(context1 context.Context, tx types.Tx)) *Client_BroadcastTxAsync_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.Tx)) }) return _c } -func (_c *Client_BroadcastTxAsync_Call) Return(_a0 *coretypes.ResultBroadcastTx, _a1 error) *Client_BroadcastTxAsync_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_BroadcastTxAsync_Call) Return(resultBroadcastTx *coretypes.ResultBroadcastTx, err error) *Client_BroadcastTxAsync_Call { + _c.Call.Return(resultBroadcastTx, err) return _c } -func (_c *Client_BroadcastTxAsync_Call) RunAndReturn(run func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)) *Client_BroadcastTxAsync_Call { +func (_c *Client_BroadcastTxAsync_Call) RunAndReturn(run func(context1 context.Context, tx types.Tx) (*coretypes.ResultBroadcastTx, error)) *Client_BroadcastTxAsync_Call { _c.Call.Return(run) return _c } -// BroadcastTxCommit provides a mock function with given fields: _a0, _a1 -func (_m *Client) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultBroadcastTxCommit, error) { - ret := _m.Called(_a0, _a1) +// BroadcastTxCommit provides a mock function for the type Client +func (_mock *Client) BroadcastTxCommit(context1 context.Context, tx types.Tx) (*coretypes.ResultBroadcastTxCommit, error) { + ret := _mock.Called(context1, tx) if len(ret) == 0 { panic("no return value specified for BroadcastTxCommit") @@ -693,23 +684,21 @@ func (_m *Client) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*coretyp var r0 *coretypes.ResultBroadcastTxCommit var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTxCommit, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTxCommit, error)); ok { + return returnFunc(context1, tx) } - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTxCommit); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTxCommit); ok { + r0 = returnFunc(context1, tx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBroadcastTxCommit) } } - - if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { + r1 = returnFunc(context1, tx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -719,32 +708,32 @@ type Client_BroadcastTxCommit_Call struct { } // BroadcastTxCommit is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.Tx -func (_e *Client_Expecter) BroadcastTxCommit(_a0 interface{}, _a1 interface{}) *Client_BroadcastTxCommit_Call { - return &Client_BroadcastTxCommit_Call{Call: _e.mock.On("BroadcastTxCommit", _a0, _a1)} +// - context1 +// - tx +func (_e *Client_Expecter) BroadcastTxCommit(context1 interface{}, tx interface{}) *Client_BroadcastTxCommit_Call { + return &Client_BroadcastTxCommit_Call{Call: _e.mock.On("BroadcastTxCommit", context1, tx)} } -func (_c *Client_BroadcastTxCommit_Call) Run(run func(_a0 context.Context, _a1 types.Tx)) *Client_BroadcastTxCommit_Call { +func (_c *Client_BroadcastTxCommit_Call) Run(run func(context1 context.Context, tx types.Tx)) *Client_BroadcastTxCommit_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.Tx)) }) return _c } -func (_c *Client_BroadcastTxCommit_Call) Return(_a0 *coretypes.ResultBroadcastTxCommit, _a1 error) *Client_BroadcastTxCommit_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_BroadcastTxCommit_Call) Return(resultBroadcastTxCommit *coretypes.ResultBroadcastTxCommit, err error) *Client_BroadcastTxCommit_Call { + _c.Call.Return(resultBroadcastTxCommit, err) return _c } -func (_c *Client_BroadcastTxCommit_Call) RunAndReturn(run func(context.Context, types.Tx) (*coretypes.ResultBroadcastTxCommit, error)) *Client_BroadcastTxCommit_Call { +func (_c *Client_BroadcastTxCommit_Call) RunAndReturn(run func(context1 context.Context, tx types.Tx) (*coretypes.ResultBroadcastTxCommit, error)) *Client_BroadcastTxCommit_Call { _c.Call.Return(run) return _c } -// BroadcastTxSync provides a mock function with given fields: _a0, _a1 -func (_m *Client) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultBroadcastTx, error) { - ret := _m.Called(_a0, _a1) +// BroadcastTxSync provides a mock function for the type Client +func (_mock *Client) BroadcastTxSync(context1 context.Context, tx types.Tx) (*coretypes.ResultBroadcastTx, error) { + ret := _mock.Called(context1, tx) if len(ret) == 0 { panic("no return value specified for BroadcastTxSync") @@ -752,23 +741,21 @@ func (_m *Client) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*coretypes var r0 *coretypes.ResultBroadcastTx var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return returnFunc(context1, tx) } - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { + r0 = returnFunc(context1, tx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBroadcastTx) } } - - if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { + r1 = returnFunc(context1, tx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -778,32 +765,32 @@ type Client_BroadcastTxSync_Call struct { } // BroadcastTxSync is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.Tx -func (_e *Client_Expecter) BroadcastTxSync(_a0 interface{}, _a1 interface{}) *Client_BroadcastTxSync_Call { - return &Client_BroadcastTxSync_Call{Call: _e.mock.On("BroadcastTxSync", _a0, _a1)} +// - context1 +// - tx +func (_e *Client_Expecter) BroadcastTxSync(context1 interface{}, tx interface{}) *Client_BroadcastTxSync_Call { + return &Client_BroadcastTxSync_Call{Call: _e.mock.On("BroadcastTxSync", context1, tx)} } -func (_c *Client_BroadcastTxSync_Call) Run(run func(_a0 context.Context, _a1 types.Tx)) *Client_BroadcastTxSync_Call { +func (_c *Client_BroadcastTxSync_Call) Run(run func(context1 context.Context, tx types.Tx)) *Client_BroadcastTxSync_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.Tx)) }) return _c } -func (_c *Client_BroadcastTxSync_Call) Return(_a0 *coretypes.ResultBroadcastTx, _a1 error) *Client_BroadcastTxSync_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_BroadcastTxSync_Call) Return(resultBroadcastTx *coretypes.ResultBroadcastTx, err error) *Client_BroadcastTxSync_Call { + _c.Call.Return(resultBroadcastTx, err) return _c } -func (_c *Client_BroadcastTxSync_Call) RunAndReturn(run func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)) *Client_BroadcastTxSync_Call { +func (_c *Client_BroadcastTxSync_Call) RunAndReturn(run func(context1 context.Context, tx types.Tx) (*coretypes.ResultBroadcastTx, error)) *Client_BroadcastTxSync_Call { _c.Call.Return(run) return _c } -// CheckTx provides a mock function with given fields: _a0, _a1 -func (_m *Client) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultCheckTx, error) { - ret := _m.Called(_a0, _a1) +// CheckTx provides a mock function for the type Client +func (_mock *Client) CheckTx(context1 context.Context, tx types.Tx) (*coretypes.ResultCheckTx, error) { + ret := _mock.Called(context1, tx) if len(ret) == 0 { panic("no return value specified for CheckTx") @@ -811,23 +798,21 @@ func (_m *Client) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultC var r0 *coretypes.ResultCheckTx var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultCheckTx, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultCheckTx, error)); ok { + return returnFunc(context1, tx) } - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultCheckTx); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultCheckTx); ok { + r0 = returnFunc(context1, tx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultCheckTx) } } - - if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { + r1 = returnFunc(context1, tx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -837,32 +822,32 @@ type Client_CheckTx_Call struct { } // CheckTx is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.Tx -func (_e *Client_Expecter) CheckTx(_a0 interface{}, _a1 interface{}) *Client_CheckTx_Call { - return &Client_CheckTx_Call{Call: _e.mock.On("CheckTx", _a0, _a1)} +// - context1 +// - tx +func (_e *Client_Expecter) CheckTx(context1 interface{}, tx interface{}) *Client_CheckTx_Call { + return &Client_CheckTx_Call{Call: _e.mock.On("CheckTx", context1, tx)} } -func (_c *Client_CheckTx_Call) Run(run func(_a0 context.Context, _a1 types.Tx)) *Client_CheckTx_Call { +func (_c *Client_CheckTx_Call) Run(run func(context1 context.Context, tx types.Tx)) *Client_CheckTx_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.Tx)) }) return _c } -func (_c *Client_CheckTx_Call) Return(_a0 *coretypes.ResultCheckTx, _a1 error) *Client_CheckTx_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_CheckTx_Call) Return(resultCheckTx *coretypes.ResultCheckTx, err error) *Client_CheckTx_Call { + _c.Call.Return(resultCheckTx, err) return _c } -func (_c *Client_CheckTx_Call) RunAndReturn(run func(context.Context, types.Tx) (*coretypes.ResultCheckTx, error)) *Client_CheckTx_Call { +func (_c *Client_CheckTx_Call) RunAndReturn(run func(context1 context.Context, tx types.Tx) (*coretypes.ResultCheckTx, error)) *Client_CheckTx_Call { _c.Call.Return(run) return _c } -// Commit provides a mock function with given fields: ctx, height -func (_m *Client) Commit(ctx context.Context, height *int64) (*coretypes.ResultCommit, error) { - ret := _m.Called(ctx, height) +// Commit provides a mock function for the type Client +func (_mock *Client) Commit(ctx context.Context, height *int64) (*coretypes.ResultCommit, error) { + ret := _mock.Called(ctx, height) if len(ret) == 0 { panic("no return value specified for Commit") @@ -870,23 +855,21 @@ func (_m *Client) Commit(ctx context.Context, height *int64) (*coretypes.ResultC var r0 *coretypes.ResultCommit var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultCommit, error)); ok { - return rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultCommit, error)); ok { + return returnFunc(ctx, height) } - if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultCommit); ok { - r0 = rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultCommit); ok { + r0 = returnFunc(ctx, height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultCommit) } } - - if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { - r1 = rf(ctx, height) + if returnFunc, ok := ret.Get(1).(func(context.Context, *int64) error); ok { + r1 = returnFunc(ctx, height) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -896,8 +879,8 @@ type Client_Commit_Call struct { } // Commit is a helper method to define mock.On call -// - ctx context.Context -// - height *int64 +// - ctx +// - height func (_e *Client_Expecter) Commit(ctx interface{}, height interface{}) *Client_Commit_Call { return &Client_Commit_Call{Call: _e.mock.On("Commit", ctx, height)} } @@ -909,19 +892,19 @@ func (_c *Client_Commit_Call) Run(run func(ctx context.Context, height *int64)) return _c } -func (_c *Client_Commit_Call) Return(_a0 *coretypes.ResultCommit, _a1 error) *Client_Commit_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_Commit_Call) Return(resultCommit *coretypes.ResultCommit, err error) *Client_Commit_Call { + _c.Call.Return(resultCommit, err) return _c } -func (_c *Client_Commit_Call) RunAndReturn(run func(context.Context, *int64) (*coretypes.ResultCommit, error)) *Client_Commit_Call { +func (_c *Client_Commit_Call) RunAndReturn(run func(ctx context.Context, height *int64) (*coretypes.ResultCommit, error)) *Client_Commit_Call { _c.Call.Return(run) return _c } -// ConsensusParams provides a mock function with given fields: ctx, height -func (_m *Client) ConsensusParams(ctx context.Context, height *int64) (*coretypes.ResultConsensusParams, error) { - ret := _m.Called(ctx, height) +// ConsensusParams provides a mock function for the type Client +func (_mock *Client) ConsensusParams(ctx context.Context, height *int64) (*coretypes.ResultConsensusParams, error) { + ret := _mock.Called(ctx, height) if len(ret) == 0 { panic("no return value specified for ConsensusParams") @@ -929,23 +912,21 @@ func (_m *Client) ConsensusParams(ctx context.Context, height *int64) (*coretype var r0 *coretypes.ResultConsensusParams var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultConsensusParams, error)); ok { - return rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultConsensusParams, error)); ok { + return returnFunc(ctx, height) } - if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultConsensusParams); ok { - r0 = rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultConsensusParams); ok { + r0 = returnFunc(ctx, height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultConsensusParams) } } - - if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { - r1 = rf(ctx, height) + if returnFunc, ok := ret.Get(1).(func(context.Context, *int64) error); ok { + r1 = returnFunc(ctx, height) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -955,8 +936,8 @@ type Client_ConsensusParams_Call struct { } // ConsensusParams is a helper method to define mock.On call -// - ctx context.Context -// - height *int64 +// - ctx +// - height func (_e *Client_Expecter) ConsensusParams(ctx interface{}, height interface{}) *Client_ConsensusParams_Call { return &Client_ConsensusParams_Call{Call: _e.mock.On("ConsensusParams", ctx, height)} } @@ -968,19 +949,19 @@ func (_c *Client_ConsensusParams_Call) Run(run func(ctx context.Context, height return _c } -func (_c *Client_ConsensusParams_Call) Return(_a0 *coretypes.ResultConsensusParams, _a1 error) *Client_ConsensusParams_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_ConsensusParams_Call) Return(resultConsensusParams *coretypes.ResultConsensusParams, err error) *Client_ConsensusParams_Call { + _c.Call.Return(resultConsensusParams, err) return _c } -func (_c *Client_ConsensusParams_Call) RunAndReturn(run func(context.Context, *int64) (*coretypes.ResultConsensusParams, error)) *Client_ConsensusParams_Call { +func (_c *Client_ConsensusParams_Call) RunAndReturn(run func(ctx context.Context, height *int64) (*coretypes.ResultConsensusParams, error)) *Client_ConsensusParams_Call { _c.Call.Return(run) return _c } -// ConsensusState provides a mock function with given fields: _a0 -func (_m *Client) ConsensusState(_a0 context.Context) (*coretypes.ResultConsensusState, error) { - ret := _m.Called(_a0) +// ConsensusState provides a mock function for the type Client +func (_mock *Client) ConsensusState(context1 context.Context) (*coretypes.ResultConsensusState, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for ConsensusState") @@ -988,23 +969,21 @@ func (_m *Client) ConsensusState(_a0 context.Context) (*coretypes.ResultConsensu var r0 *coretypes.ResultConsensusState var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultConsensusState, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultConsensusState, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultConsensusState); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) *coretypes.ResultConsensusState); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultConsensusState) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1014,31 +993,31 @@ type Client_ConsensusState_Call struct { } // ConsensusState is a helper method to define mock.On call -// - _a0 context.Context -func (_e *Client_Expecter) ConsensusState(_a0 interface{}) *Client_ConsensusState_Call { - return &Client_ConsensusState_Call{Call: _e.mock.On("ConsensusState", _a0)} +// - context1 +func (_e *Client_Expecter) ConsensusState(context1 interface{}) *Client_ConsensusState_Call { + return &Client_ConsensusState_Call{Call: _e.mock.On("ConsensusState", context1)} } -func (_c *Client_ConsensusState_Call) Run(run func(_a0 context.Context)) *Client_ConsensusState_Call { +func (_c *Client_ConsensusState_Call) Run(run func(context1 context.Context)) *Client_ConsensusState_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *Client_ConsensusState_Call) Return(_a0 *coretypes.ResultConsensusState, _a1 error) *Client_ConsensusState_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_ConsensusState_Call) Return(resultConsensusState *coretypes.ResultConsensusState, err error) *Client_ConsensusState_Call { + _c.Call.Return(resultConsensusState, err) return _c } -func (_c *Client_ConsensusState_Call) RunAndReturn(run func(context.Context) (*coretypes.ResultConsensusState, error)) *Client_ConsensusState_Call { +func (_c *Client_ConsensusState_Call) RunAndReturn(run func(context1 context.Context) (*coretypes.ResultConsensusState, error)) *Client_ConsensusState_Call { _c.Call.Return(run) return _c } -// DumpConsensusState provides a mock function with given fields: _a0 -func (_m *Client) DumpConsensusState(_a0 context.Context) (*coretypes.ResultDumpConsensusState, error) { - ret := _m.Called(_a0) +// DumpConsensusState provides a mock function for the type Client +func (_mock *Client) DumpConsensusState(context1 context.Context) (*coretypes.ResultDumpConsensusState, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for DumpConsensusState") @@ -1046,23 +1025,21 @@ func (_m *Client) DumpConsensusState(_a0 context.Context) (*coretypes.ResultDump var r0 *coretypes.ResultDumpConsensusState var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultDumpConsensusState, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultDumpConsensusState, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultDumpConsensusState); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) *coretypes.ResultDumpConsensusState); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultDumpConsensusState) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1072,31 +1049,31 @@ type Client_DumpConsensusState_Call struct { } // DumpConsensusState is a helper method to define mock.On call -// - _a0 context.Context -func (_e *Client_Expecter) DumpConsensusState(_a0 interface{}) *Client_DumpConsensusState_Call { - return &Client_DumpConsensusState_Call{Call: _e.mock.On("DumpConsensusState", _a0)} +// - context1 +func (_e *Client_Expecter) DumpConsensusState(context1 interface{}) *Client_DumpConsensusState_Call { + return &Client_DumpConsensusState_Call{Call: _e.mock.On("DumpConsensusState", context1)} } -func (_c *Client_DumpConsensusState_Call) Run(run func(_a0 context.Context)) *Client_DumpConsensusState_Call { +func (_c *Client_DumpConsensusState_Call) Run(run func(context1 context.Context)) *Client_DumpConsensusState_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *Client_DumpConsensusState_Call) Return(_a0 *coretypes.ResultDumpConsensusState, _a1 error) *Client_DumpConsensusState_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_DumpConsensusState_Call) Return(resultDumpConsensusState *coretypes.ResultDumpConsensusState, err error) *Client_DumpConsensusState_Call { + _c.Call.Return(resultDumpConsensusState, err) return _c } -func (_c *Client_DumpConsensusState_Call) RunAndReturn(run func(context.Context) (*coretypes.ResultDumpConsensusState, error)) *Client_DumpConsensusState_Call { +func (_c *Client_DumpConsensusState_Call) RunAndReturn(run func(context1 context.Context) (*coretypes.ResultDumpConsensusState, error)) *Client_DumpConsensusState_Call { _c.Call.Return(run) return _c } -// Events provides a mock function with given fields: ctx, req -func (_m *Client) Events(ctx context.Context, req *coretypes.RequestEvents) (*coretypes.ResultEvents, error) { - ret := _m.Called(ctx, req) +// Events provides a mock function for the type Client +func (_mock *Client) Events(ctx context.Context, req *coretypes.RequestEvents) (*coretypes.ResultEvents, error) { + ret := _mock.Called(ctx, req) if len(ret) == 0 { panic("no return value specified for Events") @@ -1104,23 +1081,21 @@ func (_m *Client) Events(ctx context.Context, req *coretypes.RequestEvents) (*co var r0 *coretypes.ResultEvents var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) (*coretypes.ResultEvents, error)); ok { - return rf(ctx, req) + if returnFunc, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) (*coretypes.ResultEvents, error)); ok { + return returnFunc(ctx, req) } - if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) *coretypes.ResultEvents); ok { - r0 = rf(ctx, req) + if returnFunc, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) *coretypes.ResultEvents); ok { + r0 = returnFunc(ctx, req) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultEvents) } } - - if rf, ok := ret.Get(1).(func(context.Context, *coretypes.RequestEvents) error); ok { - r1 = rf(ctx, req) + if returnFunc, ok := ret.Get(1).(func(context.Context, *coretypes.RequestEvents) error); ok { + r1 = returnFunc(ctx, req) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1130,8 +1105,8 @@ type Client_Events_Call struct { } // Events is a helper method to define mock.On call -// - ctx context.Context -// - req *coretypes.RequestEvents +// - ctx +// - req func (_e *Client_Expecter) Events(ctx interface{}, req interface{}) *Client_Events_Call { return &Client_Events_Call{Call: _e.mock.On("Events", ctx, req)} } @@ -1143,19 +1118,19 @@ func (_c *Client_Events_Call) Run(run func(ctx context.Context, req *coretypes.R return _c } -func (_c *Client_Events_Call) Return(_a0 *coretypes.ResultEvents, _a1 error) *Client_Events_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_Events_Call) Return(resultEvents *coretypes.ResultEvents, err error) *Client_Events_Call { + _c.Call.Return(resultEvents, err) return _c } -func (_c *Client_Events_Call) RunAndReturn(run func(context.Context, *coretypes.RequestEvents) (*coretypes.ResultEvents, error)) *Client_Events_Call { +func (_c *Client_Events_Call) RunAndReturn(run func(ctx context.Context, req *coretypes.RequestEvents) (*coretypes.ResultEvents, error)) *Client_Events_Call { _c.Call.Return(run) return _c } -// Genesis provides a mock function with given fields: _a0 -func (_m *Client) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, error) { - ret := _m.Called(_a0) +// Genesis provides a mock function for the type Client +func (_mock *Client) Genesis(context1 context.Context) (*coretypes.ResultGenesis, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for Genesis") @@ -1163,23 +1138,21 @@ func (_m *Client) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, error) var r0 *coretypes.ResultGenesis var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultGenesis, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultGenesis, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultGenesis); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) *coretypes.ResultGenesis); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultGenesis) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1189,31 +1162,31 @@ type Client_Genesis_Call struct { } // Genesis is a helper method to define mock.On call -// - _a0 context.Context -func (_e *Client_Expecter) Genesis(_a0 interface{}) *Client_Genesis_Call { - return &Client_Genesis_Call{Call: _e.mock.On("Genesis", _a0)} +// - context1 +func (_e *Client_Expecter) Genesis(context1 interface{}) *Client_Genesis_Call { + return &Client_Genesis_Call{Call: _e.mock.On("Genesis", context1)} } -func (_c *Client_Genesis_Call) Run(run func(_a0 context.Context)) *Client_Genesis_Call { +func (_c *Client_Genesis_Call) Run(run func(context1 context.Context)) *Client_Genesis_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *Client_Genesis_Call) Return(_a0 *coretypes.ResultGenesis, _a1 error) *Client_Genesis_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_Genesis_Call) Return(resultGenesis *coretypes.ResultGenesis, err error) *Client_Genesis_Call { + _c.Call.Return(resultGenesis, err) return _c } -func (_c *Client_Genesis_Call) RunAndReturn(run func(context.Context) (*coretypes.ResultGenesis, error)) *Client_Genesis_Call { +func (_c *Client_Genesis_Call) RunAndReturn(run func(context1 context.Context) (*coretypes.ResultGenesis, error)) *Client_Genesis_Call { _c.Call.Return(run) return _c } -// GenesisChunked provides a mock function with given fields: _a0, _a1 -func (_m *Client) GenesisChunked(_a0 context.Context, _a1 uint) (*coretypes.ResultGenesisChunk, error) { - ret := _m.Called(_a0, _a1) +// GenesisChunked provides a mock function for the type Client +func (_mock *Client) GenesisChunked(context1 context.Context, v uint) (*coretypes.ResultGenesisChunk, error) { + ret := _mock.Called(context1, v) if len(ret) == 0 { panic("no return value specified for GenesisChunked") @@ -1221,23 +1194,21 @@ func (_m *Client) GenesisChunked(_a0 context.Context, _a1 uint) (*coretypes.Resu var r0 *coretypes.ResultGenesisChunk var r1 error - if rf, ok := ret.Get(0).(func(context.Context, uint) (*coretypes.ResultGenesisChunk, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, uint) (*coretypes.ResultGenesisChunk, error)); ok { + return returnFunc(context1, v) } - if rf, ok := ret.Get(0).(func(context.Context, uint) *coretypes.ResultGenesisChunk); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, uint) *coretypes.ResultGenesisChunk); ok { + r0 = returnFunc(context1, v) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultGenesisChunk) } } - - if rf, ok := ret.Get(1).(func(context.Context, uint) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, uint) error); ok { + r1 = returnFunc(context1, v) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1247,32 +1218,32 @@ type Client_GenesisChunked_Call struct { } // GenesisChunked is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 uint -func (_e *Client_Expecter) GenesisChunked(_a0 interface{}, _a1 interface{}) *Client_GenesisChunked_Call { - return &Client_GenesisChunked_Call{Call: _e.mock.On("GenesisChunked", _a0, _a1)} +// - context1 +// - v +func (_e *Client_Expecter) GenesisChunked(context1 interface{}, v interface{}) *Client_GenesisChunked_Call { + return &Client_GenesisChunked_Call{Call: _e.mock.On("GenesisChunked", context1, v)} } -func (_c *Client_GenesisChunked_Call) Run(run func(_a0 context.Context, _a1 uint)) *Client_GenesisChunked_Call { +func (_c *Client_GenesisChunked_Call) Run(run func(context1 context.Context, v uint)) *Client_GenesisChunked_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(uint)) }) return _c } -func (_c *Client_GenesisChunked_Call) Return(_a0 *coretypes.ResultGenesisChunk, _a1 error) *Client_GenesisChunked_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_GenesisChunked_Call) Return(resultGenesisChunk *coretypes.ResultGenesisChunk, err error) *Client_GenesisChunked_Call { + _c.Call.Return(resultGenesisChunk, err) return _c } -func (_c *Client_GenesisChunked_Call) RunAndReturn(run func(context.Context, uint) (*coretypes.ResultGenesisChunk, error)) *Client_GenesisChunked_Call { +func (_c *Client_GenesisChunked_Call) RunAndReturn(run func(context1 context.Context, v uint) (*coretypes.ResultGenesisChunk, error)) *Client_GenesisChunked_Call { _c.Call.Return(run) return _c } -// Header provides a mock function with given fields: ctx, height -func (_m *Client) Header(ctx context.Context, height *int64) (*coretypes.ResultHeader, error) { - ret := _m.Called(ctx, height) +// Header provides a mock function for the type Client +func (_mock *Client) Header(ctx context.Context, height *int64) (*coretypes.ResultHeader, error) { + ret := _mock.Called(ctx, height) if len(ret) == 0 { panic("no return value specified for Header") @@ -1280,23 +1251,21 @@ func (_m *Client) Header(ctx context.Context, height *int64) (*coretypes.ResultH var r0 *coretypes.ResultHeader var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultHeader, error)); ok { - return rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultHeader, error)); ok { + return returnFunc(ctx, height) } - if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultHeader); ok { - r0 = rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultHeader); ok { + r0 = returnFunc(ctx, height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultHeader) } } - - if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { - r1 = rf(ctx, height) + if returnFunc, ok := ret.Get(1).(func(context.Context, *int64) error); ok { + r1 = returnFunc(ctx, height) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1306,8 +1275,8 @@ type Client_Header_Call struct { } // Header is a helper method to define mock.On call -// - ctx context.Context -// - height *int64 +// - ctx +// - height func (_e *Client_Expecter) Header(ctx interface{}, height interface{}) *Client_Header_Call { return &Client_Header_Call{Call: _e.mock.On("Header", ctx, height)} } @@ -1319,19 +1288,19 @@ func (_c *Client_Header_Call) Run(run func(ctx context.Context, height *int64)) return _c } -func (_c *Client_Header_Call) Return(_a0 *coretypes.ResultHeader, _a1 error) *Client_Header_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_Header_Call) Return(resultHeader *coretypes.ResultHeader, err error) *Client_Header_Call { + _c.Call.Return(resultHeader, err) return _c } -func (_c *Client_Header_Call) RunAndReturn(run func(context.Context, *int64) (*coretypes.ResultHeader, error)) *Client_Header_Call { +func (_c *Client_Header_Call) RunAndReturn(run func(ctx context.Context, height *int64) (*coretypes.ResultHeader, error)) *Client_Header_Call { _c.Call.Return(run) return _c } -// HeaderByHash provides a mock function with given fields: ctx, hash -func (_m *Client) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*coretypes.ResultHeader, error) { - ret := _m.Called(ctx, hash) +// HeaderByHash provides a mock function for the type Client +func (_mock *Client) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*coretypes.ResultHeader, error) { + ret := _mock.Called(ctx, hash) if len(ret) == 0 { panic("no return value specified for HeaderByHash") @@ -1339,23 +1308,21 @@ func (_m *Client) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*coret var r0 *coretypes.ResultHeader var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultHeader, error)); ok { - return rf(ctx, hash) + if returnFunc, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultHeader, error)); ok { + return returnFunc(ctx, hash) } - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultHeader); ok { - r0 = rf(ctx, hash) + if returnFunc, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultHeader); ok { + r0 = returnFunc(ctx, hash) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultHeader) } } - - if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { - r1 = rf(ctx, hash) + if returnFunc, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { + r1 = returnFunc(ctx, hash) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1365,8 +1332,8 @@ type Client_HeaderByHash_Call struct { } // HeaderByHash is a helper method to define mock.On call -// - ctx context.Context -// - hash bytes.HexBytes +// - ctx +// - hash func (_e *Client_Expecter) HeaderByHash(ctx interface{}, hash interface{}) *Client_HeaderByHash_Call { return &Client_HeaderByHash_Call{Call: _e.mock.On("HeaderByHash", ctx, hash)} } @@ -1378,19 +1345,19 @@ func (_c *Client_HeaderByHash_Call) Run(run func(ctx context.Context, hash bytes return _c } -func (_c *Client_HeaderByHash_Call) Return(_a0 *coretypes.ResultHeader, _a1 error) *Client_HeaderByHash_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_HeaderByHash_Call) Return(resultHeader *coretypes.ResultHeader, err error) *Client_HeaderByHash_Call { + _c.Call.Return(resultHeader, err) return _c } -func (_c *Client_HeaderByHash_Call) RunAndReturn(run func(context.Context, bytes.HexBytes) (*coretypes.ResultHeader, error)) *Client_HeaderByHash_Call { +func (_c *Client_HeaderByHash_Call) RunAndReturn(run func(ctx context.Context, hash bytes.HexBytes) (*coretypes.ResultHeader, error)) *Client_HeaderByHash_Call { _c.Call.Return(run) return _c } -// Health provides a mock function with given fields: _a0 -func (_m *Client) Health(_a0 context.Context) (*coretypes.ResultHealth, error) { - ret := _m.Called(_a0) +// Health provides a mock function for the type Client +func (_mock *Client) Health(context1 context.Context) (*coretypes.ResultHealth, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for Health") @@ -1398,23 +1365,21 @@ func (_m *Client) Health(_a0 context.Context) (*coretypes.ResultHealth, error) { var r0 *coretypes.ResultHealth var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultHealth, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultHealth, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultHealth); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) *coretypes.ResultHealth); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultHealth) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1424,31 +1389,31 @@ type Client_Health_Call struct { } // Health is a helper method to define mock.On call -// - _a0 context.Context -func (_e *Client_Expecter) Health(_a0 interface{}) *Client_Health_Call { - return &Client_Health_Call{Call: _e.mock.On("Health", _a0)} +// - context1 +func (_e *Client_Expecter) Health(context1 interface{}) *Client_Health_Call { + return &Client_Health_Call{Call: _e.mock.On("Health", context1)} } -func (_c *Client_Health_Call) Run(run func(_a0 context.Context)) *Client_Health_Call { +func (_c *Client_Health_Call) Run(run func(context1 context.Context)) *Client_Health_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *Client_Health_Call) Return(_a0 *coretypes.ResultHealth, _a1 error) *Client_Health_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_Health_Call) Return(resultHealth *coretypes.ResultHealth, err error) *Client_Health_Call { + _c.Call.Return(resultHealth, err) return _c } -func (_c *Client_Health_Call) RunAndReturn(run func(context.Context) (*coretypes.ResultHealth, error)) *Client_Health_Call { +func (_c *Client_Health_Call) RunAndReturn(run func(context1 context.Context) (*coretypes.ResultHealth, error)) *Client_Health_Call { _c.Call.Return(run) return _c } -// NetInfo provides a mock function with given fields: _a0 -func (_m *Client) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, error) { - ret := _m.Called(_a0) +// NetInfo provides a mock function for the type Client +func (_mock *Client) NetInfo(context1 context.Context) (*coretypes.ResultNetInfo, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for NetInfo") @@ -1456,23 +1421,21 @@ func (_m *Client) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, error) var r0 *coretypes.ResultNetInfo var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultNetInfo, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultNetInfo, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultNetInfo); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) *coretypes.ResultNetInfo); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultNetInfo) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1482,31 +1445,31 @@ type Client_NetInfo_Call struct { } // NetInfo is a helper method to define mock.On call -// - _a0 context.Context -func (_e *Client_Expecter) NetInfo(_a0 interface{}) *Client_NetInfo_Call { - return &Client_NetInfo_Call{Call: _e.mock.On("NetInfo", _a0)} +// - context1 +func (_e *Client_Expecter) NetInfo(context1 interface{}) *Client_NetInfo_Call { + return &Client_NetInfo_Call{Call: _e.mock.On("NetInfo", context1)} } -func (_c *Client_NetInfo_Call) Run(run func(_a0 context.Context)) *Client_NetInfo_Call { +func (_c *Client_NetInfo_Call) Run(run func(context1 context.Context)) *Client_NetInfo_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *Client_NetInfo_Call) Return(_a0 *coretypes.ResultNetInfo, _a1 error) *Client_NetInfo_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_NetInfo_Call) Return(resultNetInfo *coretypes.ResultNetInfo, err error) *Client_NetInfo_Call { + _c.Call.Return(resultNetInfo, err) return _c } -func (_c *Client_NetInfo_Call) RunAndReturn(run func(context.Context) (*coretypes.ResultNetInfo, error)) *Client_NetInfo_Call { +func (_c *Client_NetInfo_Call) RunAndReturn(run func(context1 context.Context) (*coretypes.ResultNetInfo, error)) *Client_NetInfo_Call { _c.Call.Return(run) return _c } -// NumUnconfirmedTxs provides a mock function with given fields: _a0 -func (_m *Client) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.ResultUnconfirmedTxs, error) { - ret := _m.Called(_a0) +// NumUnconfirmedTxs provides a mock function for the type Client +func (_mock *Client) NumUnconfirmedTxs(context1 context.Context) (*coretypes.ResultUnconfirmedTxs, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for NumUnconfirmedTxs") @@ -1514,23 +1477,21 @@ func (_m *Client) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.ResultUncon var r0 *coretypes.ResultUnconfirmedTxs var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultUnconfirmedTxs, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultUnconfirmedTxs, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultUnconfirmedTxs); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) *coretypes.ResultUnconfirmedTxs); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultUnconfirmedTxs) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1540,43 +1501,42 @@ type Client_NumUnconfirmedTxs_Call struct { } // NumUnconfirmedTxs is a helper method to define mock.On call -// - _a0 context.Context -func (_e *Client_Expecter) NumUnconfirmedTxs(_a0 interface{}) *Client_NumUnconfirmedTxs_Call { - return &Client_NumUnconfirmedTxs_Call{Call: _e.mock.On("NumUnconfirmedTxs", _a0)} +// - context1 +func (_e *Client_Expecter) NumUnconfirmedTxs(context1 interface{}) *Client_NumUnconfirmedTxs_Call { + return &Client_NumUnconfirmedTxs_Call{Call: _e.mock.On("NumUnconfirmedTxs", context1)} } -func (_c *Client_NumUnconfirmedTxs_Call) Run(run func(_a0 context.Context)) *Client_NumUnconfirmedTxs_Call { +func (_c *Client_NumUnconfirmedTxs_Call) Run(run func(context1 context.Context)) *Client_NumUnconfirmedTxs_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *Client_NumUnconfirmedTxs_Call) Return(_a0 *coretypes.ResultUnconfirmedTxs, _a1 error) *Client_NumUnconfirmedTxs_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_NumUnconfirmedTxs_Call) Return(resultUnconfirmedTxs *coretypes.ResultUnconfirmedTxs, err error) *Client_NumUnconfirmedTxs_Call { + _c.Call.Return(resultUnconfirmedTxs, err) return _c } -func (_c *Client_NumUnconfirmedTxs_Call) RunAndReturn(run func(context.Context) (*coretypes.ResultUnconfirmedTxs, error)) *Client_NumUnconfirmedTxs_Call { +func (_c *Client_NumUnconfirmedTxs_Call) RunAndReturn(run func(context1 context.Context) (*coretypes.ResultUnconfirmedTxs, error)) *Client_NumUnconfirmedTxs_Call { _c.Call.Return(run) return _c } -// RemoveTx provides a mock function with given fields: _a0, _a1 -func (_m *Client) RemoveTx(_a0 context.Context, _a1 types.TxKey) error { - ret := _m.Called(_a0, _a1) +// RemoveTx provides a mock function for the type Client +func (_mock *Client) RemoveTx(context1 context.Context, txKey types.TxKey) error { + ret := _mock.Called(context1, txKey) if len(ret) == 0 { panic("no return value specified for RemoveTx") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, types.TxKey) error); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.TxKey) error); ok { + r0 = returnFunc(context1, txKey) } else { r0 = ret.Error(0) } - return r0 } @@ -1586,44 +1546,43 @@ type Client_RemoveTx_Call struct { } // RemoveTx is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.TxKey -func (_e *Client_Expecter) RemoveTx(_a0 interface{}, _a1 interface{}) *Client_RemoveTx_Call { - return &Client_RemoveTx_Call{Call: _e.mock.On("RemoveTx", _a0, _a1)} +// - context1 +// - txKey +func (_e *Client_Expecter) RemoveTx(context1 interface{}, txKey interface{}) *Client_RemoveTx_Call { + return &Client_RemoveTx_Call{Call: _e.mock.On("RemoveTx", context1, txKey)} } -func (_c *Client_RemoveTx_Call) Run(run func(_a0 context.Context, _a1 types.TxKey)) *Client_RemoveTx_Call { +func (_c *Client_RemoveTx_Call) Run(run func(context1 context.Context, txKey types.TxKey)) *Client_RemoveTx_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.TxKey)) }) return _c } -func (_c *Client_RemoveTx_Call) Return(_a0 error) *Client_RemoveTx_Call { - _c.Call.Return(_a0) +func (_c *Client_RemoveTx_Call) Return(err error) *Client_RemoveTx_Call { + _c.Call.Return(err) return _c } -func (_c *Client_RemoveTx_Call) RunAndReturn(run func(context.Context, types.TxKey) error) *Client_RemoveTx_Call { +func (_c *Client_RemoveTx_Call) RunAndReturn(run func(context1 context.Context, txKey types.TxKey) error) *Client_RemoveTx_Call { _c.Call.Return(run) return _c } -// Start provides a mock function with given fields: _a0 -func (_m *Client) Start(_a0 context.Context) error { - ret := _m.Called(_a0) +// Start provides a mock function for the type Client +func (_mock *Client) Start(context1 context.Context) error { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for Start") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = returnFunc(context1) } else { r0 = ret.Error(0) } - return r0 } @@ -1633,31 +1592,31 @@ type Client_Start_Call struct { } // Start is a helper method to define mock.On call -// - _a0 context.Context -func (_e *Client_Expecter) Start(_a0 interface{}) *Client_Start_Call { - return &Client_Start_Call{Call: _e.mock.On("Start", _a0)} +// - context1 +func (_e *Client_Expecter) Start(context1 interface{}) *Client_Start_Call { + return &Client_Start_Call{Call: _e.mock.On("Start", context1)} } -func (_c *Client_Start_Call) Run(run func(_a0 context.Context)) *Client_Start_Call { +func (_c *Client_Start_Call) Run(run func(context1 context.Context)) *Client_Start_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *Client_Start_Call) Return(_a0 error) *Client_Start_Call { - _c.Call.Return(_a0) +func (_c *Client_Start_Call) Return(err error) *Client_Start_Call { + _c.Call.Return(err) return _c } -func (_c *Client_Start_Call) RunAndReturn(run func(context.Context) error) *Client_Start_Call { +func (_c *Client_Start_Call) RunAndReturn(run func(context1 context.Context) error) *Client_Start_Call { _c.Call.Return(run) return _c } -// Status provides a mock function with given fields: _a0 -func (_m *Client) Status(_a0 context.Context) (*coretypes.ResultStatus, error) { - ret := _m.Called(_a0) +// Status provides a mock function for the type Client +func (_mock *Client) Status(context1 context.Context) (*coretypes.ResultStatus, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for Status") @@ -1665,23 +1624,21 @@ func (_m *Client) Status(_a0 context.Context) (*coretypes.ResultStatus, error) { var r0 *coretypes.ResultStatus var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultStatus, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultStatus, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultStatus); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) *coretypes.ResultStatus); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultStatus) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1691,38 +1648,37 @@ type Client_Status_Call struct { } // Status is a helper method to define mock.On call -// - _a0 context.Context -func (_e *Client_Expecter) Status(_a0 interface{}) *Client_Status_Call { - return &Client_Status_Call{Call: _e.mock.On("Status", _a0)} +// - context1 +func (_e *Client_Expecter) Status(context1 interface{}) *Client_Status_Call { + return &Client_Status_Call{Call: _e.mock.On("Status", context1)} } -func (_c *Client_Status_Call) Run(run func(_a0 context.Context)) *Client_Status_Call { +func (_c *Client_Status_Call) Run(run func(context1 context.Context)) *Client_Status_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *Client_Status_Call) Return(_a0 *coretypes.ResultStatus, _a1 error) *Client_Status_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_Status_Call) Return(resultStatus *coretypes.ResultStatus, err error) *Client_Status_Call { + _c.Call.Return(resultStatus, err) return _c } -func (_c *Client_Status_Call) RunAndReturn(run func(context.Context) (*coretypes.ResultStatus, error)) *Client_Status_Call { +func (_c *Client_Status_Call) RunAndReturn(run func(context1 context.Context) (*coretypes.ResultStatus, error)) *Client_Status_Call { _c.Call.Return(run) return _c } -// Subscribe provides a mock function with given fields: ctx, subscriber, query, outCapacity -func (_m *Client) Subscribe(ctx context.Context, subscriber string, query string, outCapacity ...int) (<-chan coretypes.ResultEvent, error) { - _va := make([]interface{}, len(outCapacity)) - for _i := range outCapacity { - _va[_i] = outCapacity[_i] +// Subscribe provides a mock function for the type Client +func (_mock *Client) Subscribe(ctx context.Context, subscriber string, query string, outCapacity ...int) (<-chan coretypes.ResultEvent, error) { + var tmpRet mock.Arguments + if len(outCapacity) > 0 { + tmpRet = _mock.Called(ctx, subscriber, query, outCapacity) + } else { + tmpRet = _mock.Called(ctx, subscriber, query) } - var _ca []interface{} - _ca = append(_ca, ctx, subscriber, query) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) + ret := tmpRet if len(ret) == 0 { panic("no return value specified for Subscribe") @@ -1730,23 +1686,21 @@ func (_m *Client) Subscribe(ctx context.Context, subscriber string, query string var r0 <-chan coretypes.ResultEvent var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) (<-chan coretypes.ResultEvent, error)); ok { - return rf(ctx, subscriber, query, outCapacity...) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, ...int) (<-chan coretypes.ResultEvent, error)); ok { + return returnFunc(ctx, subscriber, query, outCapacity...) } - if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) <-chan coretypes.ResultEvent); ok { - r0 = rf(ctx, subscriber, query, outCapacity...) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, ...int) <-chan coretypes.ResultEvent); ok { + r0 = returnFunc(ctx, subscriber, query, outCapacity...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(<-chan coretypes.ResultEvent) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, string, ...int) error); ok { - r1 = rf(ctx, subscriber, query, outCapacity...) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, ...int) error); ok { + r1 = returnFunc(ctx, subscriber, query, outCapacity...) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1756,10 +1710,10 @@ type Client_Subscribe_Call struct { } // Subscribe is a helper method to define mock.On call -// - ctx context.Context -// - subscriber string -// - query string -// - outCapacity ...int +// - ctx +// - subscriber +// - query +// - outCapacity func (_e *Client_Expecter) Subscribe(ctx interface{}, subscriber interface{}, query interface{}, outCapacity ...interface{}) *Client_Subscribe_Call { return &Client_Subscribe_Call{Call: _e.mock.On("Subscribe", append([]interface{}{ctx, subscriber, query}, outCapacity...)...)} @@ -1767,12 +1721,7 @@ func (_e *Client_Expecter) Subscribe(ctx interface{}, subscriber interface{}, qu func (_c *Client_Subscribe_Call) Run(run func(ctx context.Context, subscriber string, query string, outCapacity ...int)) *Client_Subscribe_Call { _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]int, len(args)-3) - for i, a := range args[3:] { - if a != nil { - variadicArgs[i] = a.(int) - } - } + variadicArgs := args[3].([]int) run(args[0].(context.Context), args[1].(string), args[2].(string), variadicArgs...) }) return _c @@ -1783,14 +1732,14 @@ func (_c *Client_Subscribe_Call) Return(out <-chan coretypes.ResultEvent, err er return _c } -func (_c *Client_Subscribe_Call) RunAndReturn(run func(context.Context, string, string, ...int) (<-chan coretypes.ResultEvent, error)) *Client_Subscribe_Call { +func (_c *Client_Subscribe_Call) RunAndReturn(run func(ctx context.Context, subscriber string, query string, outCapacity ...int) (<-chan coretypes.ResultEvent, error)) *Client_Subscribe_Call { _c.Call.Return(run) return _c } -// Tx provides a mock function with given fields: ctx, hash, prove -func (_m *Client) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) (*coretypes.ResultTx, error) { - ret := _m.Called(ctx, hash, prove) +// Tx provides a mock function for the type Client +func (_mock *Client) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) (*coretypes.ResultTx, error) { + ret := _mock.Called(ctx, hash, prove) if len(ret) == 0 { panic("no return value specified for Tx") @@ -1798,23 +1747,21 @@ func (_m *Client) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) (*cor var r0 *coretypes.ResultTx var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) (*coretypes.ResultTx, error)); ok { - return rf(ctx, hash, prove) + if returnFunc, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) (*coretypes.ResultTx, error)); ok { + return returnFunc(ctx, hash, prove) } - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) *coretypes.ResultTx); ok { - r0 = rf(ctx, hash, prove) + if returnFunc, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) *coretypes.ResultTx); ok { + r0 = returnFunc(ctx, hash, prove) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultTx) } } - - if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes, bool) error); ok { - r1 = rf(ctx, hash, prove) + if returnFunc, ok := ret.Get(1).(func(context.Context, bytes.HexBytes, bool) error); ok { + r1 = returnFunc(ctx, hash, prove) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1824,9 +1771,9 @@ type Client_Tx_Call struct { } // Tx is a helper method to define mock.On call -// - ctx context.Context -// - hash bytes.HexBytes -// - prove bool +// - ctx +// - hash +// - prove func (_e *Client_Expecter) Tx(ctx interface{}, hash interface{}, prove interface{}) *Client_Tx_Call { return &Client_Tx_Call{Call: _e.mock.On("Tx", ctx, hash, prove)} } @@ -1838,19 +1785,19 @@ func (_c *Client_Tx_Call) Run(run func(ctx context.Context, hash bytes.HexBytes, return _c } -func (_c *Client_Tx_Call) Return(_a0 *coretypes.ResultTx, _a1 error) *Client_Tx_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_Tx_Call) Return(resultTx *coretypes.ResultTx, err error) *Client_Tx_Call { + _c.Call.Return(resultTx, err) return _c } -func (_c *Client_Tx_Call) RunAndReturn(run func(context.Context, bytes.HexBytes, bool) (*coretypes.ResultTx, error)) *Client_Tx_Call { +func (_c *Client_Tx_Call) RunAndReturn(run func(ctx context.Context, hash bytes.HexBytes, prove bool) (*coretypes.ResultTx, error)) *Client_Tx_Call { _c.Call.Return(run) return _c } -// TxSearch provides a mock function with given fields: ctx, query, prove, page, perPage, orderBy -func (_m *Client) TxSearch(ctx context.Context, query string, prove bool, page *int, perPage *int, orderBy string) (*coretypes.ResultTxSearch, error) { - ret := _m.Called(ctx, query, prove, page, perPage, orderBy) +// TxSearch provides a mock function for the type Client +func (_mock *Client) TxSearch(ctx context.Context, query string, prove bool, page *int, perPage *int, orderBy string) (*coretypes.ResultTxSearch, error) { + ret := _mock.Called(ctx, query, prove, page, perPage, orderBy) if len(ret) == 0 { panic("no return value specified for TxSearch") @@ -1858,23 +1805,21 @@ func (_m *Client) TxSearch(ctx context.Context, query string, prove bool, page * var r0 *coretypes.ResultTxSearch var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) (*coretypes.ResultTxSearch, error)); ok { - return rf(ctx, query, prove, page, perPage, orderBy) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) (*coretypes.ResultTxSearch, error)); ok { + return returnFunc(ctx, query, prove, page, perPage, orderBy) } - if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) *coretypes.ResultTxSearch); ok { - r0 = rf(ctx, query, prove, page, perPage, orderBy) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) *coretypes.ResultTxSearch); ok { + r0 = returnFunc(ctx, query, prove, page, perPage, orderBy) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultTxSearch) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, bool, *int, *int, string) error); ok { - r1 = rf(ctx, query, prove, page, perPage, orderBy) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, bool, *int, *int, string) error); ok { + r1 = returnFunc(ctx, query, prove, page, perPage, orderBy) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1884,12 +1829,12 @@ type Client_TxSearch_Call struct { } // TxSearch is a helper method to define mock.On call -// - ctx context.Context -// - query string -// - prove bool -// - page *int -// - perPage *int -// - orderBy string +// - ctx +// - query +// - prove +// - page +// - perPage +// - orderBy func (_e *Client_Expecter) TxSearch(ctx interface{}, query interface{}, prove interface{}, page interface{}, perPage interface{}, orderBy interface{}) *Client_TxSearch_Call { return &Client_TxSearch_Call{Call: _e.mock.On("TxSearch", ctx, query, prove, page, perPage, orderBy)} } @@ -1901,19 +1846,19 @@ func (_c *Client_TxSearch_Call) Run(run func(ctx context.Context, query string, return _c } -func (_c *Client_TxSearch_Call) Return(_a0 *coretypes.ResultTxSearch, _a1 error) *Client_TxSearch_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_TxSearch_Call) Return(resultTxSearch *coretypes.ResultTxSearch, err error) *Client_TxSearch_Call { + _c.Call.Return(resultTxSearch, err) return _c } -func (_c *Client_TxSearch_Call) RunAndReturn(run func(context.Context, string, bool, *int, *int, string) (*coretypes.ResultTxSearch, error)) *Client_TxSearch_Call { +func (_c *Client_TxSearch_Call) RunAndReturn(run func(ctx context.Context, query string, prove bool, page *int, perPage *int, orderBy string) (*coretypes.ResultTxSearch, error)) *Client_TxSearch_Call { _c.Call.Return(run) return _c } -// UnconfirmedTx provides a mock function with given fields: ctx, txHash -func (_m *Client) UnconfirmedTx(ctx context.Context, txHash []byte) (*coretypes.ResultUnconfirmedTx, error) { - ret := _m.Called(ctx, txHash) +// UnconfirmedTx provides a mock function for the type Client +func (_mock *Client) UnconfirmedTx(ctx context.Context, txHash []byte) (*coretypes.ResultUnconfirmedTx, error) { + ret := _mock.Called(ctx, txHash) if len(ret) == 0 { panic("no return value specified for UnconfirmedTx") @@ -1921,23 +1866,21 @@ func (_m *Client) UnconfirmedTx(ctx context.Context, txHash []byte) (*coretypes. var r0 *coretypes.ResultUnconfirmedTx var r1 error - if rf, ok := ret.Get(0).(func(context.Context, []byte) (*coretypes.ResultUnconfirmedTx, error)); ok { - return rf(ctx, txHash) + if returnFunc, ok := ret.Get(0).(func(context.Context, []byte) (*coretypes.ResultUnconfirmedTx, error)); ok { + return returnFunc(ctx, txHash) } - if rf, ok := ret.Get(0).(func(context.Context, []byte) *coretypes.ResultUnconfirmedTx); ok { - r0 = rf(ctx, txHash) + if returnFunc, ok := ret.Get(0).(func(context.Context, []byte) *coretypes.ResultUnconfirmedTx); ok { + r0 = returnFunc(ctx, txHash) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultUnconfirmedTx) } } - - if rf, ok := ret.Get(1).(func(context.Context, []byte) error); ok { - r1 = rf(ctx, txHash) + if returnFunc, ok := ret.Get(1).(func(context.Context, []byte) error); ok { + r1 = returnFunc(ctx, txHash) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1947,8 +1890,8 @@ type Client_UnconfirmedTx_Call struct { } // UnconfirmedTx is a helper method to define mock.On call -// - ctx context.Context -// - txHash []byte +// - ctx +// - txHash func (_e *Client_Expecter) UnconfirmedTx(ctx interface{}, txHash interface{}) *Client_UnconfirmedTx_Call { return &Client_UnconfirmedTx_Call{Call: _e.mock.On("UnconfirmedTx", ctx, txHash)} } @@ -1960,19 +1903,19 @@ func (_c *Client_UnconfirmedTx_Call) Run(run func(ctx context.Context, txHash [] return _c } -func (_c *Client_UnconfirmedTx_Call) Return(_a0 *coretypes.ResultUnconfirmedTx, _a1 error) *Client_UnconfirmedTx_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_UnconfirmedTx_Call) Return(resultUnconfirmedTx *coretypes.ResultUnconfirmedTx, err error) *Client_UnconfirmedTx_Call { + _c.Call.Return(resultUnconfirmedTx, err) return _c } -func (_c *Client_UnconfirmedTx_Call) RunAndReturn(run func(context.Context, []byte) (*coretypes.ResultUnconfirmedTx, error)) *Client_UnconfirmedTx_Call { +func (_c *Client_UnconfirmedTx_Call) RunAndReturn(run func(ctx context.Context, txHash []byte) (*coretypes.ResultUnconfirmedTx, error)) *Client_UnconfirmedTx_Call { _c.Call.Return(run) return _c } -// UnconfirmedTxs provides a mock function with given fields: ctx, page, perPage -func (_m *Client) UnconfirmedTxs(ctx context.Context, page *int, perPage *int) (*coretypes.ResultUnconfirmedTxs, error) { - ret := _m.Called(ctx, page, perPage) +// UnconfirmedTxs provides a mock function for the type Client +func (_mock *Client) UnconfirmedTxs(ctx context.Context, page *int, perPage *int) (*coretypes.ResultUnconfirmedTxs, error) { + ret := _mock.Called(ctx, page, perPage) if len(ret) == 0 { panic("no return value specified for UnconfirmedTxs") @@ -1980,23 +1923,21 @@ func (_m *Client) UnconfirmedTxs(ctx context.Context, page *int, perPage *int) ( var r0 *coretypes.ResultUnconfirmedTxs var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int, *int) (*coretypes.ResultUnconfirmedTxs, error)); ok { - return rf(ctx, page, perPage) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int, *int) (*coretypes.ResultUnconfirmedTxs, error)); ok { + return returnFunc(ctx, page, perPage) } - if rf, ok := ret.Get(0).(func(context.Context, *int, *int) *coretypes.ResultUnconfirmedTxs); ok { - r0 = rf(ctx, page, perPage) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int, *int) *coretypes.ResultUnconfirmedTxs); ok { + r0 = returnFunc(ctx, page, perPage) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultUnconfirmedTxs) } } - - if rf, ok := ret.Get(1).(func(context.Context, *int, *int) error); ok { - r1 = rf(ctx, page, perPage) + if returnFunc, ok := ret.Get(1).(func(context.Context, *int, *int) error); ok { + r1 = returnFunc(ctx, page, perPage) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -2006,9 +1947,9 @@ type Client_UnconfirmedTxs_Call struct { } // UnconfirmedTxs is a helper method to define mock.On call -// - ctx context.Context -// - page *int -// - perPage *int +// - ctx +// - page +// - perPage func (_e *Client_Expecter) UnconfirmedTxs(ctx interface{}, page interface{}, perPage interface{}) *Client_UnconfirmedTxs_Call { return &Client_UnconfirmedTxs_Call{Call: _e.mock.On("UnconfirmedTxs", ctx, page, perPage)} } @@ -2020,31 +1961,30 @@ func (_c *Client_UnconfirmedTxs_Call) Run(run func(ctx context.Context, page *in return _c } -func (_c *Client_UnconfirmedTxs_Call) Return(_a0 *coretypes.ResultUnconfirmedTxs, _a1 error) *Client_UnconfirmedTxs_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_UnconfirmedTxs_Call) Return(resultUnconfirmedTxs *coretypes.ResultUnconfirmedTxs, err error) *Client_UnconfirmedTxs_Call { + _c.Call.Return(resultUnconfirmedTxs, err) return _c } -func (_c *Client_UnconfirmedTxs_Call) RunAndReturn(run func(context.Context, *int, *int) (*coretypes.ResultUnconfirmedTxs, error)) *Client_UnconfirmedTxs_Call { +func (_c *Client_UnconfirmedTxs_Call) RunAndReturn(run func(ctx context.Context, page *int, perPage *int) (*coretypes.ResultUnconfirmedTxs, error)) *Client_UnconfirmedTxs_Call { _c.Call.Return(run) return _c } -// Unsubscribe provides a mock function with given fields: ctx, subscriber, query -func (_m *Client) Unsubscribe(ctx context.Context, subscriber string, query string) error { - ret := _m.Called(ctx, subscriber, query) +// Unsubscribe provides a mock function for the type Client +func (_mock *Client) Unsubscribe(ctx context.Context, subscriber string, query string) error { + ret := _mock.Called(ctx, subscriber, query) if len(ret) == 0 { panic("no return value specified for Unsubscribe") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { - r0 = rf(ctx, subscriber, query) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = returnFunc(ctx, subscriber, query) } else { r0 = ret.Error(0) } - return r0 } @@ -2054,9 +1994,9 @@ type Client_Unsubscribe_Call struct { } // Unsubscribe is a helper method to define mock.On call -// - ctx context.Context -// - subscriber string -// - query string +// - ctx +// - subscriber +// - query func (_e *Client_Expecter) Unsubscribe(ctx interface{}, subscriber interface{}, query interface{}) *Client_Unsubscribe_Call { return &Client_Unsubscribe_Call{Call: _e.mock.On("Unsubscribe", ctx, subscriber, query)} } @@ -2068,31 +2008,30 @@ func (_c *Client_Unsubscribe_Call) Run(run func(ctx context.Context, subscriber return _c } -func (_c *Client_Unsubscribe_Call) Return(_a0 error) *Client_Unsubscribe_Call { - _c.Call.Return(_a0) +func (_c *Client_Unsubscribe_Call) Return(err error) *Client_Unsubscribe_Call { + _c.Call.Return(err) return _c } -func (_c *Client_Unsubscribe_Call) RunAndReturn(run func(context.Context, string, string) error) *Client_Unsubscribe_Call { +func (_c *Client_Unsubscribe_Call) RunAndReturn(run func(ctx context.Context, subscriber string, query string) error) *Client_Unsubscribe_Call { _c.Call.Return(run) return _c } -// UnsubscribeAll provides a mock function with given fields: ctx, subscriber -func (_m *Client) UnsubscribeAll(ctx context.Context, subscriber string) error { - ret := _m.Called(ctx, subscriber) +// UnsubscribeAll provides a mock function for the type Client +func (_mock *Client) UnsubscribeAll(ctx context.Context, subscriber string) error { + ret := _mock.Called(ctx, subscriber) if len(ret) == 0 { panic("no return value specified for UnsubscribeAll") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, subscriber) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(ctx, subscriber) } else { r0 = ret.Error(0) } - return r0 } @@ -2102,8 +2041,8 @@ type Client_UnsubscribeAll_Call struct { } // UnsubscribeAll is a helper method to define mock.On call -// - ctx context.Context -// - subscriber string +// - ctx +// - subscriber func (_e *Client_Expecter) UnsubscribeAll(ctx interface{}, subscriber interface{}) *Client_UnsubscribeAll_Call { return &Client_UnsubscribeAll_Call{Call: _e.mock.On("UnsubscribeAll", ctx, subscriber)} } @@ -2115,19 +2054,19 @@ func (_c *Client_UnsubscribeAll_Call) Run(run func(ctx context.Context, subscrib return _c } -func (_c *Client_UnsubscribeAll_Call) Return(_a0 error) *Client_UnsubscribeAll_Call { - _c.Call.Return(_a0) +func (_c *Client_UnsubscribeAll_Call) Return(err error) *Client_UnsubscribeAll_Call { + _c.Call.Return(err) return _c } -func (_c *Client_UnsubscribeAll_Call) RunAndReturn(run func(context.Context, string) error) *Client_UnsubscribeAll_Call { +func (_c *Client_UnsubscribeAll_Call) RunAndReturn(run func(ctx context.Context, subscriber string) error) *Client_UnsubscribeAll_Call { _c.Call.Return(run) return _c } -// Validators provides a mock function with given fields: ctx, height, page, perPage, requestQuorumInfo -func (_m *Client) Validators(ctx context.Context, height *int64, page *int, perPage *int, requestQuorumInfo *bool) (*coretypes.ResultValidators, error) { - ret := _m.Called(ctx, height, page, perPage, requestQuorumInfo) +// Validators provides a mock function for the type Client +func (_mock *Client) Validators(ctx context.Context, height *int64, page *int, perPage *int, requestQuorumInfo *bool) (*coretypes.ResultValidators, error) { + ret := _mock.Called(ctx, height, page, perPage, requestQuorumInfo) if len(ret) == 0 { panic("no return value specified for Validators") @@ -2135,23 +2074,21 @@ func (_m *Client) Validators(ctx context.Context, height *int64, page *int, perP var r0 *coretypes.ResultValidators var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) (*coretypes.ResultValidators, error)); ok { - return rf(ctx, height, page, perPage, requestQuorumInfo) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) (*coretypes.ResultValidators, error)); ok { + return returnFunc(ctx, height, page, perPage, requestQuorumInfo) } - if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) *coretypes.ResultValidators); ok { - r0 = rf(ctx, height, page, perPage, requestQuorumInfo) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) *coretypes.ResultValidators); ok { + r0 = returnFunc(ctx, height, page, perPage, requestQuorumInfo) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultValidators) } } - - if rf, ok := ret.Get(1).(func(context.Context, *int64, *int, *int, *bool) error); ok { - r1 = rf(ctx, height, page, perPage, requestQuorumInfo) + if returnFunc, ok := ret.Get(1).(func(context.Context, *int64, *int, *int, *bool) error); ok { + r1 = returnFunc(ctx, height, page, perPage, requestQuorumInfo) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -2161,11 +2098,11 @@ type Client_Validators_Call struct { } // Validators is a helper method to define mock.On call -// - ctx context.Context -// - height *int64 -// - page *int -// - perPage *int -// - requestQuorumInfo *bool +// - ctx +// - height +// - page +// - perPage +// - requestQuorumInfo func (_e *Client_Expecter) Validators(ctx interface{}, height interface{}, page interface{}, perPage interface{}, requestQuorumInfo interface{}) *Client_Validators_Call { return &Client_Validators_Call{Call: _e.mock.On("Validators", ctx, height, page, perPage, requestQuorumInfo)} } @@ -2177,26 +2114,12 @@ func (_c *Client_Validators_Call) Run(run func(ctx context.Context, height *int6 return _c } -func (_c *Client_Validators_Call) Return(_a0 *coretypes.ResultValidators, _a1 error) *Client_Validators_Call { - _c.Call.Return(_a0, _a1) +func (_c *Client_Validators_Call) Return(resultValidators *coretypes.ResultValidators, err error) *Client_Validators_Call { + _c.Call.Return(resultValidators, err) return _c } -func (_c *Client_Validators_Call) RunAndReturn(run func(context.Context, *int64, *int, *int, *bool) (*coretypes.ResultValidators, error)) *Client_Validators_Call { +func (_c *Client_Validators_Call) RunAndReturn(run func(ctx context.Context, height *int64, page *int, perPage *int, requestQuorumInfo *bool) (*coretypes.ResultValidators, error)) *Client_Validators_Call { _c.Call.Return(run) return _c } - -// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewClient(t interface { - mock.TestingT - Cleanup(func()) -}) *Client { - mock := &Client{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/rpc/client/mocks/remoteclient.go b/rpc/client/mocks/remoteclient.go index 53822bc2e5..c677c88a57 100644 --- a/rpc/client/mocks/remoteclient.go +++ b/rpc/client/mocks/remoteclient.go @@ -1,19 +1,32 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - bytes "github.com/dashpay/tenderdash/libs/bytes" - client "github.com/dashpay/tenderdash/rpc/client" + "context" - context "context" + "github.com/dashpay/tenderdash/libs/bytes" + "github.com/dashpay/tenderdash/rpc/client" + "github.com/dashpay/tenderdash/rpc/coretypes" + "github.com/dashpay/tenderdash/types" + mock "github.com/stretchr/testify/mock" +) - coretypes "github.com/dashpay/tenderdash/rpc/coretypes" +// NewRemoteClient creates a new instance of RemoteClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewRemoteClient(t interface { + mock.TestingT + Cleanup(func()) +}) *RemoteClient { + mock := &RemoteClient{} + mock.Mock.Test(t) - mock "github.com/stretchr/testify/mock" + t.Cleanup(func() { mock.AssertExpectations(t) }) - types "github.com/dashpay/tenderdash/types" -) + return mock +} // RemoteClient is an autogenerated mock type for the RemoteClient type type RemoteClient struct { @@ -28,9 +41,9 @@ func (_m *RemoteClient) EXPECT() *RemoteClient_Expecter { return &RemoteClient_Expecter{mock: &_m.Mock} } -// ABCIInfo provides a mock function with given fields: _a0 -func (_m *RemoteClient) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo, error) { - ret := _m.Called(_a0) +// ABCIInfo provides a mock function for the type RemoteClient +func (_mock *RemoteClient) ABCIInfo(context1 context.Context) (*coretypes.ResultABCIInfo, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for ABCIInfo") @@ -38,23 +51,21 @@ func (_m *RemoteClient) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo var r0 *coretypes.ResultABCIInfo var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultABCIInfo, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultABCIInfo, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultABCIInfo); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) *coretypes.ResultABCIInfo); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultABCIInfo) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -64,31 +75,31 @@ type RemoteClient_ABCIInfo_Call struct { } // ABCIInfo is a helper method to define mock.On call -// - _a0 context.Context -func (_e *RemoteClient_Expecter) ABCIInfo(_a0 interface{}) *RemoteClient_ABCIInfo_Call { - return &RemoteClient_ABCIInfo_Call{Call: _e.mock.On("ABCIInfo", _a0)} +// - context1 +func (_e *RemoteClient_Expecter) ABCIInfo(context1 interface{}) *RemoteClient_ABCIInfo_Call { + return &RemoteClient_ABCIInfo_Call{Call: _e.mock.On("ABCIInfo", context1)} } -func (_c *RemoteClient_ABCIInfo_Call) Run(run func(_a0 context.Context)) *RemoteClient_ABCIInfo_Call { +func (_c *RemoteClient_ABCIInfo_Call) Run(run func(context1 context.Context)) *RemoteClient_ABCIInfo_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *RemoteClient_ABCIInfo_Call) Return(_a0 *coretypes.ResultABCIInfo, _a1 error) *RemoteClient_ABCIInfo_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_ABCIInfo_Call) Return(resultABCIInfo *coretypes.ResultABCIInfo, err error) *RemoteClient_ABCIInfo_Call { + _c.Call.Return(resultABCIInfo, err) return _c } -func (_c *RemoteClient_ABCIInfo_Call) RunAndReturn(run func(context.Context) (*coretypes.ResultABCIInfo, error)) *RemoteClient_ABCIInfo_Call { +func (_c *RemoteClient_ABCIInfo_Call) RunAndReturn(run func(context1 context.Context) (*coretypes.ResultABCIInfo, error)) *RemoteClient_ABCIInfo_Call { _c.Call.Return(run) return _c } -// ABCIQuery provides a mock function with given fields: ctx, path, data -func (_m *RemoteClient) ABCIQuery(ctx context.Context, path string, data bytes.HexBytes) (*coretypes.ResultABCIQuery, error) { - ret := _m.Called(ctx, path, data) +// ABCIQuery provides a mock function for the type RemoteClient +func (_mock *RemoteClient) ABCIQuery(ctx context.Context, path string, data bytes.HexBytes) (*coretypes.ResultABCIQuery, error) { + ret := _mock.Called(ctx, path, data) if len(ret) == 0 { panic("no return value specified for ABCIQuery") @@ -96,23 +107,21 @@ func (_m *RemoteClient) ABCIQuery(ctx context.Context, path string, data bytes.H var r0 *coretypes.ResultABCIQuery var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) (*coretypes.ResultABCIQuery, error)); ok { - return rf(ctx, path, data) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) (*coretypes.ResultABCIQuery, error)); ok { + return returnFunc(ctx, path, data) } - if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) *coretypes.ResultABCIQuery); ok { - r0 = rf(ctx, path, data) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) *coretypes.ResultABCIQuery); ok { + r0 = returnFunc(ctx, path, data) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultABCIQuery) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes) error); ok { - r1 = rf(ctx, path, data) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes) error); ok { + r1 = returnFunc(ctx, path, data) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -122,9 +131,9 @@ type RemoteClient_ABCIQuery_Call struct { } // ABCIQuery is a helper method to define mock.On call -// - ctx context.Context -// - path string -// - data bytes.HexBytes +// - ctx +// - path +// - data func (_e *RemoteClient_Expecter) ABCIQuery(ctx interface{}, path interface{}, data interface{}) *RemoteClient_ABCIQuery_Call { return &RemoteClient_ABCIQuery_Call{Call: _e.mock.On("ABCIQuery", ctx, path, data)} } @@ -136,19 +145,19 @@ func (_c *RemoteClient_ABCIQuery_Call) Run(run func(ctx context.Context, path st return _c } -func (_c *RemoteClient_ABCIQuery_Call) Return(_a0 *coretypes.ResultABCIQuery, _a1 error) *RemoteClient_ABCIQuery_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_ABCIQuery_Call) Return(resultABCIQuery *coretypes.ResultABCIQuery, err error) *RemoteClient_ABCIQuery_Call { + _c.Call.Return(resultABCIQuery, err) return _c } -func (_c *RemoteClient_ABCIQuery_Call) RunAndReturn(run func(context.Context, string, bytes.HexBytes) (*coretypes.ResultABCIQuery, error)) *RemoteClient_ABCIQuery_Call { +func (_c *RemoteClient_ABCIQuery_Call) RunAndReturn(run func(ctx context.Context, path string, data bytes.HexBytes) (*coretypes.ResultABCIQuery, error)) *RemoteClient_ABCIQuery_Call { _c.Call.Return(run) return _c } -// ABCIQueryWithOptions provides a mock function with given fields: ctx, path, data, opts -func (_m *RemoteClient) ABCIQueryWithOptions(ctx context.Context, path string, data bytes.HexBytes, opts client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error) { - ret := _m.Called(ctx, path, data, opts) +// ABCIQueryWithOptions provides a mock function for the type RemoteClient +func (_mock *RemoteClient) ABCIQueryWithOptions(ctx context.Context, path string, data bytes.HexBytes, opts client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error) { + ret := _mock.Called(ctx, path, data, opts) if len(ret) == 0 { panic("no return value specified for ABCIQueryWithOptions") @@ -156,23 +165,21 @@ func (_m *RemoteClient) ABCIQueryWithOptions(ctx context.Context, path string, d var r0 *coretypes.ResultABCIQuery var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)); ok { - return rf(ctx, path, data, opts) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)); ok { + return returnFunc(ctx, path, data, opts) } - if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) *coretypes.ResultABCIQuery); ok { - r0 = rf(ctx, path, data, opts) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) *coretypes.ResultABCIQuery); ok { + r0 = returnFunc(ctx, path, data, opts) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultABCIQuery) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) error); ok { - r1 = rf(ctx, path, data, opts) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) error); ok { + r1 = returnFunc(ctx, path, data, opts) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -182,10 +189,10 @@ type RemoteClient_ABCIQueryWithOptions_Call struct { } // ABCIQueryWithOptions is a helper method to define mock.On call -// - ctx context.Context -// - path string -// - data bytes.HexBytes -// - opts client.ABCIQueryOptions +// - ctx +// - path +// - data +// - opts func (_e *RemoteClient_Expecter) ABCIQueryWithOptions(ctx interface{}, path interface{}, data interface{}, opts interface{}) *RemoteClient_ABCIQueryWithOptions_Call { return &RemoteClient_ABCIQueryWithOptions_Call{Call: _e.mock.On("ABCIQueryWithOptions", ctx, path, data, opts)} } @@ -197,19 +204,19 @@ func (_c *RemoteClient_ABCIQueryWithOptions_Call) Run(run func(ctx context.Conte return _c } -func (_c *RemoteClient_ABCIQueryWithOptions_Call) Return(_a0 *coretypes.ResultABCIQuery, _a1 error) *RemoteClient_ABCIQueryWithOptions_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_ABCIQueryWithOptions_Call) Return(resultABCIQuery *coretypes.ResultABCIQuery, err error) *RemoteClient_ABCIQueryWithOptions_Call { + _c.Call.Return(resultABCIQuery, err) return _c } -func (_c *RemoteClient_ABCIQueryWithOptions_Call) RunAndReturn(run func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)) *RemoteClient_ABCIQueryWithOptions_Call { +func (_c *RemoteClient_ABCIQueryWithOptions_Call) RunAndReturn(run func(ctx context.Context, path string, data bytes.HexBytes, opts client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)) *RemoteClient_ABCIQueryWithOptions_Call { _c.Call.Return(run) return _c } -// Block provides a mock function with given fields: ctx, height -func (_m *RemoteClient) Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error) { - ret := _m.Called(ctx, height) +// Block provides a mock function for the type RemoteClient +func (_mock *RemoteClient) Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error) { + ret := _mock.Called(ctx, height) if len(ret) == 0 { panic("no return value specified for Block") @@ -217,23 +224,21 @@ func (_m *RemoteClient) Block(ctx context.Context, height *int64) (*coretypes.Re var r0 *coretypes.ResultBlock var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlock, error)); ok { - return rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlock, error)); ok { + return returnFunc(ctx, height) } - if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlock); ok { - r0 = rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlock); ok { + r0 = returnFunc(ctx, height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBlock) } } - - if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { - r1 = rf(ctx, height) + if returnFunc, ok := ret.Get(1).(func(context.Context, *int64) error); ok { + r1 = returnFunc(ctx, height) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -243,8 +248,8 @@ type RemoteClient_Block_Call struct { } // Block is a helper method to define mock.On call -// - ctx context.Context -// - height *int64 +// - ctx +// - height func (_e *RemoteClient_Expecter) Block(ctx interface{}, height interface{}) *RemoteClient_Block_Call { return &RemoteClient_Block_Call{Call: _e.mock.On("Block", ctx, height)} } @@ -256,19 +261,19 @@ func (_c *RemoteClient_Block_Call) Run(run func(ctx context.Context, height *int return _c } -func (_c *RemoteClient_Block_Call) Return(_a0 *coretypes.ResultBlock, _a1 error) *RemoteClient_Block_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_Block_Call) Return(resultBlock *coretypes.ResultBlock, err error) *RemoteClient_Block_Call { + _c.Call.Return(resultBlock, err) return _c } -func (_c *RemoteClient_Block_Call) RunAndReturn(run func(context.Context, *int64) (*coretypes.ResultBlock, error)) *RemoteClient_Block_Call { +func (_c *RemoteClient_Block_Call) RunAndReturn(run func(ctx context.Context, height *int64) (*coretypes.ResultBlock, error)) *RemoteClient_Block_Call { _c.Call.Return(run) return _c } -// BlockByHash provides a mock function with given fields: ctx, hash -func (_m *RemoteClient) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*coretypes.ResultBlock, error) { - ret := _m.Called(ctx, hash) +// BlockByHash provides a mock function for the type RemoteClient +func (_mock *RemoteClient) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*coretypes.ResultBlock, error) { + ret := _mock.Called(ctx, hash) if len(ret) == 0 { panic("no return value specified for BlockByHash") @@ -276,23 +281,21 @@ func (_m *RemoteClient) BlockByHash(ctx context.Context, hash bytes.HexBytes) (* var r0 *coretypes.ResultBlock var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultBlock, error)); ok { - return rf(ctx, hash) + if returnFunc, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultBlock, error)); ok { + return returnFunc(ctx, hash) } - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultBlock); ok { - r0 = rf(ctx, hash) + if returnFunc, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultBlock); ok { + r0 = returnFunc(ctx, hash) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBlock) } } - - if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { - r1 = rf(ctx, hash) + if returnFunc, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { + r1 = returnFunc(ctx, hash) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -302,8 +305,8 @@ type RemoteClient_BlockByHash_Call struct { } // BlockByHash is a helper method to define mock.On call -// - ctx context.Context -// - hash bytes.HexBytes +// - ctx +// - hash func (_e *RemoteClient_Expecter) BlockByHash(ctx interface{}, hash interface{}) *RemoteClient_BlockByHash_Call { return &RemoteClient_BlockByHash_Call{Call: _e.mock.On("BlockByHash", ctx, hash)} } @@ -315,19 +318,19 @@ func (_c *RemoteClient_BlockByHash_Call) Run(run func(ctx context.Context, hash return _c } -func (_c *RemoteClient_BlockByHash_Call) Return(_a0 *coretypes.ResultBlock, _a1 error) *RemoteClient_BlockByHash_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_BlockByHash_Call) Return(resultBlock *coretypes.ResultBlock, err error) *RemoteClient_BlockByHash_Call { + _c.Call.Return(resultBlock, err) return _c } -func (_c *RemoteClient_BlockByHash_Call) RunAndReturn(run func(context.Context, bytes.HexBytes) (*coretypes.ResultBlock, error)) *RemoteClient_BlockByHash_Call { +func (_c *RemoteClient_BlockByHash_Call) RunAndReturn(run func(ctx context.Context, hash bytes.HexBytes) (*coretypes.ResultBlock, error)) *RemoteClient_BlockByHash_Call { _c.Call.Return(run) return _c } -// BlockResults provides a mock function with given fields: ctx, height -func (_m *RemoteClient) BlockResults(ctx context.Context, height *int64) (*coretypes.ResultBlockResults, error) { - ret := _m.Called(ctx, height) +// BlockResults provides a mock function for the type RemoteClient +func (_mock *RemoteClient) BlockResults(ctx context.Context, height *int64) (*coretypes.ResultBlockResults, error) { + ret := _mock.Called(ctx, height) if len(ret) == 0 { panic("no return value specified for BlockResults") @@ -335,23 +338,21 @@ func (_m *RemoteClient) BlockResults(ctx context.Context, height *int64) (*coret var r0 *coretypes.ResultBlockResults var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlockResults, error)); ok { - return rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlockResults, error)); ok { + return returnFunc(ctx, height) } - if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlockResults); ok { - r0 = rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlockResults); ok { + r0 = returnFunc(ctx, height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBlockResults) } } - - if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { - r1 = rf(ctx, height) + if returnFunc, ok := ret.Get(1).(func(context.Context, *int64) error); ok { + r1 = returnFunc(ctx, height) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -361,8 +362,8 @@ type RemoteClient_BlockResults_Call struct { } // BlockResults is a helper method to define mock.On call -// - ctx context.Context -// - height *int64 +// - ctx +// - height func (_e *RemoteClient_Expecter) BlockResults(ctx interface{}, height interface{}) *RemoteClient_BlockResults_Call { return &RemoteClient_BlockResults_Call{Call: _e.mock.On("BlockResults", ctx, height)} } @@ -374,19 +375,19 @@ func (_c *RemoteClient_BlockResults_Call) Run(run func(ctx context.Context, heig return _c } -func (_c *RemoteClient_BlockResults_Call) Return(_a0 *coretypes.ResultBlockResults, _a1 error) *RemoteClient_BlockResults_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_BlockResults_Call) Return(resultBlockResults *coretypes.ResultBlockResults, err error) *RemoteClient_BlockResults_Call { + _c.Call.Return(resultBlockResults, err) return _c } -func (_c *RemoteClient_BlockResults_Call) RunAndReturn(run func(context.Context, *int64) (*coretypes.ResultBlockResults, error)) *RemoteClient_BlockResults_Call { +func (_c *RemoteClient_BlockResults_Call) RunAndReturn(run func(ctx context.Context, height *int64) (*coretypes.ResultBlockResults, error)) *RemoteClient_BlockResults_Call { _c.Call.Return(run) return _c } -// BlockSearch provides a mock function with given fields: ctx, query, page, perPage, orderBy -func (_m *RemoteClient) BlockSearch(ctx context.Context, query string, page *int, perPage *int, orderBy string) (*coretypes.ResultBlockSearch, error) { - ret := _m.Called(ctx, query, page, perPage, orderBy) +// BlockSearch provides a mock function for the type RemoteClient +func (_mock *RemoteClient) BlockSearch(ctx context.Context, query string, page *int, perPage *int, orderBy string) (*coretypes.ResultBlockSearch, error) { + ret := _mock.Called(ctx, query, page, perPage, orderBy) if len(ret) == 0 { panic("no return value specified for BlockSearch") @@ -394,23 +395,21 @@ func (_m *RemoteClient) BlockSearch(ctx context.Context, query string, page *int var r0 *coretypes.ResultBlockSearch var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) (*coretypes.ResultBlockSearch, error)); ok { - return rf(ctx, query, page, perPage, orderBy) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) (*coretypes.ResultBlockSearch, error)); ok { + return returnFunc(ctx, query, page, perPage, orderBy) } - if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) *coretypes.ResultBlockSearch); ok { - r0 = rf(ctx, query, page, perPage, orderBy) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) *coretypes.ResultBlockSearch); ok { + r0 = returnFunc(ctx, query, page, perPage, orderBy) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBlockSearch) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, *int, *int, string) error); ok { - r1 = rf(ctx, query, page, perPage, orderBy) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, *int, *int, string) error); ok { + r1 = returnFunc(ctx, query, page, perPage, orderBy) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -420,11 +419,11 @@ type RemoteClient_BlockSearch_Call struct { } // BlockSearch is a helper method to define mock.On call -// - ctx context.Context -// - query string -// - page *int -// - perPage *int -// - orderBy string +// - ctx +// - query +// - page +// - perPage +// - orderBy func (_e *RemoteClient_Expecter) BlockSearch(ctx interface{}, query interface{}, page interface{}, perPage interface{}, orderBy interface{}) *RemoteClient_BlockSearch_Call { return &RemoteClient_BlockSearch_Call{Call: _e.mock.On("BlockSearch", ctx, query, page, perPage, orderBy)} } @@ -436,19 +435,19 @@ func (_c *RemoteClient_BlockSearch_Call) Run(run func(ctx context.Context, query return _c } -func (_c *RemoteClient_BlockSearch_Call) Return(_a0 *coretypes.ResultBlockSearch, _a1 error) *RemoteClient_BlockSearch_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_BlockSearch_Call) Return(resultBlockSearch *coretypes.ResultBlockSearch, err error) *RemoteClient_BlockSearch_Call { + _c.Call.Return(resultBlockSearch, err) return _c } -func (_c *RemoteClient_BlockSearch_Call) RunAndReturn(run func(context.Context, string, *int, *int, string) (*coretypes.ResultBlockSearch, error)) *RemoteClient_BlockSearch_Call { +func (_c *RemoteClient_BlockSearch_Call) RunAndReturn(run func(ctx context.Context, query string, page *int, perPage *int, orderBy string) (*coretypes.ResultBlockSearch, error)) *RemoteClient_BlockSearch_Call { _c.Call.Return(run) return _c } -// BlockchainInfo provides a mock function with given fields: ctx, minHeight, maxHeight -func (_m *RemoteClient) BlockchainInfo(ctx context.Context, minHeight int64, maxHeight int64) (*coretypes.ResultBlockchainInfo, error) { - ret := _m.Called(ctx, minHeight, maxHeight) +// BlockchainInfo provides a mock function for the type RemoteClient +func (_mock *RemoteClient) BlockchainInfo(ctx context.Context, minHeight int64, maxHeight int64) (*coretypes.ResultBlockchainInfo, error) { + ret := _mock.Called(ctx, minHeight, maxHeight) if len(ret) == 0 { panic("no return value specified for BlockchainInfo") @@ -456,23 +455,21 @@ func (_m *RemoteClient) BlockchainInfo(ctx context.Context, minHeight int64, max var r0 *coretypes.ResultBlockchainInfo var r1 error - if rf, ok := ret.Get(0).(func(context.Context, int64, int64) (*coretypes.ResultBlockchainInfo, error)); ok { - return rf(ctx, minHeight, maxHeight) + if returnFunc, ok := ret.Get(0).(func(context.Context, int64, int64) (*coretypes.ResultBlockchainInfo, error)); ok { + return returnFunc(ctx, minHeight, maxHeight) } - if rf, ok := ret.Get(0).(func(context.Context, int64, int64) *coretypes.ResultBlockchainInfo); ok { - r0 = rf(ctx, minHeight, maxHeight) + if returnFunc, ok := ret.Get(0).(func(context.Context, int64, int64) *coretypes.ResultBlockchainInfo); ok { + r0 = returnFunc(ctx, minHeight, maxHeight) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBlockchainInfo) } } - - if rf, ok := ret.Get(1).(func(context.Context, int64, int64) error); ok { - r1 = rf(ctx, minHeight, maxHeight) + if returnFunc, ok := ret.Get(1).(func(context.Context, int64, int64) error); ok { + r1 = returnFunc(ctx, minHeight, maxHeight) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -482,9 +479,9 @@ type RemoteClient_BlockchainInfo_Call struct { } // BlockchainInfo is a helper method to define mock.On call -// - ctx context.Context -// - minHeight int64 -// - maxHeight int64 +// - ctx +// - minHeight +// - maxHeight func (_e *RemoteClient_Expecter) BlockchainInfo(ctx interface{}, minHeight interface{}, maxHeight interface{}) *RemoteClient_BlockchainInfo_Call { return &RemoteClient_BlockchainInfo_Call{Call: _e.mock.On("BlockchainInfo", ctx, minHeight, maxHeight)} } @@ -496,19 +493,19 @@ func (_c *RemoteClient_BlockchainInfo_Call) Run(run func(ctx context.Context, mi return _c } -func (_c *RemoteClient_BlockchainInfo_Call) Return(_a0 *coretypes.ResultBlockchainInfo, _a1 error) *RemoteClient_BlockchainInfo_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_BlockchainInfo_Call) Return(resultBlockchainInfo *coretypes.ResultBlockchainInfo, err error) *RemoteClient_BlockchainInfo_Call { + _c.Call.Return(resultBlockchainInfo, err) return _c } -func (_c *RemoteClient_BlockchainInfo_Call) RunAndReturn(run func(context.Context, int64, int64) (*coretypes.ResultBlockchainInfo, error)) *RemoteClient_BlockchainInfo_Call { +func (_c *RemoteClient_BlockchainInfo_Call) RunAndReturn(run func(ctx context.Context, minHeight int64, maxHeight int64) (*coretypes.ResultBlockchainInfo, error)) *RemoteClient_BlockchainInfo_Call { _c.Call.Return(run) return _c } -// BroadcastEvidence provides a mock function with given fields: _a0, _a1 -func (_m *RemoteClient) BroadcastEvidence(_a0 context.Context, _a1 types.Evidence) (*coretypes.ResultBroadcastEvidence, error) { - ret := _m.Called(_a0, _a1) +// BroadcastEvidence provides a mock function for the type RemoteClient +func (_mock *RemoteClient) BroadcastEvidence(context1 context.Context, evidence types.Evidence) (*coretypes.ResultBroadcastEvidence, error) { + ret := _mock.Called(context1, evidence) if len(ret) == 0 { panic("no return value specified for BroadcastEvidence") @@ -516,23 +513,21 @@ func (_m *RemoteClient) BroadcastEvidence(_a0 context.Context, _a1 types.Evidenc var r0 *coretypes.ResultBroadcastEvidence var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) (*coretypes.ResultBroadcastEvidence, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Evidence) (*coretypes.ResultBroadcastEvidence, error)); ok { + return returnFunc(context1, evidence) } - if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) *coretypes.ResultBroadcastEvidence); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Evidence) *coretypes.ResultBroadcastEvidence); ok { + r0 = returnFunc(context1, evidence) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBroadcastEvidence) } } - - if rf, ok := ret.Get(1).(func(context.Context, types.Evidence) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, types.Evidence) error); ok { + r1 = returnFunc(context1, evidence) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -542,32 +537,32 @@ type RemoteClient_BroadcastEvidence_Call struct { } // BroadcastEvidence is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.Evidence -func (_e *RemoteClient_Expecter) BroadcastEvidence(_a0 interface{}, _a1 interface{}) *RemoteClient_BroadcastEvidence_Call { - return &RemoteClient_BroadcastEvidence_Call{Call: _e.mock.On("BroadcastEvidence", _a0, _a1)} +// - context1 +// - evidence +func (_e *RemoteClient_Expecter) BroadcastEvidence(context1 interface{}, evidence interface{}) *RemoteClient_BroadcastEvidence_Call { + return &RemoteClient_BroadcastEvidence_Call{Call: _e.mock.On("BroadcastEvidence", context1, evidence)} } -func (_c *RemoteClient_BroadcastEvidence_Call) Run(run func(_a0 context.Context, _a1 types.Evidence)) *RemoteClient_BroadcastEvidence_Call { +func (_c *RemoteClient_BroadcastEvidence_Call) Run(run func(context1 context.Context, evidence types.Evidence)) *RemoteClient_BroadcastEvidence_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.Evidence)) }) return _c } -func (_c *RemoteClient_BroadcastEvidence_Call) Return(_a0 *coretypes.ResultBroadcastEvidence, _a1 error) *RemoteClient_BroadcastEvidence_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_BroadcastEvidence_Call) Return(resultBroadcastEvidence *coretypes.ResultBroadcastEvidence, err error) *RemoteClient_BroadcastEvidence_Call { + _c.Call.Return(resultBroadcastEvidence, err) return _c } -func (_c *RemoteClient_BroadcastEvidence_Call) RunAndReturn(run func(context.Context, types.Evidence) (*coretypes.ResultBroadcastEvidence, error)) *RemoteClient_BroadcastEvidence_Call { +func (_c *RemoteClient_BroadcastEvidence_Call) RunAndReturn(run func(context1 context.Context, evidence types.Evidence) (*coretypes.ResultBroadcastEvidence, error)) *RemoteClient_BroadcastEvidence_Call { _c.Call.Return(run) return _c } -// BroadcastTx provides a mock function with given fields: _a0, _a1 -func (_m *RemoteClient) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultBroadcastTx, error) { - ret := _m.Called(_a0, _a1) +// BroadcastTx provides a mock function for the type RemoteClient +func (_mock *RemoteClient) BroadcastTx(context1 context.Context, tx types.Tx) (*coretypes.ResultBroadcastTx, error) { + ret := _mock.Called(context1, tx) if len(ret) == 0 { panic("no return value specified for BroadcastTx") @@ -575,23 +570,21 @@ func (_m *RemoteClient) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretyp var r0 *coretypes.ResultBroadcastTx var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return returnFunc(context1, tx) } - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { + r0 = returnFunc(context1, tx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBroadcastTx) } } - - if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { + r1 = returnFunc(context1, tx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -601,32 +594,32 @@ type RemoteClient_BroadcastTx_Call struct { } // BroadcastTx is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.Tx -func (_e *RemoteClient_Expecter) BroadcastTx(_a0 interface{}, _a1 interface{}) *RemoteClient_BroadcastTx_Call { - return &RemoteClient_BroadcastTx_Call{Call: _e.mock.On("BroadcastTx", _a0, _a1)} +// - context1 +// - tx +func (_e *RemoteClient_Expecter) BroadcastTx(context1 interface{}, tx interface{}) *RemoteClient_BroadcastTx_Call { + return &RemoteClient_BroadcastTx_Call{Call: _e.mock.On("BroadcastTx", context1, tx)} } -func (_c *RemoteClient_BroadcastTx_Call) Run(run func(_a0 context.Context, _a1 types.Tx)) *RemoteClient_BroadcastTx_Call { +func (_c *RemoteClient_BroadcastTx_Call) Run(run func(context1 context.Context, tx types.Tx)) *RemoteClient_BroadcastTx_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.Tx)) }) return _c } -func (_c *RemoteClient_BroadcastTx_Call) Return(_a0 *coretypes.ResultBroadcastTx, _a1 error) *RemoteClient_BroadcastTx_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_BroadcastTx_Call) Return(resultBroadcastTx *coretypes.ResultBroadcastTx, err error) *RemoteClient_BroadcastTx_Call { + _c.Call.Return(resultBroadcastTx, err) return _c } -func (_c *RemoteClient_BroadcastTx_Call) RunAndReturn(run func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)) *RemoteClient_BroadcastTx_Call { +func (_c *RemoteClient_BroadcastTx_Call) RunAndReturn(run func(context1 context.Context, tx types.Tx) (*coretypes.ResultBroadcastTx, error)) *RemoteClient_BroadcastTx_Call { _c.Call.Return(run) return _c } -// BroadcastTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *RemoteClient) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultBroadcastTx, error) { - ret := _m.Called(_a0, _a1) +// BroadcastTxAsync provides a mock function for the type RemoteClient +func (_mock *RemoteClient) BroadcastTxAsync(context1 context.Context, tx types.Tx) (*coretypes.ResultBroadcastTx, error) { + ret := _mock.Called(context1, tx) if len(ret) == 0 { panic("no return value specified for BroadcastTxAsync") @@ -634,23 +627,21 @@ func (_m *RemoteClient) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*co var r0 *coretypes.ResultBroadcastTx var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return returnFunc(context1, tx) } - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { + r0 = returnFunc(context1, tx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBroadcastTx) } } - - if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { + r1 = returnFunc(context1, tx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -660,32 +651,32 @@ type RemoteClient_BroadcastTxAsync_Call struct { } // BroadcastTxAsync is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.Tx -func (_e *RemoteClient_Expecter) BroadcastTxAsync(_a0 interface{}, _a1 interface{}) *RemoteClient_BroadcastTxAsync_Call { - return &RemoteClient_BroadcastTxAsync_Call{Call: _e.mock.On("BroadcastTxAsync", _a0, _a1)} +// - context1 +// - tx +func (_e *RemoteClient_Expecter) BroadcastTxAsync(context1 interface{}, tx interface{}) *RemoteClient_BroadcastTxAsync_Call { + return &RemoteClient_BroadcastTxAsync_Call{Call: _e.mock.On("BroadcastTxAsync", context1, tx)} } -func (_c *RemoteClient_BroadcastTxAsync_Call) Run(run func(_a0 context.Context, _a1 types.Tx)) *RemoteClient_BroadcastTxAsync_Call { +func (_c *RemoteClient_BroadcastTxAsync_Call) Run(run func(context1 context.Context, tx types.Tx)) *RemoteClient_BroadcastTxAsync_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.Tx)) }) return _c } -func (_c *RemoteClient_BroadcastTxAsync_Call) Return(_a0 *coretypes.ResultBroadcastTx, _a1 error) *RemoteClient_BroadcastTxAsync_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_BroadcastTxAsync_Call) Return(resultBroadcastTx *coretypes.ResultBroadcastTx, err error) *RemoteClient_BroadcastTxAsync_Call { + _c.Call.Return(resultBroadcastTx, err) return _c } -func (_c *RemoteClient_BroadcastTxAsync_Call) RunAndReturn(run func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)) *RemoteClient_BroadcastTxAsync_Call { +func (_c *RemoteClient_BroadcastTxAsync_Call) RunAndReturn(run func(context1 context.Context, tx types.Tx) (*coretypes.ResultBroadcastTx, error)) *RemoteClient_BroadcastTxAsync_Call { _c.Call.Return(run) return _c } -// BroadcastTxCommit provides a mock function with given fields: _a0, _a1 -func (_m *RemoteClient) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultBroadcastTxCommit, error) { - ret := _m.Called(_a0, _a1) +// BroadcastTxCommit provides a mock function for the type RemoteClient +func (_mock *RemoteClient) BroadcastTxCommit(context1 context.Context, tx types.Tx) (*coretypes.ResultBroadcastTxCommit, error) { + ret := _mock.Called(context1, tx) if len(ret) == 0 { panic("no return value specified for BroadcastTxCommit") @@ -693,23 +684,21 @@ func (_m *RemoteClient) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*c var r0 *coretypes.ResultBroadcastTxCommit var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTxCommit, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTxCommit, error)); ok { + return returnFunc(context1, tx) } - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTxCommit); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTxCommit); ok { + r0 = returnFunc(context1, tx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBroadcastTxCommit) } } - - if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { + r1 = returnFunc(context1, tx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -719,32 +708,32 @@ type RemoteClient_BroadcastTxCommit_Call struct { } // BroadcastTxCommit is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.Tx -func (_e *RemoteClient_Expecter) BroadcastTxCommit(_a0 interface{}, _a1 interface{}) *RemoteClient_BroadcastTxCommit_Call { - return &RemoteClient_BroadcastTxCommit_Call{Call: _e.mock.On("BroadcastTxCommit", _a0, _a1)} +// - context1 +// - tx +func (_e *RemoteClient_Expecter) BroadcastTxCommit(context1 interface{}, tx interface{}) *RemoteClient_BroadcastTxCommit_Call { + return &RemoteClient_BroadcastTxCommit_Call{Call: _e.mock.On("BroadcastTxCommit", context1, tx)} } -func (_c *RemoteClient_BroadcastTxCommit_Call) Run(run func(_a0 context.Context, _a1 types.Tx)) *RemoteClient_BroadcastTxCommit_Call { +func (_c *RemoteClient_BroadcastTxCommit_Call) Run(run func(context1 context.Context, tx types.Tx)) *RemoteClient_BroadcastTxCommit_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.Tx)) }) return _c } -func (_c *RemoteClient_BroadcastTxCommit_Call) Return(_a0 *coretypes.ResultBroadcastTxCommit, _a1 error) *RemoteClient_BroadcastTxCommit_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_BroadcastTxCommit_Call) Return(resultBroadcastTxCommit *coretypes.ResultBroadcastTxCommit, err error) *RemoteClient_BroadcastTxCommit_Call { + _c.Call.Return(resultBroadcastTxCommit, err) return _c } -func (_c *RemoteClient_BroadcastTxCommit_Call) RunAndReturn(run func(context.Context, types.Tx) (*coretypes.ResultBroadcastTxCommit, error)) *RemoteClient_BroadcastTxCommit_Call { +func (_c *RemoteClient_BroadcastTxCommit_Call) RunAndReturn(run func(context1 context.Context, tx types.Tx) (*coretypes.ResultBroadcastTxCommit, error)) *RemoteClient_BroadcastTxCommit_Call { _c.Call.Return(run) return _c } -// BroadcastTxSync provides a mock function with given fields: _a0, _a1 -func (_m *RemoteClient) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultBroadcastTx, error) { - ret := _m.Called(_a0, _a1) +// BroadcastTxSync provides a mock function for the type RemoteClient +func (_mock *RemoteClient) BroadcastTxSync(context1 context.Context, tx types.Tx) (*coretypes.ResultBroadcastTx, error) { + ret := _mock.Called(context1, tx) if len(ret) == 0 { panic("no return value specified for BroadcastTxSync") @@ -752,23 +741,21 @@ func (_m *RemoteClient) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*cor var r0 *coretypes.ResultBroadcastTx var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return returnFunc(context1, tx) } - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { + r0 = returnFunc(context1, tx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultBroadcastTx) } } - - if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { + r1 = returnFunc(context1, tx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -778,32 +765,32 @@ type RemoteClient_BroadcastTxSync_Call struct { } // BroadcastTxSync is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.Tx -func (_e *RemoteClient_Expecter) BroadcastTxSync(_a0 interface{}, _a1 interface{}) *RemoteClient_BroadcastTxSync_Call { - return &RemoteClient_BroadcastTxSync_Call{Call: _e.mock.On("BroadcastTxSync", _a0, _a1)} +// - context1 +// - tx +func (_e *RemoteClient_Expecter) BroadcastTxSync(context1 interface{}, tx interface{}) *RemoteClient_BroadcastTxSync_Call { + return &RemoteClient_BroadcastTxSync_Call{Call: _e.mock.On("BroadcastTxSync", context1, tx)} } -func (_c *RemoteClient_BroadcastTxSync_Call) Run(run func(_a0 context.Context, _a1 types.Tx)) *RemoteClient_BroadcastTxSync_Call { +func (_c *RemoteClient_BroadcastTxSync_Call) Run(run func(context1 context.Context, tx types.Tx)) *RemoteClient_BroadcastTxSync_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.Tx)) }) return _c } -func (_c *RemoteClient_BroadcastTxSync_Call) Return(_a0 *coretypes.ResultBroadcastTx, _a1 error) *RemoteClient_BroadcastTxSync_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_BroadcastTxSync_Call) Return(resultBroadcastTx *coretypes.ResultBroadcastTx, err error) *RemoteClient_BroadcastTxSync_Call { + _c.Call.Return(resultBroadcastTx, err) return _c } -func (_c *RemoteClient_BroadcastTxSync_Call) RunAndReturn(run func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)) *RemoteClient_BroadcastTxSync_Call { +func (_c *RemoteClient_BroadcastTxSync_Call) RunAndReturn(run func(context1 context.Context, tx types.Tx) (*coretypes.ResultBroadcastTx, error)) *RemoteClient_BroadcastTxSync_Call { _c.Call.Return(run) return _c } -// CheckTx provides a mock function with given fields: _a0, _a1 -func (_m *RemoteClient) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultCheckTx, error) { - ret := _m.Called(_a0, _a1) +// CheckTx provides a mock function for the type RemoteClient +func (_mock *RemoteClient) CheckTx(context1 context.Context, tx types.Tx) (*coretypes.ResultCheckTx, error) { + ret := _mock.Called(context1, tx) if len(ret) == 0 { panic("no return value specified for CheckTx") @@ -811,23 +798,21 @@ func (_m *RemoteClient) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.R var r0 *coretypes.ResultCheckTx var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultCheckTx, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultCheckTx, error)); ok { + return returnFunc(context1, tx) } - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultCheckTx); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultCheckTx); ok { + r0 = returnFunc(context1, tx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultCheckTx) } } - - if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { + r1 = returnFunc(context1, tx) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -837,32 +822,32 @@ type RemoteClient_CheckTx_Call struct { } // CheckTx is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.Tx -func (_e *RemoteClient_Expecter) CheckTx(_a0 interface{}, _a1 interface{}) *RemoteClient_CheckTx_Call { - return &RemoteClient_CheckTx_Call{Call: _e.mock.On("CheckTx", _a0, _a1)} +// - context1 +// - tx +func (_e *RemoteClient_Expecter) CheckTx(context1 interface{}, tx interface{}) *RemoteClient_CheckTx_Call { + return &RemoteClient_CheckTx_Call{Call: _e.mock.On("CheckTx", context1, tx)} } -func (_c *RemoteClient_CheckTx_Call) Run(run func(_a0 context.Context, _a1 types.Tx)) *RemoteClient_CheckTx_Call { +func (_c *RemoteClient_CheckTx_Call) Run(run func(context1 context.Context, tx types.Tx)) *RemoteClient_CheckTx_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.Tx)) }) return _c } -func (_c *RemoteClient_CheckTx_Call) Return(_a0 *coretypes.ResultCheckTx, _a1 error) *RemoteClient_CheckTx_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_CheckTx_Call) Return(resultCheckTx *coretypes.ResultCheckTx, err error) *RemoteClient_CheckTx_Call { + _c.Call.Return(resultCheckTx, err) return _c } -func (_c *RemoteClient_CheckTx_Call) RunAndReturn(run func(context.Context, types.Tx) (*coretypes.ResultCheckTx, error)) *RemoteClient_CheckTx_Call { +func (_c *RemoteClient_CheckTx_Call) RunAndReturn(run func(context1 context.Context, tx types.Tx) (*coretypes.ResultCheckTx, error)) *RemoteClient_CheckTx_Call { _c.Call.Return(run) return _c } -// Commit provides a mock function with given fields: ctx, height -func (_m *RemoteClient) Commit(ctx context.Context, height *int64) (*coretypes.ResultCommit, error) { - ret := _m.Called(ctx, height) +// Commit provides a mock function for the type RemoteClient +func (_mock *RemoteClient) Commit(ctx context.Context, height *int64) (*coretypes.ResultCommit, error) { + ret := _mock.Called(ctx, height) if len(ret) == 0 { panic("no return value specified for Commit") @@ -870,23 +855,21 @@ func (_m *RemoteClient) Commit(ctx context.Context, height *int64) (*coretypes.R var r0 *coretypes.ResultCommit var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultCommit, error)); ok { - return rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultCommit, error)); ok { + return returnFunc(ctx, height) } - if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultCommit); ok { - r0 = rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultCommit); ok { + r0 = returnFunc(ctx, height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultCommit) } } - - if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { - r1 = rf(ctx, height) + if returnFunc, ok := ret.Get(1).(func(context.Context, *int64) error); ok { + r1 = returnFunc(ctx, height) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -896,8 +879,8 @@ type RemoteClient_Commit_Call struct { } // Commit is a helper method to define mock.On call -// - ctx context.Context -// - height *int64 +// - ctx +// - height func (_e *RemoteClient_Expecter) Commit(ctx interface{}, height interface{}) *RemoteClient_Commit_Call { return &RemoteClient_Commit_Call{Call: _e.mock.On("Commit", ctx, height)} } @@ -909,19 +892,19 @@ func (_c *RemoteClient_Commit_Call) Run(run func(ctx context.Context, height *in return _c } -func (_c *RemoteClient_Commit_Call) Return(_a0 *coretypes.ResultCommit, _a1 error) *RemoteClient_Commit_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_Commit_Call) Return(resultCommit *coretypes.ResultCommit, err error) *RemoteClient_Commit_Call { + _c.Call.Return(resultCommit, err) return _c } -func (_c *RemoteClient_Commit_Call) RunAndReturn(run func(context.Context, *int64) (*coretypes.ResultCommit, error)) *RemoteClient_Commit_Call { +func (_c *RemoteClient_Commit_Call) RunAndReturn(run func(ctx context.Context, height *int64) (*coretypes.ResultCommit, error)) *RemoteClient_Commit_Call { _c.Call.Return(run) return _c } -// ConsensusParams provides a mock function with given fields: ctx, height -func (_m *RemoteClient) ConsensusParams(ctx context.Context, height *int64) (*coretypes.ResultConsensusParams, error) { - ret := _m.Called(ctx, height) +// ConsensusParams provides a mock function for the type RemoteClient +func (_mock *RemoteClient) ConsensusParams(ctx context.Context, height *int64) (*coretypes.ResultConsensusParams, error) { + ret := _mock.Called(ctx, height) if len(ret) == 0 { panic("no return value specified for ConsensusParams") @@ -929,23 +912,21 @@ func (_m *RemoteClient) ConsensusParams(ctx context.Context, height *int64) (*co var r0 *coretypes.ResultConsensusParams var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultConsensusParams, error)); ok { - return rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultConsensusParams, error)); ok { + return returnFunc(ctx, height) } - if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultConsensusParams); ok { - r0 = rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultConsensusParams); ok { + r0 = returnFunc(ctx, height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultConsensusParams) } } - - if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { - r1 = rf(ctx, height) + if returnFunc, ok := ret.Get(1).(func(context.Context, *int64) error); ok { + r1 = returnFunc(ctx, height) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -955,8 +936,8 @@ type RemoteClient_ConsensusParams_Call struct { } // ConsensusParams is a helper method to define mock.On call -// - ctx context.Context -// - height *int64 +// - ctx +// - height func (_e *RemoteClient_Expecter) ConsensusParams(ctx interface{}, height interface{}) *RemoteClient_ConsensusParams_Call { return &RemoteClient_ConsensusParams_Call{Call: _e.mock.On("ConsensusParams", ctx, height)} } @@ -968,19 +949,19 @@ func (_c *RemoteClient_ConsensusParams_Call) Run(run func(ctx context.Context, h return _c } -func (_c *RemoteClient_ConsensusParams_Call) Return(_a0 *coretypes.ResultConsensusParams, _a1 error) *RemoteClient_ConsensusParams_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_ConsensusParams_Call) Return(resultConsensusParams *coretypes.ResultConsensusParams, err error) *RemoteClient_ConsensusParams_Call { + _c.Call.Return(resultConsensusParams, err) return _c } -func (_c *RemoteClient_ConsensusParams_Call) RunAndReturn(run func(context.Context, *int64) (*coretypes.ResultConsensusParams, error)) *RemoteClient_ConsensusParams_Call { +func (_c *RemoteClient_ConsensusParams_Call) RunAndReturn(run func(ctx context.Context, height *int64) (*coretypes.ResultConsensusParams, error)) *RemoteClient_ConsensusParams_Call { _c.Call.Return(run) return _c } -// ConsensusState provides a mock function with given fields: _a0 -func (_m *RemoteClient) ConsensusState(_a0 context.Context) (*coretypes.ResultConsensusState, error) { - ret := _m.Called(_a0) +// ConsensusState provides a mock function for the type RemoteClient +func (_mock *RemoteClient) ConsensusState(context1 context.Context) (*coretypes.ResultConsensusState, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for ConsensusState") @@ -988,23 +969,21 @@ func (_m *RemoteClient) ConsensusState(_a0 context.Context) (*coretypes.ResultCo var r0 *coretypes.ResultConsensusState var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultConsensusState, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultConsensusState, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultConsensusState); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) *coretypes.ResultConsensusState); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultConsensusState) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1014,31 +993,31 @@ type RemoteClient_ConsensusState_Call struct { } // ConsensusState is a helper method to define mock.On call -// - _a0 context.Context -func (_e *RemoteClient_Expecter) ConsensusState(_a0 interface{}) *RemoteClient_ConsensusState_Call { - return &RemoteClient_ConsensusState_Call{Call: _e.mock.On("ConsensusState", _a0)} +// - context1 +func (_e *RemoteClient_Expecter) ConsensusState(context1 interface{}) *RemoteClient_ConsensusState_Call { + return &RemoteClient_ConsensusState_Call{Call: _e.mock.On("ConsensusState", context1)} } -func (_c *RemoteClient_ConsensusState_Call) Run(run func(_a0 context.Context)) *RemoteClient_ConsensusState_Call { +func (_c *RemoteClient_ConsensusState_Call) Run(run func(context1 context.Context)) *RemoteClient_ConsensusState_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *RemoteClient_ConsensusState_Call) Return(_a0 *coretypes.ResultConsensusState, _a1 error) *RemoteClient_ConsensusState_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_ConsensusState_Call) Return(resultConsensusState *coretypes.ResultConsensusState, err error) *RemoteClient_ConsensusState_Call { + _c.Call.Return(resultConsensusState, err) return _c } -func (_c *RemoteClient_ConsensusState_Call) RunAndReturn(run func(context.Context) (*coretypes.ResultConsensusState, error)) *RemoteClient_ConsensusState_Call { +func (_c *RemoteClient_ConsensusState_Call) RunAndReturn(run func(context1 context.Context) (*coretypes.ResultConsensusState, error)) *RemoteClient_ConsensusState_Call { _c.Call.Return(run) return _c } -// DumpConsensusState provides a mock function with given fields: _a0 -func (_m *RemoteClient) DumpConsensusState(_a0 context.Context) (*coretypes.ResultDumpConsensusState, error) { - ret := _m.Called(_a0) +// DumpConsensusState provides a mock function for the type RemoteClient +func (_mock *RemoteClient) DumpConsensusState(context1 context.Context) (*coretypes.ResultDumpConsensusState, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for DumpConsensusState") @@ -1046,23 +1025,21 @@ func (_m *RemoteClient) DumpConsensusState(_a0 context.Context) (*coretypes.Resu var r0 *coretypes.ResultDumpConsensusState var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultDumpConsensusState, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultDumpConsensusState, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultDumpConsensusState); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) *coretypes.ResultDumpConsensusState); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultDumpConsensusState) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1072,31 +1049,31 @@ type RemoteClient_DumpConsensusState_Call struct { } // DumpConsensusState is a helper method to define mock.On call -// - _a0 context.Context -func (_e *RemoteClient_Expecter) DumpConsensusState(_a0 interface{}) *RemoteClient_DumpConsensusState_Call { - return &RemoteClient_DumpConsensusState_Call{Call: _e.mock.On("DumpConsensusState", _a0)} +// - context1 +func (_e *RemoteClient_Expecter) DumpConsensusState(context1 interface{}) *RemoteClient_DumpConsensusState_Call { + return &RemoteClient_DumpConsensusState_Call{Call: _e.mock.On("DumpConsensusState", context1)} } -func (_c *RemoteClient_DumpConsensusState_Call) Run(run func(_a0 context.Context)) *RemoteClient_DumpConsensusState_Call { +func (_c *RemoteClient_DumpConsensusState_Call) Run(run func(context1 context.Context)) *RemoteClient_DumpConsensusState_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *RemoteClient_DumpConsensusState_Call) Return(_a0 *coretypes.ResultDumpConsensusState, _a1 error) *RemoteClient_DumpConsensusState_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_DumpConsensusState_Call) Return(resultDumpConsensusState *coretypes.ResultDumpConsensusState, err error) *RemoteClient_DumpConsensusState_Call { + _c.Call.Return(resultDumpConsensusState, err) return _c } -func (_c *RemoteClient_DumpConsensusState_Call) RunAndReturn(run func(context.Context) (*coretypes.ResultDumpConsensusState, error)) *RemoteClient_DumpConsensusState_Call { +func (_c *RemoteClient_DumpConsensusState_Call) RunAndReturn(run func(context1 context.Context) (*coretypes.ResultDumpConsensusState, error)) *RemoteClient_DumpConsensusState_Call { _c.Call.Return(run) return _c } -// Events provides a mock function with given fields: ctx, req -func (_m *RemoteClient) Events(ctx context.Context, req *coretypes.RequestEvents) (*coretypes.ResultEvents, error) { - ret := _m.Called(ctx, req) +// Events provides a mock function for the type RemoteClient +func (_mock *RemoteClient) Events(ctx context.Context, req *coretypes.RequestEvents) (*coretypes.ResultEvents, error) { + ret := _mock.Called(ctx, req) if len(ret) == 0 { panic("no return value specified for Events") @@ -1104,23 +1081,21 @@ func (_m *RemoteClient) Events(ctx context.Context, req *coretypes.RequestEvents var r0 *coretypes.ResultEvents var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) (*coretypes.ResultEvents, error)); ok { - return rf(ctx, req) + if returnFunc, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) (*coretypes.ResultEvents, error)); ok { + return returnFunc(ctx, req) } - if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) *coretypes.ResultEvents); ok { - r0 = rf(ctx, req) + if returnFunc, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) *coretypes.ResultEvents); ok { + r0 = returnFunc(ctx, req) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultEvents) } } - - if rf, ok := ret.Get(1).(func(context.Context, *coretypes.RequestEvents) error); ok { - r1 = rf(ctx, req) + if returnFunc, ok := ret.Get(1).(func(context.Context, *coretypes.RequestEvents) error); ok { + r1 = returnFunc(ctx, req) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1130,8 +1105,8 @@ type RemoteClient_Events_Call struct { } // Events is a helper method to define mock.On call -// - ctx context.Context -// - req *coretypes.RequestEvents +// - ctx +// - req func (_e *RemoteClient_Expecter) Events(ctx interface{}, req interface{}) *RemoteClient_Events_Call { return &RemoteClient_Events_Call{Call: _e.mock.On("Events", ctx, req)} } @@ -1143,19 +1118,19 @@ func (_c *RemoteClient_Events_Call) Run(run func(ctx context.Context, req *coret return _c } -func (_c *RemoteClient_Events_Call) Return(_a0 *coretypes.ResultEvents, _a1 error) *RemoteClient_Events_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_Events_Call) Return(resultEvents *coretypes.ResultEvents, err error) *RemoteClient_Events_Call { + _c.Call.Return(resultEvents, err) return _c } -func (_c *RemoteClient_Events_Call) RunAndReturn(run func(context.Context, *coretypes.RequestEvents) (*coretypes.ResultEvents, error)) *RemoteClient_Events_Call { +func (_c *RemoteClient_Events_Call) RunAndReturn(run func(ctx context.Context, req *coretypes.RequestEvents) (*coretypes.ResultEvents, error)) *RemoteClient_Events_Call { _c.Call.Return(run) return _c } -// Genesis provides a mock function with given fields: _a0 -func (_m *RemoteClient) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, error) { - ret := _m.Called(_a0) +// Genesis provides a mock function for the type RemoteClient +func (_mock *RemoteClient) Genesis(context1 context.Context) (*coretypes.ResultGenesis, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for Genesis") @@ -1163,23 +1138,21 @@ func (_m *RemoteClient) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, var r0 *coretypes.ResultGenesis var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultGenesis, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultGenesis, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultGenesis); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) *coretypes.ResultGenesis); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultGenesis) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1189,31 +1162,31 @@ type RemoteClient_Genesis_Call struct { } // Genesis is a helper method to define mock.On call -// - _a0 context.Context -func (_e *RemoteClient_Expecter) Genesis(_a0 interface{}) *RemoteClient_Genesis_Call { - return &RemoteClient_Genesis_Call{Call: _e.mock.On("Genesis", _a0)} +// - context1 +func (_e *RemoteClient_Expecter) Genesis(context1 interface{}) *RemoteClient_Genesis_Call { + return &RemoteClient_Genesis_Call{Call: _e.mock.On("Genesis", context1)} } -func (_c *RemoteClient_Genesis_Call) Run(run func(_a0 context.Context)) *RemoteClient_Genesis_Call { +func (_c *RemoteClient_Genesis_Call) Run(run func(context1 context.Context)) *RemoteClient_Genesis_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *RemoteClient_Genesis_Call) Return(_a0 *coretypes.ResultGenesis, _a1 error) *RemoteClient_Genesis_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_Genesis_Call) Return(resultGenesis *coretypes.ResultGenesis, err error) *RemoteClient_Genesis_Call { + _c.Call.Return(resultGenesis, err) return _c } -func (_c *RemoteClient_Genesis_Call) RunAndReturn(run func(context.Context) (*coretypes.ResultGenesis, error)) *RemoteClient_Genesis_Call { +func (_c *RemoteClient_Genesis_Call) RunAndReturn(run func(context1 context.Context) (*coretypes.ResultGenesis, error)) *RemoteClient_Genesis_Call { _c.Call.Return(run) return _c } -// GenesisChunked provides a mock function with given fields: _a0, _a1 -func (_m *RemoteClient) GenesisChunked(_a0 context.Context, _a1 uint) (*coretypes.ResultGenesisChunk, error) { - ret := _m.Called(_a0, _a1) +// GenesisChunked provides a mock function for the type RemoteClient +func (_mock *RemoteClient) GenesisChunked(context1 context.Context, v uint) (*coretypes.ResultGenesisChunk, error) { + ret := _mock.Called(context1, v) if len(ret) == 0 { panic("no return value specified for GenesisChunked") @@ -1221,23 +1194,21 @@ func (_m *RemoteClient) GenesisChunked(_a0 context.Context, _a1 uint) (*coretype var r0 *coretypes.ResultGenesisChunk var r1 error - if rf, ok := ret.Get(0).(func(context.Context, uint) (*coretypes.ResultGenesisChunk, error)); ok { - return rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, uint) (*coretypes.ResultGenesisChunk, error)); ok { + return returnFunc(context1, v) } - if rf, ok := ret.Get(0).(func(context.Context, uint) *coretypes.ResultGenesisChunk); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, uint) *coretypes.ResultGenesisChunk); ok { + r0 = returnFunc(context1, v) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultGenesisChunk) } } - - if rf, ok := ret.Get(1).(func(context.Context, uint) error); ok { - r1 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(1).(func(context.Context, uint) error); ok { + r1 = returnFunc(context1, v) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1247,32 +1218,32 @@ type RemoteClient_GenesisChunked_Call struct { } // GenesisChunked is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 uint -func (_e *RemoteClient_Expecter) GenesisChunked(_a0 interface{}, _a1 interface{}) *RemoteClient_GenesisChunked_Call { - return &RemoteClient_GenesisChunked_Call{Call: _e.mock.On("GenesisChunked", _a0, _a1)} +// - context1 +// - v +func (_e *RemoteClient_Expecter) GenesisChunked(context1 interface{}, v interface{}) *RemoteClient_GenesisChunked_Call { + return &RemoteClient_GenesisChunked_Call{Call: _e.mock.On("GenesisChunked", context1, v)} } -func (_c *RemoteClient_GenesisChunked_Call) Run(run func(_a0 context.Context, _a1 uint)) *RemoteClient_GenesisChunked_Call { +func (_c *RemoteClient_GenesisChunked_Call) Run(run func(context1 context.Context, v uint)) *RemoteClient_GenesisChunked_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(uint)) }) return _c } -func (_c *RemoteClient_GenesisChunked_Call) Return(_a0 *coretypes.ResultGenesisChunk, _a1 error) *RemoteClient_GenesisChunked_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_GenesisChunked_Call) Return(resultGenesisChunk *coretypes.ResultGenesisChunk, err error) *RemoteClient_GenesisChunked_Call { + _c.Call.Return(resultGenesisChunk, err) return _c } -func (_c *RemoteClient_GenesisChunked_Call) RunAndReturn(run func(context.Context, uint) (*coretypes.ResultGenesisChunk, error)) *RemoteClient_GenesisChunked_Call { +func (_c *RemoteClient_GenesisChunked_Call) RunAndReturn(run func(context1 context.Context, v uint) (*coretypes.ResultGenesisChunk, error)) *RemoteClient_GenesisChunked_Call { _c.Call.Return(run) return _c } -// Header provides a mock function with given fields: ctx, height -func (_m *RemoteClient) Header(ctx context.Context, height *int64) (*coretypes.ResultHeader, error) { - ret := _m.Called(ctx, height) +// Header provides a mock function for the type RemoteClient +func (_mock *RemoteClient) Header(ctx context.Context, height *int64) (*coretypes.ResultHeader, error) { + ret := _mock.Called(ctx, height) if len(ret) == 0 { panic("no return value specified for Header") @@ -1280,23 +1251,21 @@ func (_m *RemoteClient) Header(ctx context.Context, height *int64) (*coretypes.R var r0 *coretypes.ResultHeader var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultHeader, error)); ok { - return rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultHeader, error)); ok { + return returnFunc(ctx, height) } - if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultHeader); ok { - r0 = rf(ctx, height) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultHeader); ok { + r0 = returnFunc(ctx, height) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultHeader) } } - - if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { - r1 = rf(ctx, height) + if returnFunc, ok := ret.Get(1).(func(context.Context, *int64) error); ok { + r1 = returnFunc(ctx, height) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1306,8 +1275,8 @@ type RemoteClient_Header_Call struct { } // Header is a helper method to define mock.On call -// - ctx context.Context -// - height *int64 +// - ctx +// - height func (_e *RemoteClient_Expecter) Header(ctx interface{}, height interface{}) *RemoteClient_Header_Call { return &RemoteClient_Header_Call{Call: _e.mock.On("Header", ctx, height)} } @@ -1319,19 +1288,19 @@ func (_c *RemoteClient_Header_Call) Run(run func(ctx context.Context, height *in return _c } -func (_c *RemoteClient_Header_Call) Return(_a0 *coretypes.ResultHeader, _a1 error) *RemoteClient_Header_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_Header_Call) Return(resultHeader *coretypes.ResultHeader, err error) *RemoteClient_Header_Call { + _c.Call.Return(resultHeader, err) return _c } -func (_c *RemoteClient_Header_Call) RunAndReturn(run func(context.Context, *int64) (*coretypes.ResultHeader, error)) *RemoteClient_Header_Call { +func (_c *RemoteClient_Header_Call) RunAndReturn(run func(ctx context.Context, height *int64) (*coretypes.ResultHeader, error)) *RemoteClient_Header_Call { _c.Call.Return(run) return _c } -// HeaderByHash provides a mock function with given fields: ctx, hash -func (_m *RemoteClient) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*coretypes.ResultHeader, error) { - ret := _m.Called(ctx, hash) +// HeaderByHash provides a mock function for the type RemoteClient +func (_mock *RemoteClient) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*coretypes.ResultHeader, error) { + ret := _mock.Called(ctx, hash) if len(ret) == 0 { panic("no return value specified for HeaderByHash") @@ -1339,23 +1308,21 @@ func (_m *RemoteClient) HeaderByHash(ctx context.Context, hash bytes.HexBytes) ( var r0 *coretypes.ResultHeader var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultHeader, error)); ok { - return rf(ctx, hash) + if returnFunc, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultHeader, error)); ok { + return returnFunc(ctx, hash) } - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultHeader); ok { - r0 = rf(ctx, hash) + if returnFunc, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultHeader); ok { + r0 = returnFunc(ctx, hash) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultHeader) } } - - if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { - r1 = rf(ctx, hash) + if returnFunc, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { + r1 = returnFunc(ctx, hash) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1365,8 +1332,8 @@ type RemoteClient_HeaderByHash_Call struct { } // HeaderByHash is a helper method to define mock.On call -// - ctx context.Context -// - hash bytes.HexBytes +// - ctx +// - hash func (_e *RemoteClient_Expecter) HeaderByHash(ctx interface{}, hash interface{}) *RemoteClient_HeaderByHash_Call { return &RemoteClient_HeaderByHash_Call{Call: _e.mock.On("HeaderByHash", ctx, hash)} } @@ -1378,19 +1345,19 @@ func (_c *RemoteClient_HeaderByHash_Call) Run(run func(ctx context.Context, hash return _c } -func (_c *RemoteClient_HeaderByHash_Call) Return(_a0 *coretypes.ResultHeader, _a1 error) *RemoteClient_HeaderByHash_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_HeaderByHash_Call) Return(resultHeader *coretypes.ResultHeader, err error) *RemoteClient_HeaderByHash_Call { + _c.Call.Return(resultHeader, err) return _c } -func (_c *RemoteClient_HeaderByHash_Call) RunAndReturn(run func(context.Context, bytes.HexBytes) (*coretypes.ResultHeader, error)) *RemoteClient_HeaderByHash_Call { +func (_c *RemoteClient_HeaderByHash_Call) RunAndReturn(run func(ctx context.Context, hash bytes.HexBytes) (*coretypes.ResultHeader, error)) *RemoteClient_HeaderByHash_Call { _c.Call.Return(run) return _c } -// Health provides a mock function with given fields: _a0 -func (_m *RemoteClient) Health(_a0 context.Context) (*coretypes.ResultHealth, error) { - ret := _m.Called(_a0) +// Health provides a mock function for the type RemoteClient +func (_mock *RemoteClient) Health(context1 context.Context) (*coretypes.ResultHealth, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for Health") @@ -1398,23 +1365,21 @@ func (_m *RemoteClient) Health(_a0 context.Context) (*coretypes.ResultHealth, er var r0 *coretypes.ResultHealth var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultHealth, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultHealth, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultHealth); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) *coretypes.ResultHealth); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultHealth) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1424,31 +1389,31 @@ type RemoteClient_Health_Call struct { } // Health is a helper method to define mock.On call -// - _a0 context.Context -func (_e *RemoteClient_Expecter) Health(_a0 interface{}) *RemoteClient_Health_Call { - return &RemoteClient_Health_Call{Call: _e.mock.On("Health", _a0)} +// - context1 +func (_e *RemoteClient_Expecter) Health(context1 interface{}) *RemoteClient_Health_Call { + return &RemoteClient_Health_Call{Call: _e.mock.On("Health", context1)} } -func (_c *RemoteClient_Health_Call) Run(run func(_a0 context.Context)) *RemoteClient_Health_Call { +func (_c *RemoteClient_Health_Call) Run(run func(context1 context.Context)) *RemoteClient_Health_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *RemoteClient_Health_Call) Return(_a0 *coretypes.ResultHealth, _a1 error) *RemoteClient_Health_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_Health_Call) Return(resultHealth *coretypes.ResultHealth, err error) *RemoteClient_Health_Call { + _c.Call.Return(resultHealth, err) return _c } -func (_c *RemoteClient_Health_Call) RunAndReturn(run func(context.Context) (*coretypes.ResultHealth, error)) *RemoteClient_Health_Call { +func (_c *RemoteClient_Health_Call) RunAndReturn(run func(context1 context.Context) (*coretypes.ResultHealth, error)) *RemoteClient_Health_Call { _c.Call.Return(run) return _c } -// NetInfo provides a mock function with given fields: _a0 -func (_m *RemoteClient) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, error) { - ret := _m.Called(_a0) +// NetInfo provides a mock function for the type RemoteClient +func (_mock *RemoteClient) NetInfo(context1 context.Context) (*coretypes.ResultNetInfo, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for NetInfo") @@ -1456,23 +1421,21 @@ func (_m *RemoteClient) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, var r0 *coretypes.ResultNetInfo var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultNetInfo, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultNetInfo, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultNetInfo); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) *coretypes.ResultNetInfo); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultNetInfo) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1482,31 +1445,31 @@ type RemoteClient_NetInfo_Call struct { } // NetInfo is a helper method to define mock.On call -// - _a0 context.Context -func (_e *RemoteClient_Expecter) NetInfo(_a0 interface{}) *RemoteClient_NetInfo_Call { - return &RemoteClient_NetInfo_Call{Call: _e.mock.On("NetInfo", _a0)} +// - context1 +func (_e *RemoteClient_Expecter) NetInfo(context1 interface{}) *RemoteClient_NetInfo_Call { + return &RemoteClient_NetInfo_Call{Call: _e.mock.On("NetInfo", context1)} } -func (_c *RemoteClient_NetInfo_Call) Run(run func(_a0 context.Context)) *RemoteClient_NetInfo_Call { +func (_c *RemoteClient_NetInfo_Call) Run(run func(context1 context.Context)) *RemoteClient_NetInfo_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *RemoteClient_NetInfo_Call) Return(_a0 *coretypes.ResultNetInfo, _a1 error) *RemoteClient_NetInfo_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_NetInfo_Call) Return(resultNetInfo *coretypes.ResultNetInfo, err error) *RemoteClient_NetInfo_Call { + _c.Call.Return(resultNetInfo, err) return _c } -func (_c *RemoteClient_NetInfo_Call) RunAndReturn(run func(context.Context) (*coretypes.ResultNetInfo, error)) *RemoteClient_NetInfo_Call { +func (_c *RemoteClient_NetInfo_Call) RunAndReturn(run func(context1 context.Context) (*coretypes.ResultNetInfo, error)) *RemoteClient_NetInfo_Call { _c.Call.Return(run) return _c } -// NumUnconfirmedTxs provides a mock function with given fields: _a0 -func (_m *RemoteClient) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.ResultUnconfirmedTxs, error) { - ret := _m.Called(_a0) +// NumUnconfirmedTxs provides a mock function for the type RemoteClient +func (_mock *RemoteClient) NumUnconfirmedTxs(context1 context.Context) (*coretypes.ResultUnconfirmedTxs, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for NumUnconfirmedTxs") @@ -1514,23 +1477,21 @@ func (_m *RemoteClient) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.Resul var r0 *coretypes.ResultUnconfirmedTxs var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultUnconfirmedTxs, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultUnconfirmedTxs, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultUnconfirmedTxs); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) *coretypes.ResultUnconfirmedTxs); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultUnconfirmedTxs) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1540,43 +1501,42 @@ type RemoteClient_NumUnconfirmedTxs_Call struct { } // NumUnconfirmedTxs is a helper method to define mock.On call -// - _a0 context.Context -func (_e *RemoteClient_Expecter) NumUnconfirmedTxs(_a0 interface{}) *RemoteClient_NumUnconfirmedTxs_Call { - return &RemoteClient_NumUnconfirmedTxs_Call{Call: _e.mock.On("NumUnconfirmedTxs", _a0)} +// - context1 +func (_e *RemoteClient_Expecter) NumUnconfirmedTxs(context1 interface{}) *RemoteClient_NumUnconfirmedTxs_Call { + return &RemoteClient_NumUnconfirmedTxs_Call{Call: _e.mock.On("NumUnconfirmedTxs", context1)} } -func (_c *RemoteClient_NumUnconfirmedTxs_Call) Run(run func(_a0 context.Context)) *RemoteClient_NumUnconfirmedTxs_Call { +func (_c *RemoteClient_NumUnconfirmedTxs_Call) Run(run func(context1 context.Context)) *RemoteClient_NumUnconfirmedTxs_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *RemoteClient_NumUnconfirmedTxs_Call) Return(_a0 *coretypes.ResultUnconfirmedTxs, _a1 error) *RemoteClient_NumUnconfirmedTxs_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_NumUnconfirmedTxs_Call) Return(resultUnconfirmedTxs *coretypes.ResultUnconfirmedTxs, err error) *RemoteClient_NumUnconfirmedTxs_Call { + _c.Call.Return(resultUnconfirmedTxs, err) return _c } -func (_c *RemoteClient_NumUnconfirmedTxs_Call) RunAndReturn(run func(context.Context) (*coretypes.ResultUnconfirmedTxs, error)) *RemoteClient_NumUnconfirmedTxs_Call { +func (_c *RemoteClient_NumUnconfirmedTxs_Call) RunAndReturn(run func(context1 context.Context) (*coretypes.ResultUnconfirmedTxs, error)) *RemoteClient_NumUnconfirmedTxs_Call { _c.Call.Return(run) return _c } -// Remote provides a mock function with no fields -func (_m *RemoteClient) Remote() string { - ret := _m.Called() +// Remote provides a mock function for the type RemoteClient +func (_mock *RemoteClient) Remote() string { + ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for Remote") } var r0 string - if rf, ok := ret.Get(0).(func() string); ok { - r0 = rf() + if returnFunc, ok := ret.Get(0).(func() string); ok { + r0 = returnFunc() } else { r0 = ret.Get(0).(string) } - return r0 } @@ -1597,8 +1557,8 @@ func (_c *RemoteClient_Remote_Call) Run(run func()) *RemoteClient_Remote_Call { return _c } -func (_c *RemoteClient_Remote_Call) Return(_a0 string) *RemoteClient_Remote_Call { - _c.Call.Return(_a0) +func (_c *RemoteClient_Remote_Call) Return(s string) *RemoteClient_Remote_Call { + _c.Call.Return(s) return _c } @@ -1607,21 +1567,20 @@ func (_c *RemoteClient_Remote_Call) RunAndReturn(run func() string) *RemoteClien return _c } -// RemoveTx provides a mock function with given fields: _a0, _a1 -func (_m *RemoteClient) RemoveTx(_a0 context.Context, _a1 types.TxKey) error { - ret := _m.Called(_a0, _a1) +// RemoveTx provides a mock function for the type RemoteClient +func (_mock *RemoteClient) RemoveTx(context1 context.Context, txKey types.TxKey) error { + ret := _mock.Called(context1, txKey) if len(ret) == 0 { panic("no return value specified for RemoveTx") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, types.TxKey) error); ok { - r0 = rf(_a0, _a1) + if returnFunc, ok := ret.Get(0).(func(context.Context, types.TxKey) error); ok { + r0 = returnFunc(context1, txKey) } else { r0 = ret.Error(0) } - return r0 } @@ -1631,44 +1590,43 @@ type RemoteClient_RemoveTx_Call struct { } // RemoveTx is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 types.TxKey -func (_e *RemoteClient_Expecter) RemoveTx(_a0 interface{}, _a1 interface{}) *RemoteClient_RemoveTx_Call { - return &RemoteClient_RemoveTx_Call{Call: _e.mock.On("RemoveTx", _a0, _a1)} +// - context1 +// - txKey +func (_e *RemoteClient_Expecter) RemoveTx(context1 interface{}, txKey interface{}) *RemoteClient_RemoveTx_Call { + return &RemoteClient_RemoveTx_Call{Call: _e.mock.On("RemoveTx", context1, txKey)} } -func (_c *RemoteClient_RemoveTx_Call) Run(run func(_a0 context.Context, _a1 types.TxKey)) *RemoteClient_RemoveTx_Call { +func (_c *RemoteClient_RemoveTx_Call) Run(run func(context1 context.Context, txKey types.TxKey)) *RemoteClient_RemoveTx_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(types.TxKey)) }) return _c } -func (_c *RemoteClient_RemoveTx_Call) Return(_a0 error) *RemoteClient_RemoveTx_Call { - _c.Call.Return(_a0) +func (_c *RemoteClient_RemoveTx_Call) Return(err error) *RemoteClient_RemoveTx_Call { + _c.Call.Return(err) return _c } -func (_c *RemoteClient_RemoveTx_Call) RunAndReturn(run func(context.Context, types.TxKey) error) *RemoteClient_RemoveTx_Call { +func (_c *RemoteClient_RemoveTx_Call) RunAndReturn(run func(context1 context.Context, txKey types.TxKey) error) *RemoteClient_RemoveTx_Call { _c.Call.Return(run) return _c } -// Start provides a mock function with given fields: _a0 -func (_m *RemoteClient) Start(_a0 context.Context) error { - ret := _m.Called(_a0) +// Start provides a mock function for the type RemoteClient +func (_mock *RemoteClient) Start(context1 context.Context) error { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for Start") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = returnFunc(context1) } else { r0 = ret.Error(0) } - return r0 } @@ -1678,31 +1636,31 @@ type RemoteClient_Start_Call struct { } // Start is a helper method to define mock.On call -// - _a0 context.Context -func (_e *RemoteClient_Expecter) Start(_a0 interface{}) *RemoteClient_Start_Call { - return &RemoteClient_Start_Call{Call: _e.mock.On("Start", _a0)} +// - context1 +func (_e *RemoteClient_Expecter) Start(context1 interface{}) *RemoteClient_Start_Call { + return &RemoteClient_Start_Call{Call: _e.mock.On("Start", context1)} } -func (_c *RemoteClient_Start_Call) Run(run func(_a0 context.Context)) *RemoteClient_Start_Call { +func (_c *RemoteClient_Start_Call) Run(run func(context1 context.Context)) *RemoteClient_Start_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *RemoteClient_Start_Call) Return(_a0 error) *RemoteClient_Start_Call { - _c.Call.Return(_a0) +func (_c *RemoteClient_Start_Call) Return(err error) *RemoteClient_Start_Call { + _c.Call.Return(err) return _c } -func (_c *RemoteClient_Start_Call) RunAndReturn(run func(context.Context) error) *RemoteClient_Start_Call { +func (_c *RemoteClient_Start_Call) RunAndReturn(run func(context1 context.Context) error) *RemoteClient_Start_Call { _c.Call.Return(run) return _c } -// Status provides a mock function with given fields: _a0 -func (_m *RemoteClient) Status(_a0 context.Context) (*coretypes.ResultStatus, error) { - ret := _m.Called(_a0) +// Status provides a mock function for the type RemoteClient +func (_mock *RemoteClient) Status(context1 context.Context) (*coretypes.ResultStatus, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for Status") @@ -1710,23 +1668,21 @@ func (_m *RemoteClient) Status(_a0 context.Context) (*coretypes.ResultStatus, er var r0 *coretypes.ResultStatus var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultStatus, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultStatus, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultStatus); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) *coretypes.ResultStatus); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultStatus) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1736,38 +1692,37 @@ type RemoteClient_Status_Call struct { } // Status is a helper method to define mock.On call -// - _a0 context.Context -func (_e *RemoteClient_Expecter) Status(_a0 interface{}) *RemoteClient_Status_Call { - return &RemoteClient_Status_Call{Call: _e.mock.On("Status", _a0)} +// - context1 +func (_e *RemoteClient_Expecter) Status(context1 interface{}) *RemoteClient_Status_Call { + return &RemoteClient_Status_Call{Call: _e.mock.On("Status", context1)} } -func (_c *RemoteClient_Status_Call) Run(run func(_a0 context.Context)) *RemoteClient_Status_Call { +func (_c *RemoteClient_Status_Call) Run(run func(context1 context.Context)) *RemoteClient_Status_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *RemoteClient_Status_Call) Return(_a0 *coretypes.ResultStatus, _a1 error) *RemoteClient_Status_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_Status_Call) Return(resultStatus *coretypes.ResultStatus, err error) *RemoteClient_Status_Call { + _c.Call.Return(resultStatus, err) return _c } -func (_c *RemoteClient_Status_Call) RunAndReturn(run func(context.Context) (*coretypes.ResultStatus, error)) *RemoteClient_Status_Call { +func (_c *RemoteClient_Status_Call) RunAndReturn(run func(context1 context.Context) (*coretypes.ResultStatus, error)) *RemoteClient_Status_Call { _c.Call.Return(run) return _c } -// Subscribe provides a mock function with given fields: ctx, subscriber, query, outCapacity -func (_m *RemoteClient) Subscribe(ctx context.Context, subscriber string, query string, outCapacity ...int) (<-chan coretypes.ResultEvent, error) { - _va := make([]interface{}, len(outCapacity)) - for _i := range outCapacity { - _va[_i] = outCapacity[_i] +// Subscribe provides a mock function for the type RemoteClient +func (_mock *RemoteClient) Subscribe(ctx context.Context, subscriber string, query string, outCapacity ...int) (<-chan coretypes.ResultEvent, error) { + var tmpRet mock.Arguments + if len(outCapacity) > 0 { + tmpRet = _mock.Called(ctx, subscriber, query, outCapacity) + } else { + tmpRet = _mock.Called(ctx, subscriber, query) } - var _ca []interface{} - _ca = append(_ca, ctx, subscriber, query) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) + ret := tmpRet if len(ret) == 0 { panic("no return value specified for Subscribe") @@ -1775,23 +1730,21 @@ func (_m *RemoteClient) Subscribe(ctx context.Context, subscriber string, query var r0 <-chan coretypes.ResultEvent var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) (<-chan coretypes.ResultEvent, error)); ok { - return rf(ctx, subscriber, query, outCapacity...) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, ...int) (<-chan coretypes.ResultEvent, error)); ok { + return returnFunc(ctx, subscriber, query, outCapacity...) } - if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) <-chan coretypes.ResultEvent); ok { - r0 = rf(ctx, subscriber, query, outCapacity...) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, ...int) <-chan coretypes.ResultEvent); ok { + r0 = returnFunc(ctx, subscriber, query, outCapacity...) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(<-chan coretypes.ResultEvent) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, string, ...int) error); ok { - r1 = rf(ctx, subscriber, query, outCapacity...) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, ...int) error); ok { + r1 = returnFunc(ctx, subscriber, query, outCapacity...) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1801,10 +1754,10 @@ type RemoteClient_Subscribe_Call struct { } // Subscribe is a helper method to define mock.On call -// - ctx context.Context -// - subscriber string -// - query string -// - outCapacity ...int +// - ctx +// - subscriber +// - query +// - outCapacity func (_e *RemoteClient_Expecter) Subscribe(ctx interface{}, subscriber interface{}, query interface{}, outCapacity ...interface{}) *RemoteClient_Subscribe_Call { return &RemoteClient_Subscribe_Call{Call: _e.mock.On("Subscribe", append([]interface{}{ctx, subscriber, query}, outCapacity...)...)} @@ -1812,12 +1765,7 @@ func (_e *RemoteClient_Expecter) Subscribe(ctx interface{}, subscriber interface func (_c *RemoteClient_Subscribe_Call) Run(run func(ctx context.Context, subscriber string, query string, outCapacity ...int)) *RemoteClient_Subscribe_Call { _c.Call.Run(func(args mock.Arguments) { - variadicArgs := make([]int, len(args)-3) - for i, a := range args[3:] { - if a != nil { - variadicArgs[i] = a.(int) - } - } + variadicArgs := args[3].([]int) run(args[0].(context.Context), args[1].(string), args[2].(string), variadicArgs...) }) return _c @@ -1828,14 +1776,14 @@ func (_c *RemoteClient_Subscribe_Call) Return(out <-chan coretypes.ResultEvent, return _c } -func (_c *RemoteClient_Subscribe_Call) RunAndReturn(run func(context.Context, string, string, ...int) (<-chan coretypes.ResultEvent, error)) *RemoteClient_Subscribe_Call { +func (_c *RemoteClient_Subscribe_Call) RunAndReturn(run func(ctx context.Context, subscriber string, query string, outCapacity ...int) (<-chan coretypes.ResultEvent, error)) *RemoteClient_Subscribe_Call { _c.Call.Return(run) return _c } -// Tx provides a mock function with given fields: ctx, hash, prove -func (_m *RemoteClient) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) (*coretypes.ResultTx, error) { - ret := _m.Called(ctx, hash, prove) +// Tx provides a mock function for the type RemoteClient +func (_mock *RemoteClient) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) (*coretypes.ResultTx, error) { + ret := _mock.Called(ctx, hash, prove) if len(ret) == 0 { panic("no return value specified for Tx") @@ -1843,23 +1791,21 @@ func (_m *RemoteClient) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) var r0 *coretypes.ResultTx var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) (*coretypes.ResultTx, error)); ok { - return rf(ctx, hash, prove) + if returnFunc, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) (*coretypes.ResultTx, error)); ok { + return returnFunc(ctx, hash, prove) } - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) *coretypes.ResultTx); ok { - r0 = rf(ctx, hash, prove) + if returnFunc, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) *coretypes.ResultTx); ok { + r0 = returnFunc(ctx, hash, prove) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultTx) } } - - if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes, bool) error); ok { - r1 = rf(ctx, hash, prove) + if returnFunc, ok := ret.Get(1).(func(context.Context, bytes.HexBytes, bool) error); ok { + r1 = returnFunc(ctx, hash, prove) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1869,9 +1815,9 @@ type RemoteClient_Tx_Call struct { } // Tx is a helper method to define mock.On call -// - ctx context.Context -// - hash bytes.HexBytes -// - prove bool +// - ctx +// - hash +// - prove func (_e *RemoteClient_Expecter) Tx(ctx interface{}, hash interface{}, prove interface{}) *RemoteClient_Tx_Call { return &RemoteClient_Tx_Call{Call: _e.mock.On("Tx", ctx, hash, prove)} } @@ -1883,19 +1829,19 @@ func (_c *RemoteClient_Tx_Call) Run(run func(ctx context.Context, hash bytes.Hex return _c } -func (_c *RemoteClient_Tx_Call) Return(_a0 *coretypes.ResultTx, _a1 error) *RemoteClient_Tx_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_Tx_Call) Return(resultTx *coretypes.ResultTx, err error) *RemoteClient_Tx_Call { + _c.Call.Return(resultTx, err) return _c } -func (_c *RemoteClient_Tx_Call) RunAndReturn(run func(context.Context, bytes.HexBytes, bool) (*coretypes.ResultTx, error)) *RemoteClient_Tx_Call { +func (_c *RemoteClient_Tx_Call) RunAndReturn(run func(ctx context.Context, hash bytes.HexBytes, prove bool) (*coretypes.ResultTx, error)) *RemoteClient_Tx_Call { _c.Call.Return(run) return _c } -// TxSearch provides a mock function with given fields: ctx, query, prove, page, perPage, orderBy -func (_m *RemoteClient) TxSearch(ctx context.Context, query string, prove bool, page *int, perPage *int, orderBy string) (*coretypes.ResultTxSearch, error) { - ret := _m.Called(ctx, query, prove, page, perPage, orderBy) +// TxSearch provides a mock function for the type RemoteClient +func (_mock *RemoteClient) TxSearch(ctx context.Context, query string, prove bool, page *int, perPage *int, orderBy string) (*coretypes.ResultTxSearch, error) { + ret := _mock.Called(ctx, query, prove, page, perPage, orderBy) if len(ret) == 0 { panic("no return value specified for TxSearch") @@ -1903,23 +1849,21 @@ func (_m *RemoteClient) TxSearch(ctx context.Context, query string, prove bool, var r0 *coretypes.ResultTxSearch var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) (*coretypes.ResultTxSearch, error)); ok { - return rf(ctx, query, prove, page, perPage, orderBy) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) (*coretypes.ResultTxSearch, error)); ok { + return returnFunc(ctx, query, prove, page, perPage, orderBy) } - if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) *coretypes.ResultTxSearch); ok { - r0 = rf(ctx, query, prove, page, perPage, orderBy) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) *coretypes.ResultTxSearch); ok { + r0 = returnFunc(ctx, query, prove, page, perPage, orderBy) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultTxSearch) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, bool, *int, *int, string) error); ok { - r1 = rf(ctx, query, prove, page, perPage, orderBy) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, bool, *int, *int, string) error); ok { + r1 = returnFunc(ctx, query, prove, page, perPage, orderBy) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1929,12 +1873,12 @@ type RemoteClient_TxSearch_Call struct { } // TxSearch is a helper method to define mock.On call -// - ctx context.Context -// - query string -// - prove bool -// - page *int -// - perPage *int -// - orderBy string +// - ctx +// - query +// - prove +// - page +// - perPage +// - orderBy func (_e *RemoteClient_Expecter) TxSearch(ctx interface{}, query interface{}, prove interface{}, page interface{}, perPage interface{}, orderBy interface{}) *RemoteClient_TxSearch_Call { return &RemoteClient_TxSearch_Call{Call: _e.mock.On("TxSearch", ctx, query, prove, page, perPage, orderBy)} } @@ -1946,19 +1890,19 @@ func (_c *RemoteClient_TxSearch_Call) Run(run func(ctx context.Context, query st return _c } -func (_c *RemoteClient_TxSearch_Call) Return(_a0 *coretypes.ResultTxSearch, _a1 error) *RemoteClient_TxSearch_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_TxSearch_Call) Return(resultTxSearch *coretypes.ResultTxSearch, err error) *RemoteClient_TxSearch_Call { + _c.Call.Return(resultTxSearch, err) return _c } -func (_c *RemoteClient_TxSearch_Call) RunAndReturn(run func(context.Context, string, bool, *int, *int, string) (*coretypes.ResultTxSearch, error)) *RemoteClient_TxSearch_Call { +func (_c *RemoteClient_TxSearch_Call) RunAndReturn(run func(ctx context.Context, query string, prove bool, page *int, perPage *int, orderBy string) (*coretypes.ResultTxSearch, error)) *RemoteClient_TxSearch_Call { _c.Call.Return(run) return _c } -// UnconfirmedTx provides a mock function with given fields: ctx, txHash -func (_m *RemoteClient) UnconfirmedTx(ctx context.Context, txHash []byte) (*coretypes.ResultUnconfirmedTx, error) { - ret := _m.Called(ctx, txHash) +// UnconfirmedTx provides a mock function for the type RemoteClient +func (_mock *RemoteClient) UnconfirmedTx(ctx context.Context, txHash []byte) (*coretypes.ResultUnconfirmedTx, error) { + ret := _mock.Called(ctx, txHash) if len(ret) == 0 { panic("no return value specified for UnconfirmedTx") @@ -1966,23 +1910,21 @@ func (_m *RemoteClient) UnconfirmedTx(ctx context.Context, txHash []byte) (*core var r0 *coretypes.ResultUnconfirmedTx var r1 error - if rf, ok := ret.Get(0).(func(context.Context, []byte) (*coretypes.ResultUnconfirmedTx, error)); ok { - return rf(ctx, txHash) + if returnFunc, ok := ret.Get(0).(func(context.Context, []byte) (*coretypes.ResultUnconfirmedTx, error)); ok { + return returnFunc(ctx, txHash) } - if rf, ok := ret.Get(0).(func(context.Context, []byte) *coretypes.ResultUnconfirmedTx); ok { - r0 = rf(ctx, txHash) + if returnFunc, ok := ret.Get(0).(func(context.Context, []byte) *coretypes.ResultUnconfirmedTx); ok { + r0 = returnFunc(ctx, txHash) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultUnconfirmedTx) } } - - if rf, ok := ret.Get(1).(func(context.Context, []byte) error); ok { - r1 = rf(ctx, txHash) + if returnFunc, ok := ret.Get(1).(func(context.Context, []byte) error); ok { + r1 = returnFunc(ctx, txHash) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -1992,8 +1934,8 @@ type RemoteClient_UnconfirmedTx_Call struct { } // UnconfirmedTx is a helper method to define mock.On call -// - ctx context.Context -// - txHash []byte +// - ctx +// - txHash func (_e *RemoteClient_Expecter) UnconfirmedTx(ctx interface{}, txHash interface{}) *RemoteClient_UnconfirmedTx_Call { return &RemoteClient_UnconfirmedTx_Call{Call: _e.mock.On("UnconfirmedTx", ctx, txHash)} } @@ -2005,19 +1947,19 @@ func (_c *RemoteClient_UnconfirmedTx_Call) Run(run func(ctx context.Context, txH return _c } -func (_c *RemoteClient_UnconfirmedTx_Call) Return(_a0 *coretypes.ResultUnconfirmedTx, _a1 error) *RemoteClient_UnconfirmedTx_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_UnconfirmedTx_Call) Return(resultUnconfirmedTx *coretypes.ResultUnconfirmedTx, err error) *RemoteClient_UnconfirmedTx_Call { + _c.Call.Return(resultUnconfirmedTx, err) return _c } -func (_c *RemoteClient_UnconfirmedTx_Call) RunAndReturn(run func(context.Context, []byte) (*coretypes.ResultUnconfirmedTx, error)) *RemoteClient_UnconfirmedTx_Call { +func (_c *RemoteClient_UnconfirmedTx_Call) RunAndReturn(run func(ctx context.Context, txHash []byte) (*coretypes.ResultUnconfirmedTx, error)) *RemoteClient_UnconfirmedTx_Call { _c.Call.Return(run) return _c } -// UnconfirmedTxs provides a mock function with given fields: ctx, page, perPage -func (_m *RemoteClient) UnconfirmedTxs(ctx context.Context, page *int, perPage *int) (*coretypes.ResultUnconfirmedTxs, error) { - ret := _m.Called(ctx, page, perPage) +// UnconfirmedTxs provides a mock function for the type RemoteClient +func (_mock *RemoteClient) UnconfirmedTxs(ctx context.Context, page *int, perPage *int) (*coretypes.ResultUnconfirmedTxs, error) { + ret := _mock.Called(ctx, page, perPage) if len(ret) == 0 { panic("no return value specified for UnconfirmedTxs") @@ -2025,23 +1967,21 @@ func (_m *RemoteClient) UnconfirmedTxs(ctx context.Context, page *int, perPage * var r0 *coretypes.ResultUnconfirmedTxs var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int, *int) (*coretypes.ResultUnconfirmedTxs, error)); ok { - return rf(ctx, page, perPage) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int, *int) (*coretypes.ResultUnconfirmedTxs, error)); ok { + return returnFunc(ctx, page, perPage) } - if rf, ok := ret.Get(0).(func(context.Context, *int, *int) *coretypes.ResultUnconfirmedTxs); ok { - r0 = rf(ctx, page, perPage) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int, *int) *coretypes.ResultUnconfirmedTxs); ok { + r0 = returnFunc(ctx, page, perPage) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultUnconfirmedTxs) } } - - if rf, ok := ret.Get(1).(func(context.Context, *int, *int) error); ok { - r1 = rf(ctx, page, perPage) + if returnFunc, ok := ret.Get(1).(func(context.Context, *int, *int) error); ok { + r1 = returnFunc(ctx, page, perPage) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -2051,9 +1991,9 @@ type RemoteClient_UnconfirmedTxs_Call struct { } // UnconfirmedTxs is a helper method to define mock.On call -// - ctx context.Context -// - page *int -// - perPage *int +// - ctx +// - page +// - perPage func (_e *RemoteClient_Expecter) UnconfirmedTxs(ctx interface{}, page interface{}, perPage interface{}) *RemoteClient_UnconfirmedTxs_Call { return &RemoteClient_UnconfirmedTxs_Call{Call: _e.mock.On("UnconfirmedTxs", ctx, page, perPage)} } @@ -2065,31 +2005,30 @@ func (_c *RemoteClient_UnconfirmedTxs_Call) Run(run func(ctx context.Context, pa return _c } -func (_c *RemoteClient_UnconfirmedTxs_Call) Return(_a0 *coretypes.ResultUnconfirmedTxs, _a1 error) *RemoteClient_UnconfirmedTxs_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_UnconfirmedTxs_Call) Return(resultUnconfirmedTxs *coretypes.ResultUnconfirmedTxs, err error) *RemoteClient_UnconfirmedTxs_Call { + _c.Call.Return(resultUnconfirmedTxs, err) return _c } -func (_c *RemoteClient_UnconfirmedTxs_Call) RunAndReturn(run func(context.Context, *int, *int) (*coretypes.ResultUnconfirmedTxs, error)) *RemoteClient_UnconfirmedTxs_Call { +func (_c *RemoteClient_UnconfirmedTxs_Call) RunAndReturn(run func(ctx context.Context, page *int, perPage *int) (*coretypes.ResultUnconfirmedTxs, error)) *RemoteClient_UnconfirmedTxs_Call { _c.Call.Return(run) return _c } -// Unsubscribe provides a mock function with given fields: ctx, subscriber, query -func (_m *RemoteClient) Unsubscribe(ctx context.Context, subscriber string, query string) error { - ret := _m.Called(ctx, subscriber, query) +// Unsubscribe provides a mock function for the type RemoteClient +func (_mock *RemoteClient) Unsubscribe(ctx context.Context, subscriber string, query string) error { + ret := _mock.Called(ctx, subscriber, query) if len(ret) == 0 { panic("no return value specified for Unsubscribe") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { - r0 = rf(ctx, subscriber, query) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) error); ok { + r0 = returnFunc(ctx, subscriber, query) } else { r0 = ret.Error(0) } - return r0 } @@ -2099,9 +2038,9 @@ type RemoteClient_Unsubscribe_Call struct { } // Unsubscribe is a helper method to define mock.On call -// - ctx context.Context -// - subscriber string -// - query string +// - ctx +// - subscriber +// - query func (_e *RemoteClient_Expecter) Unsubscribe(ctx interface{}, subscriber interface{}, query interface{}) *RemoteClient_Unsubscribe_Call { return &RemoteClient_Unsubscribe_Call{Call: _e.mock.On("Unsubscribe", ctx, subscriber, query)} } @@ -2113,31 +2052,30 @@ func (_c *RemoteClient_Unsubscribe_Call) Run(run func(ctx context.Context, subsc return _c } -func (_c *RemoteClient_Unsubscribe_Call) Return(_a0 error) *RemoteClient_Unsubscribe_Call { - _c.Call.Return(_a0) +func (_c *RemoteClient_Unsubscribe_Call) Return(err error) *RemoteClient_Unsubscribe_Call { + _c.Call.Return(err) return _c } -func (_c *RemoteClient_Unsubscribe_Call) RunAndReturn(run func(context.Context, string, string) error) *RemoteClient_Unsubscribe_Call { +func (_c *RemoteClient_Unsubscribe_Call) RunAndReturn(run func(ctx context.Context, subscriber string, query string) error) *RemoteClient_Unsubscribe_Call { _c.Call.Return(run) return _c } -// UnsubscribeAll provides a mock function with given fields: ctx, subscriber -func (_m *RemoteClient) UnsubscribeAll(ctx context.Context, subscriber string) error { - ret := _m.Called(ctx, subscriber) +// UnsubscribeAll provides a mock function for the type RemoteClient +func (_mock *RemoteClient) UnsubscribeAll(ctx context.Context, subscriber string) error { + ret := _mock.Called(ctx, subscriber) if len(ret) == 0 { panic("no return value specified for UnsubscribeAll") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, subscriber) + if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = returnFunc(ctx, subscriber) } else { r0 = ret.Error(0) } - return r0 } @@ -2147,8 +2085,8 @@ type RemoteClient_UnsubscribeAll_Call struct { } // UnsubscribeAll is a helper method to define mock.On call -// - ctx context.Context -// - subscriber string +// - ctx +// - subscriber func (_e *RemoteClient_Expecter) UnsubscribeAll(ctx interface{}, subscriber interface{}) *RemoteClient_UnsubscribeAll_Call { return &RemoteClient_UnsubscribeAll_Call{Call: _e.mock.On("UnsubscribeAll", ctx, subscriber)} } @@ -2160,19 +2098,19 @@ func (_c *RemoteClient_UnsubscribeAll_Call) Run(run func(ctx context.Context, su return _c } -func (_c *RemoteClient_UnsubscribeAll_Call) Return(_a0 error) *RemoteClient_UnsubscribeAll_Call { - _c.Call.Return(_a0) +func (_c *RemoteClient_UnsubscribeAll_Call) Return(err error) *RemoteClient_UnsubscribeAll_Call { + _c.Call.Return(err) return _c } -func (_c *RemoteClient_UnsubscribeAll_Call) RunAndReturn(run func(context.Context, string) error) *RemoteClient_UnsubscribeAll_Call { +func (_c *RemoteClient_UnsubscribeAll_Call) RunAndReturn(run func(ctx context.Context, subscriber string) error) *RemoteClient_UnsubscribeAll_Call { _c.Call.Return(run) return _c } -// Validators provides a mock function with given fields: ctx, height, page, perPage, requestQuorumInfo -func (_m *RemoteClient) Validators(ctx context.Context, height *int64, page *int, perPage *int, requestQuorumInfo *bool) (*coretypes.ResultValidators, error) { - ret := _m.Called(ctx, height, page, perPage, requestQuorumInfo) +// Validators provides a mock function for the type RemoteClient +func (_mock *RemoteClient) Validators(ctx context.Context, height *int64, page *int, perPage *int, requestQuorumInfo *bool) (*coretypes.ResultValidators, error) { + ret := _mock.Called(ctx, height, page, perPage, requestQuorumInfo) if len(ret) == 0 { panic("no return value specified for Validators") @@ -2180,23 +2118,21 @@ func (_m *RemoteClient) Validators(ctx context.Context, height *int64, page *int var r0 *coretypes.ResultValidators var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) (*coretypes.ResultValidators, error)); ok { - return rf(ctx, height, page, perPage, requestQuorumInfo) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) (*coretypes.ResultValidators, error)); ok { + return returnFunc(ctx, height, page, perPage, requestQuorumInfo) } - if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) *coretypes.ResultValidators); ok { - r0 = rf(ctx, height, page, perPage, requestQuorumInfo) + if returnFunc, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) *coretypes.ResultValidators); ok { + r0 = returnFunc(ctx, height, page, perPage, requestQuorumInfo) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*coretypes.ResultValidators) } } - - if rf, ok := ret.Get(1).(func(context.Context, *int64, *int, *int, *bool) error); ok { - r1 = rf(ctx, height, page, perPage, requestQuorumInfo) + if returnFunc, ok := ret.Get(1).(func(context.Context, *int64, *int, *int, *bool) error); ok { + r1 = returnFunc(ctx, height, page, perPage, requestQuorumInfo) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -2206,11 +2142,11 @@ type RemoteClient_Validators_Call struct { } // Validators is a helper method to define mock.On call -// - ctx context.Context -// - height *int64 -// - page *int -// - perPage *int -// - requestQuorumInfo *bool +// - ctx +// - height +// - page +// - perPage +// - requestQuorumInfo func (_e *RemoteClient_Expecter) Validators(ctx interface{}, height interface{}, page interface{}, perPage interface{}, requestQuorumInfo interface{}) *RemoteClient_Validators_Call { return &RemoteClient_Validators_Call{Call: _e.mock.On("Validators", ctx, height, page, perPage, requestQuorumInfo)} } @@ -2222,26 +2158,12 @@ func (_c *RemoteClient_Validators_Call) Run(run func(ctx context.Context, height return _c } -func (_c *RemoteClient_Validators_Call) Return(_a0 *coretypes.ResultValidators, _a1 error) *RemoteClient_Validators_Call { - _c.Call.Return(_a0, _a1) +func (_c *RemoteClient_Validators_Call) Return(resultValidators *coretypes.ResultValidators, err error) *RemoteClient_Validators_Call { + _c.Call.Return(resultValidators, err) return _c } -func (_c *RemoteClient_Validators_Call) RunAndReturn(run func(context.Context, *int64, *int, *int, *bool) (*coretypes.ResultValidators, error)) *RemoteClient_Validators_Call { +func (_c *RemoteClient_Validators_Call) RunAndReturn(run func(ctx context.Context, height *int64, page *int, perPage *int, requestQuorumInfo *bool) (*coretypes.ResultValidators, error)) *RemoteClient_Validators_Call { _c.Call.Return(run) return _c } - -// NewRemoteClient creates a new instance of RemoteClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewRemoteClient(t interface { - mock.TestingT - Cleanup(func()) -}) *RemoteClient { - mock := &RemoteClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/scripts/mockery_generate.sh b/scripts/mockery_generate.sh index aee2b1c74b..298d67a8dd 100755 --- a/scripts/mockery_generate.sh +++ b/scripts/mockery_generate.sh @@ -6,9 +6,9 @@ # runs the published Docker container. This legerdemain is so that the CI build # and a local build can work off the same script. # -VERSION=v2.53.3 +VERSION=v3.2.4 -if ! mockery --version 2>/dev/null | grep $VERSION; then +if [ "$(mockery version)" != "$VERSION" ]; then echo "Please install mockery $VERSION, example for Linux x86_64:" echo "wget https://github.com/vektra/mockery/releases/download/${VERSION}/mockery_${VERSION#v}_Linux_x86_64.tar.gz" exit 1 diff --git a/types/mocks/blockeventpublisher.go b/types/mocks/blockeventpublisher.go index c94dac30fa..4a0273241f 100644 --- a/types/mocks/blockeventpublisher.go +++ b/types/mocks/blockeventpublisher.go @@ -1,12 +1,28 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - types "github.com/dashpay/tenderdash/types" + "github.com/dashpay/tenderdash/types" mock "github.com/stretchr/testify/mock" ) +// NewBlockEventPublisher creates a new instance of BlockEventPublisher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewBlockEventPublisher(t interface { + mock.TestingT + Cleanup(func()) +}) *BlockEventPublisher { + mock := &BlockEventPublisher{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} + // BlockEventPublisher is an autogenerated mock type for the BlockEventPublisher type type BlockEventPublisher struct { mock.Mock @@ -20,21 +36,20 @@ func (_m *BlockEventPublisher) EXPECT() *BlockEventPublisher_Expecter { return &BlockEventPublisher_Expecter{mock: &_m.Mock} } -// PublishEventNewBlock provides a mock function with given fields: _a0 -func (_m *BlockEventPublisher) PublishEventNewBlock(_a0 types.EventDataNewBlock) error { - ret := _m.Called(_a0) +// PublishEventNewBlock provides a mock function for the type BlockEventPublisher +func (_mock *BlockEventPublisher) PublishEventNewBlock(eventDataNewBlock types.EventDataNewBlock) error { + ret := _mock.Called(eventDataNewBlock) if len(ret) == 0 { panic("no return value specified for PublishEventNewBlock") } var r0 error - if rf, ok := ret.Get(0).(func(types.EventDataNewBlock) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(types.EventDataNewBlock) error); ok { + r0 = returnFunc(eventDataNewBlock) } else { r0 = ret.Error(0) } - return r0 } @@ -44,43 +59,42 @@ type BlockEventPublisher_PublishEventNewBlock_Call struct { } // PublishEventNewBlock is a helper method to define mock.On call -// - _a0 types.EventDataNewBlock -func (_e *BlockEventPublisher_Expecter) PublishEventNewBlock(_a0 interface{}) *BlockEventPublisher_PublishEventNewBlock_Call { - return &BlockEventPublisher_PublishEventNewBlock_Call{Call: _e.mock.On("PublishEventNewBlock", _a0)} +// - eventDataNewBlock +func (_e *BlockEventPublisher_Expecter) PublishEventNewBlock(eventDataNewBlock interface{}) *BlockEventPublisher_PublishEventNewBlock_Call { + return &BlockEventPublisher_PublishEventNewBlock_Call{Call: _e.mock.On("PublishEventNewBlock", eventDataNewBlock)} } -func (_c *BlockEventPublisher_PublishEventNewBlock_Call) Run(run func(_a0 types.EventDataNewBlock)) *BlockEventPublisher_PublishEventNewBlock_Call { +func (_c *BlockEventPublisher_PublishEventNewBlock_Call) Run(run func(eventDataNewBlock types.EventDataNewBlock)) *BlockEventPublisher_PublishEventNewBlock_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(types.EventDataNewBlock)) }) return _c } -func (_c *BlockEventPublisher_PublishEventNewBlock_Call) Return(_a0 error) *BlockEventPublisher_PublishEventNewBlock_Call { - _c.Call.Return(_a0) +func (_c *BlockEventPublisher_PublishEventNewBlock_Call) Return(err error) *BlockEventPublisher_PublishEventNewBlock_Call { + _c.Call.Return(err) return _c } -func (_c *BlockEventPublisher_PublishEventNewBlock_Call) RunAndReturn(run func(types.EventDataNewBlock) error) *BlockEventPublisher_PublishEventNewBlock_Call { +func (_c *BlockEventPublisher_PublishEventNewBlock_Call) RunAndReturn(run func(eventDataNewBlock types.EventDataNewBlock) error) *BlockEventPublisher_PublishEventNewBlock_Call { _c.Call.Return(run) return _c } -// PublishEventNewBlockHeader provides a mock function with given fields: _a0 -func (_m *BlockEventPublisher) PublishEventNewBlockHeader(_a0 types.EventDataNewBlockHeader) error { - ret := _m.Called(_a0) +// PublishEventNewBlockHeader provides a mock function for the type BlockEventPublisher +func (_mock *BlockEventPublisher) PublishEventNewBlockHeader(eventDataNewBlockHeader types.EventDataNewBlockHeader) error { + ret := _mock.Called(eventDataNewBlockHeader) if len(ret) == 0 { panic("no return value specified for PublishEventNewBlockHeader") } var r0 error - if rf, ok := ret.Get(0).(func(types.EventDataNewBlockHeader) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(types.EventDataNewBlockHeader) error); ok { + r0 = returnFunc(eventDataNewBlockHeader) } else { r0 = ret.Error(0) } - return r0 } @@ -90,43 +104,42 @@ type BlockEventPublisher_PublishEventNewBlockHeader_Call struct { } // PublishEventNewBlockHeader is a helper method to define mock.On call -// - _a0 types.EventDataNewBlockHeader -func (_e *BlockEventPublisher_Expecter) PublishEventNewBlockHeader(_a0 interface{}) *BlockEventPublisher_PublishEventNewBlockHeader_Call { - return &BlockEventPublisher_PublishEventNewBlockHeader_Call{Call: _e.mock.On("PublishEventNewBlockHeader", _a0)} +// - eventDataNewBlockHeader +func (_e *BlockEventPublisher_Expecter) PublishEventNewBlockHeader(eventDataNewBlockHeader interface{}) *BlockEventPublisher_PublishEventNewBlockHeader_Call { + return &BlockEventPublisher_PublishEventNewBlockHeader_Call{Call: _e.mock.On("PublishEventNewBlockHeader", eventDataNewBlockHeader)} } -func (_c *BlockEventPublisher_PublishEventNewBlockHeader_Call) Run(run func(_a0 types.EventDataNewBlockHeader)) *BlockEventPublisher_PublishEventNewBlockHeader_Call { +func (_c *BlockEventPublisher_PublishEventNewBlockHeader_Call) Run(run func(eventDataNewBlockHeader types.EventDataNewBlockHeader)) *BlockEventPublisher_PublishEventNewBlockHeader_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(types.EventDataNewBlockHeader)) }) return _c } -func (_c *BlockEventPublisher_PublishEventNewBlockHeader_Call) Return(_a0 error) *BlockEventPublisher_PublishEventNewBlockHeader_Call { - _c.Call.Return(_a0) +func (_c *BlockEventPublisher_PublishEventNewBlockHeader_Call) Return(err error) *BlockEventPublisher_PublishEventNewBlockHeader_Call { + _c.Call.Return(err) return _c } -func (_c *BlockEventPublisher_PublishEventNewBlockHeader_Call) RunAndReturn(run func(types.EventDataNewBlockHeader) error) *BlockEventPublisher_PublishEventNewBlockHeader_Call { +func (_c *BlockEventPublisher_PublishEventNewBlockHeader_Call) RunAndReturn(run func(eventDataNewBlockHeader types.EventDataNewBlockHeader) error) *BlockEventPublisher_PublishEventNewBlockHeader_Call { _c.Call.Return(run) return _c } -// PublishEventNewEvidence provides a mock function with given fields: _a0 -func (_m *BlockEventPublisher) PublishEventNewEvidence(_a0 types.EventDataNewEvidence) error { - ret := _m.Called(_a0) +// PublishEventNewEvidence provides a mock function for the type BlockEventPublisher +func (_mock *BlockEventPublisher) PublishEventNewEvidence(eventDataNewEvidence types.EventDataNewEvidence) error { + ret := _mock.Called(eventDataNewEvidence) if len(ret) == 0 { panic("no return value specified for PublishEventNewEvidence") } var r0 error - if rf, ok := ret.Get(0).(func(types.EventDataNewEvidence) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(types.EventDataNewEvidence) error); ok { + r0 = returnFunc(eventDataNewEvidence) } else { r0 = ret.Error(0) } - return r0 } @@ -136,43 +149,42 @@ type BlockEventPublisher_PublishEventNewEvidence_Call struct { } // PublishEventNewEvidence is a helper method to define mock.On call -// - _a0 types.EventDataNewEvidence -func (_e *BlockEventPublisher_Expecter) PublishEventNewEvidence(_a0 interface{}) *BlockEventPublisher_PublishEventNewEvidence_Call { - return &BlockEventPublisher_PublishEventNewEvidence_Call{Call: _e.mock.On("PublishEventNewEvidence", _a0)} +// - eventDataNewEvidence +func (_e *BlockEventPublisher_Expecter) PublishEventNewEvidence(eventDataNewEvidence interface{}) *BlockEventPublisher_PublishEventNewEvidence_Call { + return &BlockEventPublisher_PublishEventNewEvidence_Call{Call: _e.mock.On("PublishEventNewEvidence", eventDataNewEvidence)} } -func (_c *BlockEventPublisher_PublishEventNewEvidence_Call) Run(run func(_a0 types.EventDataNewEvidence)) *BlockEventPublisher_PublishEventNewEvidence_Call { +func (_c *BlockEventPublisher_PublishEventNewEvidence_Call) Run(run func(eventDataNewEvidence types.EventDataNewEvidence)) *BlockEventPublisher_PublishEventNewEvidence_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(types.EventDataNewEvidence)) }) return _c } -func (_c *BlockEventPublisher_PublishEventNewEvidence_Call) Return(_a0 error) *BlockEventPublisher_PublishEventNewEvidence_Call { - _c.Call.Return(_a0) +func (_c *BlockEventPublisher_PublishEventNewEvidence_Call) Return(err error) *BlockEventPublisher_PublishEventNewEvidence_Call { + _c.Call.Return(err) return _c } -func (_c *BlockEventPublisher_PublishEventNewEvidence_Call) RunAndReturn(run func(types.EventDataNewEvidence) error) *BlockEventPublisher_PublishEventNewEvidence_Call { +func (_c *BlockEventPublisher_PublishEventNewEvidence_Call) RunAndReturn(run func(eventDataNewEvidence types.EventDataNewEvidence) error) *BlockEventPublisher_PublishEventNewEvidence_Call { _c.Call.Return(run) return _c } -// PublishEventTx provides a mock function with given fields: _a0 -func (_m *BlockEventPublisher) PublishEventTx(_a0 types.EventDataTx) error { - ret := _m.Called(_a0) +// PublishEventTx provides a mock function for the type BlockEventPublisher +func (_mock *BlockEventPublisher) PublishEventTx(eventDataTx types.EventDataTx) error { + ret := _mock.Called(eventDataTx) if len(ret) == 0 { panic("no return value specified for PublishEventTx") } var r0 error - if rf, ok := ret.Get(0).(func(types.EventDataTx) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(types.EventDataTx) error); ok { + r0 = returnFunc(eventDataTx) } else { r0 = ret.Error(0) } - return r0 } @@ -182,43 +194,42 @@ type BlockEventPublisher_PublishEventTx_Call struct { } // PublishEventTx is a helper method to define mock.On call -// - _a0 types.EventDataTx -func (_e *BlockEventPublisher_Expecter) PublishEventTx(_a0 interface{}) *BlockEventPublisher_PublishEventTx_Call { - return &BlockEventPublisher_PublishEventTx_Call{Call: _e.mock.On("PublishEventTx", _a0)} +// - eventDataTx +func (_e *BlockEventPublisher_Expecter) PublishEventTx(eventDataTx interface{}) *BlockEventPublisher_PublishEventTx_Call { + return &BlockEventPublisher_PublishEventTx_Call{Call: _e.mock.On("PublishEventTx", eventDataTx)} } -func (_c *BlockEventPublisher_PublishEventTx_Call) Run(run func(_a0 types.EventDataTx)) *BlockEventPublisher_PublishEventTx_Call { +func (_c *BlockEventPublisher_PublishEventTx_Call) Run(run func(eventDataTx types.EventDataTx)) *BlockEventPublisher_PublishEventTx_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(types.EventDataTx)) }) return _c } -func (_c *BlockEventPublisher_PublishEventTx_Call) Return(_a0 error) *BlockEventPublisher_PublishEventTx_Call { - _c.Call.Return(_a0) +func (_c *BlockEventPublisher_PublishEventTx_Call) Return(err error) *BlockEventPublisher_PublishEventTx_Call { + _c.Call.Return(err) return _c } -func (_c *BlockEventPublisher_PublishEventTx_Call) RunAndReturn(run func(types.EventDataTx) error) *BlockEventPublisher_PublishEventTx_Call { +func (_c *BlockEventPublisher_PublishEventTx_Call) RunAndReturn(run func(eventDataTx types.EventDataTx) error) *BlockEventPublisher_PublishEventTx_Call { _c.Call.Return(run) return _c } -// PublishEventValidatorSetUpdates provides a mock function with given fields: _a0 -func (_m *BlockEventPublisher) PublishEventValidatorSetUpdates(_a0 types.EventDataValidatorSetUpdate) error { - ret := _m.Called(_a0) +// PublishEventValidatorSetUpdates provides a mock function for the type BlockEventPublisher +func (_mock *BlockEventPublisher) PublishEventValidatorSetUpdates(eventDataValidatorSetUpdate types.EventDataValidatorSetUpdate) error { + ret := _mock.Called(eventDataValidatorSetUpdate) if len(ret) == 0 { panic("no return value specified for PublishEventValidatorSetUpdates") } var r0 error - if rf, ok := ret.Get(0).(func(types.EventDataValidatorSetUpdate) error); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(types.EventDataValidatorSetUpdate) error); ok { + r0 = returnFunc(eventDataValidatorSetUpdate) } else { r0 = ret.Error(0) } - return r0 } @@ -228,38 +239,24 @@ type BlockEventPublisher_PublishEventValidatorSetUpdates_Call struct { } // PublishEventValidatorSetUpdates is a helper method to define mock.On call -// - _a0 types.EventDataValidatorSetUpdate -func (_e *BlockEventPublisher_Expecter) PublishEventValidatorSetUpdates(_a0 interface{}) *BlockEventPublisher_PublishEventValidatorSetUpdates_Call { - return &BlockEventPublisher_PublishEventValidatorSetUpdates_Call{Call: _e.mock.On("PublishEventValidatorSetUpdates", _a0)} +// - eventDataValidatorSetUpdate +func (_e *BlockEventPublisher_Expecter) PublishEventValidatorSetUpdates(eventDataValidatorSetUpdate interface{}) *BlockEventPublisher_PublishEventValidatorSetUpdates_Call { + return &BlockEventPublisher_PublishEventValidatorSetUpdates_Call{Call: _e.mock.On("PublishEventValidatorSetUpdates", eventDataValidatorSetUpdate)} } -func (_c *BlockEventPublisher_PublishEventValidatorSetUpdates_Call) Run(run func(_a0 types.EventDataValidatorSetUpdate)) *BlockEventPublisher_PublishEventValidatorSetUpdates_Call { +func (_c *BlockEventPublisher_PublishEventValidatorSetUpdates_Call) Run(run func(eventDataValidatorSetUpdate types.EventDataValidatorSetUpdate)) *BlockEventPublisher_PublishEventValidatorSetUpdates_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(types.EventDataValidatorSetUpdate)) }) return _c } -func (_c *BlockEventPublisher_PublishEventValidatorSetUpdates_Call) Return(_a0 error) *BlockEventPublisher_PublishEventValidatorSetUpdates_Call { - _c.Call.Return(_a0) +func (_c *BlockEventPublisher_PublishEventValidatorSetUpdates_Call) Return(err error) *BlockEventPublisher_PublishEventValidatorSetUpdates_Call { + _c.Call.Return(err) return _c } -func (_c *BlockEventPublisher_PublishEventValidatorSetUpdates_Call) RunAndReturn(run func(types.EventDataValidatorSetUpdate) error) *BlockEventPublisher_PublishEventValidatorSetUpdates_Call { +func (_c *BlockEventPublisher_PublishEventValidatorSetUpdates_Call) RunAndReturn(run func(eventDataValidatorSetUpdate types.EventDataValidatorSetUpdate) error) *BlockEventPublisher_PublishEventValidatorSetUpdates_Call { _c.Call.Return(run) return _c } - -// NewBlockEventPublisher creates a new instance of BlockEventPublisher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewBlockEventPublisher(t interface { - mock.TestingT - Cleanup(func()) -}) *BlockEventPublisher { - mock := &BlockEventPublisher{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/types/mocks/privvalidator.go b/types/mocks/privvalidator.go index f875b0c42e..07f1e1fe64 100644 --- a/types/mocks/privvalidator.go +++ b/types/mocks/privvalidator.go @@ -1,23 +1,34 @@ -// Code generated by mockery. DO NOT EDIT. +// Code generated by mockery; DO NOT EDIT. +// github.com/vektra/mockery +// template: testify package mocks import ( - btcjson "github.com/dashpay/dashd-go/btcjson" - bytes "github.com/dashpay/tenderdash/libs/bytes" - - context "context" - - crypto "github.com/dashpay/tenderdash/crypto" - - log "github.com/dashpay/tenderdash/libs/log" - + "context" + + "github.com/dashpay/dashd-go/btcjson" + "github.com/dashpay/tenderdash/crypto" + "github.com/dashpay/tenderdash/libs/bytes" + "github.com/dashpay/tenderdash/libs/log" + types0 "github.com/dashpay/tenderdash/proto/tendermint/types" + "github.com/dashpay/tenderdash/types" mock "github.com/stretchr/testify/mock" +) + +// NewPrivValidator creates a new instance of PrivValidator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewPrivValidator(t interface { + mock.TestingT + Cleanup(func()) +}) *PrivValidator { + mock := &PrivValidator{} + mock.Mock.Test(t) - tenderminttypes "github.com/dashpay/tenderdash/proto/tendermint/types" + t.Cleanup(func() { mock.AssertExpectations(t) }) - types "github.com/dashpay/tenderdash/types" -) + return mock +} // PrivValidator is an autogenerated mock type for the PrivValidator type type PrivValidator struct { @@ -32,23 +43,22 @@ func (_m *PrivValidator) EXPECT() *PrivValidator_Expecter { return &PrivValidator_Expecter{mock: &_m.Mock} } -// ExtractIntoValidator provides a mock function with given fields: ctx, quorumHash -func (_m *PrivValidator) ExtractIntoValidator(ctx context.Context, quorumHash crypto.QuorumHash) *types.Validator { - ret := _m.Called(ctx, quorumHash) +// ExtractIntoValidator provides a mock function for the type PrivValidator +func (_mock *PrivValidator) ExtractIntoValidator(ctx context.Context, quorumHash crypto.QuorumHash) *types.Validator { + ret := _mock.Called(ctx, quorumHash) if len(ret) == 0 { panic("no return value specified for ExtractIntoValidator") } var r0 *types.Validator - if rf, ok := ret.Get(0).(func(context.Context, crypto.QuorumHash) *types.Validator); ok { - r0 = rf(ctx, quorumHash) + if returnFunc, ok := ret.Get(0).(func(context.Context, crypto.QuorumHash) *types.Validator); ok { + r0 = returnFunc(ctx, quorumHash) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*types.Validator) } } - return r0 } @@ -58,8 +68,8 @@ type PrivValidator_ExtractIntoValidator_Call struct { } // ExtractIntoValidator is a helper method to define mock.On call -// - ctx context.Context -// - quorumHash crypto.QuorumHash +// - ctx +// - quorumHash func (_e *PrivValidator_Expecter) ExtractIntoValidator(ctx interface{}, quorumHash interface{}) *PrivValidator_ExtractIntoValidator_Call { return &PrivValidator_ExtractIntoValidator_Call{Call: _e.mock.On("ExtractIntoValidator", ctx, quorumHash)} } @@ -71,19 +81,19 @@ func (_c *PrivValidator_ExtractIntoValidator_Call) Run(run func(ctx context.Cont return _c } -func (_c *PrivValidator_ExtractIntoValidator_Call) Return(_a0 *types.Validator) *PrivValidator_ExtractIntoValidator_Call { - _c.Call.Return(_a0) +func (_c *PrivValidator_ExtractIntoValidator_Call) Return(validator *types.Validator) *PrivValidator_ExtractIntoValidator_Call { + _c.Call.Return(validator) return _c } -func (_c *PrivValidator_ExtractIntoValidator_Call) RunAndReturn(run func(context.Context, crypto.QuorumHash) *types.Validator) *PrivValidator_ExtractIntoValidator_Call { +func (_c *PrivValidator_ExtractIntoValidator_Call) RunAndReturn(run func(ctx context.Context, quorumHash crypto.QuorumHash) *types.Validator) *PrivValidator_ExtractIntoValidator_Call { _c.Call.Return(run) return _c } -// GetFirstQuorumHash provides a mock function with given fields: _a0 -func (_m *PrivValidator) GetFirstQuorumHash(_a0 context.Context) (crypto.QuorumHash, error) { - ret := _m.Called(_a0) +// GetFirstQuorumHash provides a mock function for the type PrivValidator +func (_mock *PrivValidator) GetFirstQuorumHash(context1 context.Context) (crypto.QuorumHash, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for GetFirstQuorumHash") @@ -91,23 +101,21 @@ func (_m *PrivValidator) GetFirstQuorumHash(_a0 context.Context) (crypto.QuorumH var r0 crypto.QuorumHash var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (crypto.QuorumHash, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (crypto.QuorumHash, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) crypto.QuorumHash); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) crypto.QuorumHash); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(crypto.QuorumHash) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -117,31 +125,31 @@ type PrivValidator_GetFirstQuorumHash_Call struct { } // GetFirstQuorumHash is a helper method to define mock.On call -// - _a0 context.Context -func (_e *PrivValidator_Expecter) GetFirstQuorumHash(_a0 interface{}) *PrivValidator_GetFirstQuorumHash_Call { - return &PrivValidator_GetFirstQuorumHash_Call{Call: _e.mock.On("GetFirstQuorumHash", _a0)} +// - context1 +func (_e *PrivValidator_Expecter) GetFirstQuorumHash(context1 interface{}) *PrivValidator_GetFirstQuorumHash_Call { + return &PrivValidator_GetFirstQuorumHash_Call{Call: _e.mock.On("GetFirstQuorumHash", context1)} } -func (_c *PrivValidator_GetFirstQuorumHash_Call) Run(run func(_a0 context.Context)) *PrivValidator_GetFirstQuorumHash_Call { +func (_c *PrivValidator_GetFirstQuorumHash_Call) Run(run func(context1 context.Context)) *PrivValidator_GetFirstQuorumHash_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *PrivValidator_GetFirstQuorumHash_Call) Return(_a0 crypto.QuorumHash, _a1 error) *PrivValidator_GetFirstQuorumHash_Call { - _c.Call.Return(_a0, _a1) +func (_c *PrivValidator_GetFirstQuorumHash_Call) Return(v crypto.QuorumHash, err error) *PrivValidator_GetFirstQuorumHash_Call { + _c.Call.Return(v, err) return _c } -func (_c *PrivValidator_GetFirstQuorumHash_Call) RunAndReturn(run func(context.Context) (crypto.QuorumHash, error)) *PrivValidator_GetFirstQuorumHash_Call { +func (_c *PrivValidator_GetFirstQuorumHash_Call) RunAndReturn(run func(context1 context.Context) (crypto.QuorumHash, error)) *PrivValidator_GetFirstQuorumHash_Call { _c.Call.Return(run) return _c } -// GetHeight provides a mock function with given fields: ctx, quorumHash -func (_m *PrivValidator) GetHeight(ctx context.Context, quorumHash crypto.QuorumHash) (int64, error) { - ret := _m.Called(ctx, quorumHash) +// GetHeight provides a mock function for the type PrivValidator +func (_mock *PrivValidator) GetHeight(ctx context.Context, quorumHash crypto.QuorumHash) (int64, error) { + ret := _mock.Called(ctx, quorumHash) if len(ret) == 0 { panic("no return value specified for GetHeight") @@ -149,21 +157,19 @@ func (_m *PrivValidator) GetHeight(ctx context.Context, quorumHash crypto.Quorum var r0 int64 var r1 error - if rf, ok := ret.Get(0).(func(context.Context, crypto.QuorumHash) (int64, error)); ok { - return rf(ctx, quorumHash) + if returnFunc, ok := ret.Get(0).(func(context.Context, crypto.QuorumHash) (int64, error)); ok { + return returnFunc(ctx, quorumHash) } - if rf, ok := ret.Get(0).(func(context.Context, crypto.QuorumHash) int64); ok { - r0 = rf(ctx, quorumHash) + if returnFunc, ok := ret.Get(0).(func(context.Context, crypto.QuorumHash) int64); ok { + r0 = returnFunc(ctx, quorumHash) } else { r0 = ret.Get(0).(int64) } - - if rf, ok := ret.Get(1).(func(context.Context, crypto.QuorumHash) error); ok { - r1 = rf(ctx, quorumHash) + if returnFunc, ok := ret.Get(1).(func(context.Context, crypto.QuorumHash) error); ok { + r1 = returnFunc(ctx, quorumHash) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -173,8 +179,8 @@ type PrivValidator_GetHeight_Call struct { } // GetHeight is a helper method to define mock.On call -// - ctx context.Context -// - quorumHash crypto.QuorumHash +// - ctx +// - quorumHash func (_e *PrivValidator_Expecter) GetHeight(ctx interface{}, quorumHash interface{}) *PrivValidator_GetHeight_Call { return &PrivValidator_GetHeight_Call{Call: _e.mock.On("GetHeight", ctx, quorumHash)} } @@ -186,19 +192,19 @@ func (_c *PrivValidator_GetHeight_Call) Run(run func(ctx context.Context, quorum return _c } -func (_c *PrivValidator_GetHeight_Call) Return(_a0 int64, _a1 error) *PrivValidator_GetHeight_Call { - _c.Call.Return(_a0, _a1) +func (_c *PrivValidator_GetHeight_Call) Return(n int64, err error) *PrivValidator_GetHeight_Call { + _c.Call.Return(n, err) return _c } -func (_c *PrivValidator_GetHeight_Call) RunAndReturn(run func(context.Context, crypto.QuorumHash) (int64, error)) *PrivValidator_GetHeight_Call { +func (_c *PrivValidator_GetHeight_Call) RunAndReturn(run func(ctx context.Context, quorumHash crypto.QuorumHash) (int64, error)) *PrivValidator_GetHeight_Call { _c.Call.Return(run) return _c } -// GetPrivateKey provides a mock function with given fields: ctx, quorumHash -func (_m *PrivValidator) GetPrivateKey(ctx context.Context, quorumHash crypto.QuorumHash) (crypto.PrivKey, error) { - ret := _m.Called(ctx, quorumHash) +// GetPrivateKey provides a mock function for the type PrivValidator +func (_mock *PrivValidator) GetPrivateKey(ctx context.Context, quorumHash crypto.QuorumHash) (crypto.PrivKey, error) { + ret := _mock.Called(ctx, quorumHash) if len(ret) == 0 { panic("no return value specified for GetPrivateKey") @@ -206,23 +212,21 @@ func (_m *PrivValidator) GetPrivateKey(ctx context.Context, quorumHash crypto.Qu var r0 crypto.PrivKey var r1 error - if rf, ok := ret.Get(0).(func(context.Context, crypto.QuorumHash) (crypto.PrivKey, error)); ok { - return rf(ctx, quorumHash) + if returnFunc, ok := ret.Get(0).(func(context.Context, crypto.QuorumHash) (crypto.PrivKey, error)); ok { + return returnFunc(ctx, quorumHash) } - if rf, ok := ret.Get(0).(func(context.Context, crypto.QuorumHash) crypto.PrivKey); ok { - r0 = rf(ctx, quorumHash) + if returnFunc, ok := ret.Get(0).(func(context.Context, crypto.QuorumHash) crypto.PrivKey); ok { + r0 = returnFunc(ctx, quorumHash) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(crypto.PrivKey) } } - - if rf, ok := ret.Get(1).(func(context.Context, crypto.QuorumHash) error); ok { - r1 = rf(ctx, quorumHash) + if returnFunc, ok := ret.Get(1).(func(context.Context, crypto.QuorumHash) error); ok { + r1 = returnFunc(ctx, quorumHash) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -232,8 +236,8 @@ type PrivValidator_GetPrivateKey_Call struct { } // GetPrivateKey is a helper method to define mock.On call -// - ctx context.Context -// - quorumHash crypto.QuorumHash +// - ctx +// - quorumHash func (_e *PrivValidator_Expecter) GetPrivateKey(ctx interface{}, quorumHash interface{}) *PrivValidator_GetPrivateKey_Call { return &PrivValidator_GetPrivateKey_Call{Call: _e.mock.On("GetPrivateKey", ctx, quorumHash)} } @@ -245,19 +249,19 @@ func (_c *PrivValidator_GetPrivateKey_Call) Run(run func(ctx context.Context, qu return _c } -func (_c *PrivValidator_GetPrivateKey_Call) Return(_a0 crypto.PrivKey, _a1 error) *PrivValidator_GetPrivateKey_Call { - _c.Call.Return(_a0, _a1) +func (_c *PrivValidator_GetPrivateKey_Call) Return(privKey crypto.PrivKey, err error) *PrivValidator_GetPrivateKey_Call { + _c.Call.Return(privKey, err) return _c } -func (_c *PrivValidator_GetPrivateKey_Call) RunAndReturn(run func(context.Context, crypto.QuorumHash) (crypto.PrivKey, error)) *PrivValidator_GetPrivateKey_Call { +func (_c *PrivValidator_GetPrivateKey_Call) RunAndReturn(run func(ctx context.Context, quorumHash crypto.QuorumHash) (crypto.PrivKey, error)) *PrivValidator_GetPrivateKey_Call { _c.Call.Return(run) return _c } -// GetProTxHash provides a mock function with given fields: _a0 -func (_m *PrivValidator) GetProTxHash(_a0 context.Context) (crypto.ProTxHash, error) { - ret := _m.Called(_a0) +// GetProTxHash provides a mock function for the type PrivValidator +func (_mock *PrivValidator) GetProTxHash(context1 context.Context) (crypto.ProTxHash, error) { + ret := _mock.Called(context1) if len(ret) == 0 { panic("no return value specified for GetProTxHash") @@ -265,23 +269,21 @@ func (_m *PrivValidator) GetProTxHash(_a0 context.Context) (crypto.ProTxHash, er var r0 crypto.ProTxHash var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (crypto.ProTxHash, error)); ok { - return rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) (crypto.ProTxHash, error)); ok { + return returnFunc(context1) } - if rf, ok := ret.Get(0).(func(context.Context) crypto.ProTxHash); ok { - r0 = rf(_a0) + if returnFunc, ok := ret.Get(0).(func(context.Context) crypto.ProTxHash); ok { + r0 = returnFunc(context1) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(crypto.ProTxHash) } } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) + if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = returnFunc(context1) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -291,31 +293,31 @@ type PrivValidator_GetProTxHash_Call struct { } // GetProTxHash is a helper method to define mock.On call -// - _a0 context.Context -func (_e *PrivValidator_Expecter) GetProTxHash(_a0 interface{}) *PrivValidator_GetProTxHash_Call { - return &PrivValidator_GetProTxHash_Call{Call: _e.mock.On("GetProTxHash", _a0)} +// - context1 +func (_e *PrivValidator_Expecter) GetProTxHash(context1 interface{}) *PrivValidator_GetProTxHash_Call { + return &PrivValidator_GetProTxHash_Call{Call: _e.mock.On("GetProTxHash", context1)} } -func (_c *PrivValidator_GetProTxHash_Call) Run(run func(_a0 context.Context)) *PrivValidator_GetProTxHash_Call { +func (_c *PrivValidator_GetProTxHash_Call) Run(run func(context1 context.Context)) *PrivValidator_GetProTxHash_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } -func (_c *PrivValidator_GetProTxHash_Call) Return(_a0 crypto.ProTxHash, _a1 error) *PrivValidator_GetProTxHash_Call { - _c.Call.Return(_a0, _a1) +func (_c *PrivValidator_GetProTxHash_Call) Return(v crypto.ProTxHash, err error) *PrivValidator_GetProTxHash_Call { + _c.Call.Return(v, err) return _c } -func (_c *PrivValidator_GetProTxHash_Call) RunAndReturn(run func(context.Context) (crypto.ProTxHash, error)) *PrivValidator_GetProTxHash_Call { +func (_c *PrivValidator_GetProTxHash_Call) RunAndReturn(run func(context1 context.Context) (crypto.ProTxHash, error)) *PrivValidator_GetProTxHash_Call { _c.Call.Return(run) return _c } -// GetPubKey provides a mock function with given fields: ctx, quorumHash -func (_m *PrivValidator) GetPubKey(ctx context.Context, quorumHash crypto.QuorumHash) (crypto.PubKey, error) { - ret := _m.Called(ctx, quorumHash) +// GetPubKey provides a mock function for the type PrivValidator +func (_mock *PrivValidator) GetPubKey(ctx context.Context, quorumHash crypto.QuorumHash) (crypto.PubKey, error) { + ret := _mock.Called(ctx, quorumHash) if len(ret) == 0 { panic("no return value specified for GetPubKey") @@ -323,23 +325,21 @@ func (_m *PrivValidator) GetPubKey(ctx context.Context, quorumHash crypto.Quorum var r0 crypto.PubKey var r1 error - if rf, ok := ret.Get(0).(func(context.Context, crypto.QuorumHash) (crypto.PubKey, error)); ok { - return rf(ctx, quorumHash) + if returnFunc, ok := ret.Get(0).(func(context.Context, crypto.QuorumHash) (crypto.PubKey, error)); ok { + return returnFunc(ctx, quorumHash) } - if rf, ok := ret.Get(0).(func(context.Context, crypto.QuorumHash) crypto.PubKey); ok { - r0 = rf(ctx, quorumHash) + if returnFunc, ok := ret.Get(0).(func(context.Context, crypto.QuorumHash) crypto.PubKey); ok { + r0 = returnFunc(ctx, quorumHash) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(crypto.PubKey) } } - - if rf, ok := ret.Get(1).(func(context.Context, crypto.QuorumHash) error); ok { - r1 = rf(ctx, quorumHash) + if returnFunc, ok := ret.Get(1).(func(context.Context, crypto.QuorumHash) error); ok { + r1 = returnFunc(ctx, quorumHash) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -349,8 +349,8 @@ type PrivValidator_GetPubKey_Call struct { } // GetPubKey is a helper method to define mock.On call -// - ctx context.Context -// - quorumHash crypto.QuorumHash +// - ctx +// - quorumHash func (_e *PrivValidator_Expecter) GetPubKey(ctx interface{}, quorumHash interface{}) *PrivValidator_GetPubKey_Call { return &PrivValidator_GetPubKey_Call{Call: _e.mock.On("GetPubKey", ctx, quorumHash)} } @@ -362,19 +362,19 @@ func (_c *PrivValidator_GetPubKey_Call) Run(run func(ctx context.Context, quorum return _c } -func (_c *PrivValidator_GetPubKey_Call) Return(_a0 crypto.PubKey, _a1 error) *PrivValidator_GetPubKey_Call { - _c.Call.Return(_a0, _a1) +func (_c *PrivValidator_GetPubKey_Call) Return(pubKey crypto.PubKey, err error) *PrivValidator_GetPubKey_Call { + _c.Call.Return(pubKey, err) return _c } -func (_c *PrivValidator_GetPubKey_Call) RunAndReturn(run func(context.Context, crypto.QuorumHash) (crypto.PubKey, error)) *PrivValidator_GetPubKey_Call { +func (_c *PrivValidator_GetPubKey_Call) RunAndReturn(run func(ctx context.Context, quorumHash crypto.QuorumHash) (crypto.PubKey, error)) *PrivValidator_GetPubKey_Call { _c.Call.Return(run) return _c } -// GetThresholdPublicKey provides a mock function with given fields: ctx, quorumHash -func (_m *PrivValidator) GetThresholdPublicKey(ctx context.Context, quorumHash crypto.QuorumHash) (crypto.PubKey, error) { - ret := _m.Called(ctx, quorumHash) +// GetThresholdPublicKey provides a mock function for the type PrivValidator +func (_mock *PrivValidator) GetThresholdPublicKey(ctx context.Context, quorumHash crypto.QuorumHash) (crypto.PubKey, error) { + ret := _mock.Called(ctx, quorumHash) if len(ret) == 0 { panic("no return value specified for GetThresholdPublicKey") @@ -382,23 +382,21 @@ func (_m *PrivValidator) GetThresholdPublicKey(ctx context.Context, quorumHash c var r0 crypto.PubKey var r1 error - if rf, ok := ret.Get(0).(func(context.Context, crypto.QuorumHash) (crypto.PubKey, error)); ok { - return rf(ctx, quorumHash) + if returnFunc, ok := ret.Get(0).(func(context.Context, crypto.QuorumHash) (crypto.PubKey, error)); ok { + return returnFunc(ctx, quorumHash) } - if rf, ok := ret.Get(0).(func(context.Context, crypto.QuorumHash) crypto.PubKey); ok { - r0 = rf(ctx, quorumHash) + if returnFunc, ok := ret.Get(0).(func(context.Context, crypto.QuorumHash) crypto.PubKey); ok { + r0 = returnFunc(ctx, quorumHash) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(crypto.PubKey) } } - - if rf, ok := ret.Get(1).(func(context.Context, crypto.QuorumHash) error); ok { - r1 = rf(ctx, quorumHash) + if returnFunc, ok := ret.Get(1).(func(context.Context, crypto.QuorumHash) error); ok { + r1 = returnFunc(ctx, quorumHash) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -408,8 +406,8 @@ type PrivValidator_GetThresholdPublicKey_Call struct { } // GetThresholdPublicKey is a helper method to define mock.On call -// - ctx context.Context -// - quorumHash crypto.QuorumHash +// - ctx +// - quorumHash func (_e *PrivValidator_Expecter) GetThresholdPublicKey(ctx interface{}, quorumHash interface{}) *PrivValidator_GetThresholdPublicKey_Call { return &PrivValidator_GetThresholdPublicKey_Call{Call: _e.mock.On("GetThresholdPublicKey", ctx, quorumHash)} } @@ -421,19 +419,19 @@ func (_c *PrivValidator_GetThresholdPublicKey_Call) Run(run func(ctx context.Con return _c } -func (_c *PrivValidator_GetThresholdPublicKey_Call) Return(_a0 crypto.PubKey, _a1 error) *PrivValidator_GetThresholdPublicKey_Call { - _c.Call.Return(_a0, _a1) +func (_c *PrivValidator_GetThresholdPublicKey_Call) Return(pubKey crypto.PubKey, err error) *PrivValidator_GetThresholdPublicKey_Call { + _c.Call.Return(pubKey, err) return _c } -func (_c *PrivValidator_GetThresholdPublicKey_Call) RunAndReturn(run func(context.Context, crypto.QuorumHash) (crypto.PubKey, error)) *PrivValidator_GetThresholdPublicKey_Call { +func (_c *PrivValidator_GetThresholdPublicKey_Call) RunAndReturn(run func(ctx context.Context, quorumHash crypto.QuorumHash) (crypto.PubKey, error)) *PrivValidator_GetThresholdPublicKey_Call { _c.Call.Return(run) return _c } -// SignProposal provides a mock function with given fields: ctx, chainID, quorumType, quorumHash, proposal -func (_m *PrivValidator) SignProposal(ctx context.Context, chainID string, quorumType btcjson.LLMQType, quorumHash crypto.QuorumHash, proposal *tenderminttypes.Proposal) (bytes.HexBytes, error) { - ret := _m.Called(ctx, chainID, quorumType, quorumHash, proposal) +// SignProposal provides a mock function for the type PrivValidator +func (_mock *PrivValidator) SignProposal(ctx context.Context, chainID string, quorumType btcjson.LLMQType, quorumHash crypto.QuorumHash, proposal *types0.Proposal) (bytes.HexBytes, error) { + ret := _mock.Called(ctx, chainID, quorumType, quorumHash, proposal) if len(ret) == 0 { panic("no return value specified for SignProposal") @@ -441,23 +439,21 @@ func (_m *PrivValidator) SignProposal(ctx context.Context, chainID string, quoru var r0 bytes.HexBytes var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, btcjson.LLMQType, crypto.QuorumHash, *tenderminttypes.Proposal) (bytes.HexBytes, error)); ok { - return rf(ctx, chainID, quorumType, quorumHash, proposal) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, btcjson.LLMQType, crypto.QuorumHash, *types0.Proposal) (bytes.HexBytes, error)); ok { + return returnFunc(ctx, chainID, quorumType, quorumHash, proposal) } - if rf, ok := ret.Get(0).(func(context.Context, string, btcjson.LLMQType, crypto.QuorumHash, *tenderminttypes.Proposal) bytes.HexBytes); ok { - r0 = rf(ctx, chainID, quorumType, quorumHash, proposal) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, btcjson.LLMQType, crypto.QuorumHash, *types0.Proposal) bytes.HexBytes); ok { + r0 = returnFunc(ctx, chainID, quorumType, quorumHash, proposal) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(bytes.HexBytes) } } - - if rf, ok := ret.Get(1).(func(context.Context, string, btcjson.LLMQType, crypto.QuorumHash, *tenderminttypes.Proposal) error); ok { - r1 = rf(ctx, chainID, quorumType, quorumHash, proposal) + if returnFunc, ok := ret.Get(1).(func(context.Context, string, btcjson.LLMQType, crypto.QuorumHash, *types0.Proposal) error); ok { + r1 = returnFunc(ctx, chainID, quorumType, quorumHash, proposal) } else { r1 = ret.Error(1) } - return r0, r1 } @@ -467,47 +463,46 @@ type PrivValidator_SignProposal_Call struct { } // SignProposal is a helper method to define mock.On call -// - ctx context.Context -// - chainID string -// - quorumType btcjson.LLMQType -// - quorumHash crypto.QuorumHash -// - proposal *tenderminttypes.Proposal +// - ctx +// - chainID +// - quorumType +// - quorumHash +// - proposal func (_e *PrivValidator_Expecter) SignProposal(ctx interface{}, chainID interface{}, quorumType interface{}, quorumHash interface{}, proposal interface{}) *PrivValidator_SignProposal_Call { return &PrivValidator_SignProposal_Call{Call: _e.mock.On("SignProposal", ctx, chainID, quorumType, quorumHash, proposal)} } -func (_c *PrivValidator_SignProposal_Call) Run(run func(ctx context.Context, chainID string, quorumType btcjson.LLMQType, quorumHash crypto.QuorumHash, proposal *tenderminttypes.Proposal)) *PrivValidator_SignProposal_Call { +func (_c *PrivValidator_SignProposal_Call) Run(run func(ctx context.Context, chainID string, quorumType btcjson.LLMQType, quorumHash crypto.QuorumHash, proposal *types0.Proposal)) *PrivValidator_SignProposal_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(btcjson.LLMQType), args[3].(crypto.QuorumHash), args[4].(*tenderminttypes.Proposal)) + run(args[0].(context.Context), args[1].(string), args[2].(btcjson.LLMQType), args[3].(crypto.QuorumHash), args[4].(*types0.Proposal)) }) return _c } -func (_c *PrivValidator_SignProposal_Call) Return(_a0 bytes.HexBytes, _a1 error) *PrivValidator_SignProposal_Call { - _c.Call.Return(_a0, _a1) +func (_c *PrivValidator_SignProposal_Call) Return(hexBytes bytes.HexBytes, err error) *PrivValidator_SignProposal_Call { + _c.Call.Return(hexBytes, err) return _c } -func (_c *PrivValidator_SignProposal_Call) RunAndReturn(run func(context.Context, string, btcjson.LLMQType, crypto.QuorumHash, *tenderminttypes.Proposal) (bytes.HexBytes, error)) *PrivValidator_SignProposal_Call { +func (_c *PrivValidator_SignProposal_Call) RunAndReturn(run func(ctx context.Context, chainID string, quorumType btcjson.LLMQType, quorumHash crypto.QuorumHash, proposal *types0.Proposal) (bytes.HexBytes, error)) *PrivValidator_SignProposal_Call { _c.Call.Return(run) return _c } -// SignVote provides a mock function with given fields: ctx, chainID, quorumType, quorumHash, vote, logger -func (_m *PrivValidator) SignVote(ctx context.Context, chainID string, quorumType btcjson.LLMQType, quorumHash crypto.QuorumHash, vote *tenderminttypes.Vote, logger log.Logger) error { - ret := _m.Called(ctx, chainID, quorumType, quorumHash, vote, logger) +// SignVote provides a mock function for the type PrivValidator +func (_mock *PrivValidator) SignVote(ctx context.Context, chainID string, quorumType btcjson.LLMQType, quorumHash crypto.QuorumHash, vote *types0.Vote, logger log.Logger) error { + ret := _mock.Called(ctx, chainID, quorumType, quorumHash, vote, logger) if len(ret) == 0 { panic("no return value specified for SignVote") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, btcjson.LLMQType, crypto.QuorumHash, *tenderminttypes.Vote, log.Logger) error); ok { - r0 = rf(ctx, chainID, quorumType, quorumHash, vote, logger) + if returnFunc, ok := ret.Get(0).(func(context.Context, string, btcjson.LLMQType, crypto.QuorumHash, *types0.Vote, log.Logger) error); ok { + r0 = returnFunc(ctx, chainID, quorumType, quorumHash, vote, logger) } else { r0 = ret.Error(0) } - return r0 } @@ -517,36 +512,37 @@ type PrivValidator_SignVote_Call struct { } // SignVote is a helper method to define mock.On call -// - ctx context.Context -// - chainID string -// - quorumType btcjson.LLMQType -// - quorumHash crypto.QuorumHash -// - vote *tenderminttypes.Vote -// - logger log.Logger +// - ctx +// - chainID +// - quorumType +// - quorumHash +// - vote +// - logger func (_e *PrivValidator_Expecter) SignVote(ctx interface{}, chainID interface{}, quorumType interface{}, quorumHash interface{}, vote interface{}, logger interface{}) *PrivValidator_SignVote_Call { return &PrivValidator_SignVote_Call{Call: _e.mock.On("SignVote", ctx, chainID, quorumType, quorumHash, vote, logger)} } -func (_c *PrivValidator_SignVote_Call) Run(run func(ctx context.Context, chainID string, quorumType btcjson.LLMQType, quorumHash crypto.QuorumHash, vote *tenderminttypes.Vote, logger log.Logger)) *PrivValidator_SignVote_Call { +func (_c *PrivValidator_SignVote_Call) Run(run func(ctx context.Context, chainID string, quorumType btcjson.LLMQType, quorumHash crypto.QuorumHash, vote *types0.Vote, logger log.Logger)) *PrivValidator_SignVote_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(btcjson.LLMQType), args[3].(crypto.QuorumHash), args[4].(*tenderminttypes.Vote), args[5].(log.Logger)) + run(args[0].(context.Context), args[1].(string), args[2].(btcjson.LLMQType), args[3].(crypto.QuorumHash), args[4].(*types0.Vote), args[5].(log.Logger)) }) return _c } -func (_c *PrivValidator_SignVote_Call) Return(_a0 error) *PrivValidator_SignVote_Call { - _c.Call.Return(_a0) +func (_c *PrivValidator_SignVote_Call) Return(err error) *PrivValidator_SignVote_Call { + _c.Call.Return(err) return _c } -func (_c *PrivValidator_SignVote_Call) RunAndReturn(run func(context.Context, string, btcjson.LLMQType, crypto.QuorumHash, *tenderminttypes.Vote, log.Logger) error) *PrivValidator_SignVote_Call { +func (_c *PrivValidator_SignVote_Call) RunAndReturn(run func(ctx context.Context, chainID string, quorumType btcjson.LLMQType, quorumHash crypto.QuorumHash, vote *types0.Vote, logger log.Logger) error) *PrivValidator_SignVote_Call { _c.Call.Return(run) return _c } -// UpdatePrivateKey provides a mock function with given fields: ctx, privateKey, quorumHash, thresholdPublicKey, height -func (_m *PrivValidator) UpdatePrivateKey(ctx context.Context, privateKey crypto.PrivKey, quorumHash crypto.QuorumHash, thresholdPublicKey crypto.PubKey, height int64) { - _m.Called(ctx, privateKey, quorumHash, thresholdPublicKey, height) +// UpdatePrivateKey provides a mock function for the type PrivValidator +func (_mock *PrivValidator) UpdatePrivateKey(ctx context.Context, privateKey crypto.PrivKey, quorumHash crypto.QuorumHash, thresholdPublicKey crypto.PubKey, height int64) { + _mock.Called(ctx, privateKey, quorumHash, thresholdPublicKey, height) + return } // PrivValidator_UpdatePrivateKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePrivateKey' @@ -555,11 +551,11 @@ type PrivValidator_UpdatePrivateKey_Call struct { } // UpdatePrivateKey is a helper method to define mock.On call -// - ctx context.Context -// - privateKey crypto.PrivKey -// - quorumHash crypto.QuorumHash -// - thresholdPublicKey crypto.PubKey -// - height int64 +// - ctx +// - privateKey +// - quorumHash +// - thresholdPublicKey +// - height func (_e *PrivValidator_Expecter) UpdatePrivateKey(ctx interface{}, privateKey interface{}, quorumHash interface{}, thresholdPublicKey interface{}, height interface{}) *PrivValidator_UpdatePrivateKey_Call { return &PrivValidator_UpdatePrivateKey_Call{Call: _e.mock.On("UpdatePrivateKey", ctx, privateKey, quorumHash, thresholdPublicKey, height)} } @@ -576,21 +572,7 @@ func (_c *PrivValidator_UpdatePrivateKey_Call) Return() *PrivValidator_UpdatePri return _c } -func (_c *PrivValidator_UpdatePrivateKey_Call) RunAndReturn(run func(context.Context, crypto.PrivKey, crypto.QuorumHash, crypto.PubKey, int64)) *PrivValidator_UpdatePrivateKey_Call { +func (_c *PrivValidator_UpdatePrivateKey_Call) RunAndReturn(run func(ctx context.Context, privateKey crypto.PrivKey, quorumHash crypto.QuorumHash, thresholdPublicKey crypto.PubKey, height int64)) *PrivValidator_UpdatePrivateKey_Call { _c.Run(run) return _c } - -// NewPrivValidator creates a new instance of PrivValidator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewPrivValidator(t interface { - mock.TestingT - Cleanup(func()) -}) *PrivValidator { - mock := &PrivValidator{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -}