diff --git a/.github/workflows/check-generated.yml b/.github/workflows/check-generated.yml index f8703ac00..f49ee9ce1 100644 --- a/.github/workflows/check-generated.yml +++ b/.github/workflows/check-generated.yml @@ -31,7 +31,7 @@ jobs: run: | set -euo pipefail - readonly MOCKERY=2.46.3 # N.B. no leading "v" + readonly MOCKERY=2.49.1 # 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 80776dad4..d44c09dfc 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -1,11 +1,13 @@ --- -with-expecter: false +with-expecter: true dir: "{{.InterfaceDir}}/mocks" mockname: "{{.InterfaceName}}" outpkg: "mocks" 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: diff --git a/abci/client/mocks/client.go b/abci/client/mocks/client.go index 433a0cb60..a63990256 100644 --- a/abci/client/mocks/client.go +++ b/abci/client/mocks/client.go @@ -14,6 +14,14 @@ type Client struct { mock.Mock } +type Client_Expecter struct { + mock *mock.Mock +} + +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) @@ -44,6 +52,35 @@ func (_m *Client) ApplySnapshotChunk(_a0 context.Context, _a1 *types.RequestAppl return r0, r1 } +// Client_ApplySnapshotChunk_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplySnapshotChunk' +type Client_ApplySnapshotChunk_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_ApplySnapshotChunk_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Client_ApplySnapshotChunk_Call) RunAndReturn(run func(context.Context, *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) @@ -74,6 +111,35 @@ func (_m *Client) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) (*type return r0, r1 } +// Client_CheckTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckTx' +type Client_CheckTx_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_CheckTx_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Client_CheckTx_Call) RunAndReturn(run func(context.Context, *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) @@ -104,6 +170,35 @@ func (_m *Client) Echo(_a0 context.Context, _a1 string) (*types.ResponseEcho, er return r0, r1 } +// Client_Echo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Echo' +type Client_Echo_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_Echo_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *Client_Echo_Call) RunAndReturn(run func(context.Context, string) (*types.ResponseEcho, error)) *Client_Echo_Call { + _c.Call.Return(run) + return _c +} + // Error provides a mock function with given fields: func (_m *Client) Error() error { ret := _m.Called() @@ -122,6 +217,33 @@ func (_m *Client) Error() error { return r0 } +// Client_Error_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Error' +type Client_Error_Call struct { + *mock.Call +} + +// Error is a helper method to define mock.On call +func (_e *Client_Expecter) Error() *Client_Error_Call { + return &Client_Error_Call{Call: _e.mock.On("Error")} +} + +func (_c *Client_Error_Call) Run(run func()) *Client_Error_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Client_Error_Call) Return(_a0 error) *Client_Error_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_Error_Call) RunAndReturn(run func() error) *Client_Error_Call { + _c.Call.Return(run) + 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) @@ -152,6 +274,35 @@ func (_m *Client) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendVote) return r0, r1 } +// Client_ExtendVote_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExtendVote' +type Client_ExtendVote_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_ExtendVote_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Client_ExtendVote_Call) RunAndReturn(run func(context.Context, *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) @@ -182,6 +333,35 @@ func (_m *Client) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFinalizeB return r0, r1 } +// Client_FinalizeBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinalizeBlock' +type Client_FinalizeBlock_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_FinalizeBlock_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Client_FinalizeBlock_Call) RunAndReturn(run func(context.Context, *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) @@ -200,6 +380,34 @@ func (_m *Client) Flush(_a0 context.Context) error { return r0 } +// Client_Flush_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Flush' +type Client_Flush_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_Flush_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Client_Flush_Call) RunAndReturn(run func(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) @@ -230,6 +438,35 @@ func (_m *Client) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types.Resp return r0, r1 } +// Client_Info_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Info' +type Client_Info_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_Info_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Client_Info_Call) RunAndReturn(run func(context.Context, *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) @@ -260,6 +497,35 @@ func (_m *Client) InitChain(_a0 context.Context, _a1 *types.RequestInitChain) (* return r0, r1 } +// Client_InitChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InitChain' +type Client_InitChain_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_InitChain_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Client_InitChain_Call) RunAndReturn(run func(context.Context, *types.RequestInitChain) (*types.ResponseInitChain, error)) *Client_InitChain_Call { + _c.Call.Return(run) + return _c +} + // IsRunning provides a mock function with given fields: func (_m *Client) IsRunning() bool { ret := _m.Called() @@ -278,6 +544,33 @@ func (_m *Client) IsRunning() bool { return r0 } +// Client_IsRunning_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsRunning' +type Client_IsRunning_Call struct { + *mock.Call +} + +// IsRunning is a helper method to define mock.On call +func (_e *Client_Expecter) IsRunning() *Client_IsRunning_Call { + return &Client_IsRunning_Call{Call: _e.mock.On("IsRunning")} +} + +func (_c *Client_IsRunning_Call) Run(run func()) *Client_IsRunning_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Client_IsRunning_Call) Return(_a0 bool) *Client_IsRunning_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_IsRunning_Call) RunAndReturn(run func() bool) *Client_IsRunning_Call { + _c.Call.Return(run) + 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) @@ -308,6 +601,35 @@ func (_m *Client) ListSnapshots(_a0 context.Context, _a1 *types.RequestListSnaps return r0, r1 } +// Client_ListSnapshots_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSnapshots' +type Client_ListSnapshots_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_ListSnapshots_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Client_ListSnapshots_Call) RunAndReturn(run func(context.Context, *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) @@ -338,6 +660,35 @@ func (_m *Client) LoadSnapshotChunk(_a0 context.Context, _a1 *types.RequestLoadS return r0, r1 } +// Client_LoadSnapshotChunk_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadSnapshotChunk' +type Client_LoadSnapshotChunk_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_LoadSnapshotChunk_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Client_LoadSnapshotChunk_Call) RunAndReturn(run func(context.Context, *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) @@ -368,6 +719,35 @@ func (_m *Client) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOfferSnap return r0, r1 } +// Client_OfferSnapshot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OfferSnapshot' +type Client_OfferSnapshot_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_OfferSnapshot_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Client_OfferSnapshot_Call) RunAndReturn(run func(context.Context, *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) @@ -398,6 +778,35 @@ func (_m *Client) PrepareProposal(_a0 context.Context, _a1 *types.RequestPrepare return r0, r1 } +// Client_PrepareProposal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PrepareProposal' +type Client_PrepareProposal_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_PrepareProposal_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Client_PrepareProposal_Call) RunAndReturn(run func(context.Context, *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) @@ -428,6 +837,35 @@ func (_m *Client) ProcessProposal(_a0 context.Context, _a1 *types.RequestProcess return r0, r1 } +// Client_ProcessProposal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProcessProposal' +type Client_ProcessProposal_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_ProcessProposal_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Client_ProcessProposal_Call) RunAndReturn(run func(context.Context, *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) @@ -458,6 +896,35 @@ func (_m *Client) Query(_a0 context.Context, _a1 *types.RequestQuery) (*types.Re return r0, r1 } +// Client_Query_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Query' +type Client_Query_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_Query_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Client_Query_Call) RunAndReturn(run func(context.Context, *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) @@ -476,6 +943,34 @@ func (_m *Client) Start(_a0 context.Context) error { return r0 } +// Client_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type Client_Start_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_Start_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Client_Start_Call) RunAndReturn(run func(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) @@ -506,11 +1001,67 @@ func (_m *Client) VerifyVoteExtension(_a0 context.Context, _a1 *types.RequestVer return r0, r1 } +// Client_VerifyVoteExtension_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifyVoteExtension' +type Client_VerifyVoteExtension_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_VerifyVoteExtension_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Client_VerifyVoteExtension_Call) RunAndReturn(run func(context.Context, *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error)) *Client_VerifyVoteExtension_Call { + _c.Call.Return(run) + return _c +} + // Wait provides a mock function with given fields: func (_m *Client) Wait() { _m.Called() } +// Client_Wait_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Wait' +type Client_Wait_Call struct { + *mock.Call +} + +// Wait is a helper method to define mock.On call +func (_e *Client_Expecter) Wait() *Client_Wait_Call { + return &Client_Wait_Call{Call: _e.mock.On("Wait")} +} + +func (_c *Client_Wait_Call) Run(run func()) *Client_Wait_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Client_Wait_Call) Return() *Client_Wait_Call { + _c.Call.Return() + return _c +} + +func (_c *Client_Wait_Call) RunAndReturn(run func()) *Client_Wait_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 { diff --git a/abci/types/mocks/application.go b/abci/types/mocks/application.go index 04ca3c577..1a706370d 100644 --- a/abci/types/mocks/application.go +++ b/abci/types/mocks/application.go @@ -14,6 +14,14 @@ type Application struct { mock.Mock } +type Application_Expecter struct { + mock *mock.Mock +} + +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) @@ -44,6 +52,35 @@ func (_m *Application) ApplySnapshotChunk(_a0 context.Context, _a1 *types.Reques return r0, r1 } +// Application_ApplySnapshotChunk_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplySnapshotChunk' +type Application_ApplySnapshotChunk_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Application_ApplySnapshotChunk_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Application_ApplySnapshotChunk_Call) RunAndReturn(run func(context.Context, *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) @@ -74,6 +111,35 @@ func (_m *Application) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) ( return r0, r1 } +// Application_CheckTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckTx' +type Application_CheckTx_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Application_CheckTx_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Application_CheckTx_Call) RunAndReturn(run func(context.Context, *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) @@ -104,6 +170,35 @@ func (_m *Application) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendV return r0, r1 } +// Application_ExtendVote_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExtendVote' +type Application_ExtendVote_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Application_ExtendVote_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Application_ExtendVote_Call) RunAndReturn(run func(context.Context, *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) @@ -134,6 +229,35 @@ func (_m *Application) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFina return r0, r1 } +// Application_FinalizeBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinalizeBlock' +type Application_FinalizeBlock_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Application_FinalizeBlock_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Application_FinalizeBlock_Call) RunAndReturn(run func(context.Context, *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) @@ -164,6 +288,35 @@ func (_m *Application) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types return r0, r1 } +// Application_Info_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Info' +type Application_Info_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Application_Info_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Application_Info_Call) RunAndReturn(run func(context.Context, *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) @@ -194,6 +347,35 @@ func (_m *Application) InitChain(_a0 context.Context, _a1 *types.RequestInitChai return r0, r1 } +// Application_InitChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InitChain' +type Application_InitChain_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Application_InitChain_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Application_InitChain_Call) RunAndReturn(run func(context.Context, *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) @@ -224,6 +406,35 @@ func (_m *Application) ListSnapshots(_a0 context.Context, _a1 *types.RequestList return r0, r1 } +// Application_ListSnapshots_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSnapshots' +type Application_ListSnapshots_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Application_ListSnapshots_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Application_ListSnapshots_Call) RunAndReturn(run func(context.Context, *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) @@ -254,6 +465,35 @@ func (_m *Application) LoadSnapshotChunk(_a0 context.Context, _a1 *types.Request return r0, r1 } +// Application_LoadSnapshotChunk_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadSnapshotChunk' +type Application_LoadSnapshotChunk_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Application_LoadSnapshotChunk_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Application_LoadSnapshotChunk_Call) RunAndReturn(run func(context.Context, *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) @@ -284,6 +524,35 @@ func (_m *Application) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOffe return r0, r1 } +// Application_OfferSnapshot_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OfferSnapshot' +type Application_OfferSnapshot_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Application_OfferSnapshot_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Application_OfferSnapshot_Call) RunAndReturn(run func(context.Context, *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) @@ -314,6 +583,35 @@ func (_m *Application) PrepareProposal(_a0 context.Context, _a1 *types.RequestPr return r0, r1 } +// Application_PrepareProposal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PrepareProposal' +type Application_PrepareProposal_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Application_PrepareProposal_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Application_PrepareProposal_Call) RunAndReturn(run func(context.Context, *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) @@ -344,6 +642,35 @@ func (_m *Application) ProcessProposal(_a0 context.Context, _a1 *types.RequestPr return r0, r1 } +// Application_ProcessProposal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProcessProposal' +type Application_ProcessProposal_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Application_ProcessProposal_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Application_ProcessProposal_Call) RunAndReturn(run func(context.Context, *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) @@ -374,6 +701,35 @@ func (_m *Application) Query(_a0 context.Context, _a1 *types.RequestQuery) (*typ return r0, r1 } +// Application_Query_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Query' +type Application_Query_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Application_Query_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Application_Query_Call) RunAndReturn(run func(context.Context, *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) @@ -404,6 +760,35 @@ func (_m *Application) VerifyVoteExtension(_a0 context.Context, _a1 *types.Reque return r0, r1 } +// Application_VerifyVoteExtension_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifyVoteExtension' +type Application_VerifyVoteExtension_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Application_VerifyVoteExtension_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Application_VerifyVoteExtension_Call) RunAndReturn(run func(context.Context, *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 { diff --git a/dash/core/mocks/client.go b/dash/core/mocks/client.go index 364f2aaa7..677f59b94 100644 --- a/dash/core/mocks/client.go +++ b/dash/core/mocks/client.go @@ -16,6 +16,14 @@ type Client struct { mock.Mock } +type Client_Expecter struct { + mock *mock.Mock +} + +func (_m *Client) EXPECT() *Client_Expecter { + return &Client_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *Client) Close() error { ret := _m.Called() @@ -34,6 +42,33 @@ func (_m *Client) Close() error { return r0 } +// Client_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Client_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Client_Expecter) Close() *Client_Close_Call { + return &Client_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Client_Close_Call) Run(run func()) *Client_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Client_Close_Call) Return(_a0 error) *Client_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_Close_Call) RunAndReturn(run func() error) *Client_Close_Call { + _c.Call.Return(run) + return _c +} + // GetNetworkInfo provides a mock function with given fields: func (_m *Client) GetNetworkInfo() (*btcjson.GetNetworkInfoResult, error) { ret := _m.Called() @@ -64,6 +99,33 @@ func (_m *Client) GetNetworkInfo() (*btcjson.GetNetworkInfoResult, error) { return r0, r1 } +// Client_GetNetworkInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNetworkInfo' +type Client_GetNetworkInfo_Call struct { + *mock.Call +} + +// GetNetworkInfo is a helper method to define mock.On call +func (_e *Client_Expecter) GetNetworkInfo() *Client_GetNetworkInfo_Call { + return &Client_GetNetworkInfo_Call{Call: _e.mock.On("GetNetworkInfo")} +} + +func (_c *Client_GetNetworkInfo_Call) Run(run func()) *Client_GetNetworkInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Client_GetNetworkInfo_Call) Return(_a0 *btcjson.GetNetworkInfoResult, _a1 error) *Client_GetNetworkInfo_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_GetNetworkInfo_Call) RunAndReturn(run func() (*btcjson.GetNetworkInfoResult, error)) *Client_GetNetworkInfo_Call { + _c.Call.Return(run) + 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) @@ -94,6 +156,34 @@ func (_m *Client) MasternodeListJSON(filter string) (map[string]btcjson.Masterno return r0, r1 } +// Client_MasternodeListJSON_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MasternodeListJSON' +type Client_MasternodeListJSON_Call struct { + *mock.Call +} + +// MasternodeListJSON is a helper method to define mock.On call +// - filter string +func (_e *Client_Expecter) MasternodeListJSON(filter interface{}) *Client_MasternodeListJSON_Call { + return &Client_MasternodeListJSON_Call{Call: _e.mock.On("MasternodeListJSON", filter)} +} + +func (_c *Client_MasternodeListJSON_Call) Run(run func(filter string)) *Client_MasternodeListJSON_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Client_MasternodeListJSON_Call) Return(_a0 map[string]btcjson.MasternodelistResultJSON, _a1 error) *Client_MasternodeListJSON_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_MasternodeListJSON_Call) RunAndReturn(run func(string) (map[string]btcjson.MasternodelistResultJSON, error)) *Client_MasternodeListJSON_Call { + _c.Call.Return(run) + return _c +} + // MasternodeStatus provides a mock function with given fields: func (_m *Client) MasternodeStatus() (*btcjson.MasternodeStatusResult, error) { ret := _m.Called() @@ -124,6 +214,33 @@ func (_m *Client) MasternodeStatus() (*btcjson.MasternodeStatusResult, error) { return r0, r1 } +// Client_MasternodeStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MasternodeStatus' +type Client_MasternodeStatus_Call struct { + *mock.Call +} + +// MasternodeStatus is a helper method to define mock.On call +func (_e *Client_Expecter) MasternodeStatus() *Client_MasternodeStatus_Call { + return &Client_MasternodeStatus_Call{Call: _e.mock.On("MasternodeStatus")} +} + +func (_c *Client_MasternodeStatus_Call) Run(run func()) *Client_MasternodeStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Client_MasternodeStatus_Call) Return(_a0 *btcjson.MasternodeStatusResult, _a1 error) *Client_MasternodeStatus_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_MasternodeStatus_Call) RunAndReturn(run func() (*btcjson.MasternodeStatusResult, error)) *Client_MasternodeStatus_Call { + _c.Call.Return(run) + return _c +} + // Ping provides a mock function with given fields: func (_m *Client) Ping() error { ret := _m.Called() @@ -142,6 +259,33 @@ func (_m *Client) Ping() error { return r0 } +// Client_Ping_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Ping' +type Client_Ping_Call struct { + *mock.Call +} + +// Ping is a helper method to define mock.On call +func (_e *Client_Expecter) Ping() *Client_Ping_Call { + return &Client_Ping_Call{Call: _e.mock.On("Ping")} +} + +func (_c *Client_Ping_Call) Run(run func()) *Client_Ping_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Client_Ping_Call) Return(_a0 error) *Client_Ping_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_Ping_Call) RunAndReturn(run func() error) *Client_Ping_Call { + _c.Call.Return(run) + 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) @@ -172,6 +316,35 @@ func (_m *Client) QuorumInfo(quorumType btcjson.LLMQType, quorumHash crypto.Quor return r0, r1 } +// Client_QuorumInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QuorumInfo' +type Client_QuorumInfo_Call struct { + *mock.Call +} + +// QuorumInfo is a helper method to define mock.On call +// - quorumType btcjson.LLMQType +// - quorumHash crypto.QuorumHash +func (_e *Client_Expecter) QuorumInfo(quorumType interface{}, quorumHash interface{}) *Client_QuorumInfo_Call { + return &Client_QuorumInfo_Call{Call: _e.mock.On("QuorumInfo", quorumType, quorumHash)} +} + +func (_c *Client_QuorumInfo_Call) Run(run func(quorumType btcjson.LLMQType, quorumHash crypto.QuorumHash)) *Client_QuorumInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(btcjson.LLMQType), args[1].(crypto.QuorumHash)) + }) + return _c +} + +func (_c *Client_QuorumInfo_Call) Return(_a0 *btcjson.QuorumInfoResult, _a1 error) *Client_QuorumInfo_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_QuorumInfo_Call) RunAndReturn(run func(btcjson.LLMQType, 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) @@ -202,6 +375,37 @@ func (_m *Client) QuorumSign(quorumType btcjson.LLMQType, requestID bytes.HexByt return r0, r1 } +// Client_QuorumSign_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QuorumSign' +type Client_QuorumSign_Call struct { + *mock.Call +} + +// QuorumSign is a helper method to define mock.On call +// - quorumType btcjson.LLMQType +// - requestID bytes.HexBytes +// - messageHash bytes.HexBytes +// - quorumHash bytes.HexBytes +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)} +} + +func (_c *Client_QuorumSign_Call) Run(run func(quorumType btcjson.LLMQType, requestID bytes.HexBytes, messageHash bytes.HexBytes, quorumHash bytes.HexBytes)) *Client_QuorumSign_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(btcjson.LLMQType), args[1].(bytes.HexBytes), args[2].(bytes.HexBytes), args[3].(bytes.HexBytes)) + }) + return _c +} + +func (_c *Client_QuorumSign_Call) Return(_a0 *btcjson.QuorumSignResult, _a1 error) *Client_QuorumSign_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_QuorumSign_Call) RunAndReturn(run func(btcjson.LLMQType, bytes.HexBytes, bytes.HexBytes, 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) @@ -230,6 +434,38 @@ func (_m *Client) QuorumVerify(quorumType btcjson.LLMQType, requestID bytes.HexB return r0, r1 } +// Client_QuorumVerify_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'QuorumVerify' +type Client_QuorumVerify_Call struct { + *mock.Call +} + +// 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 +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)} +} + +func (_c *Client_QuorumVerify_Call) Run(run func(quorumType btcjson.LLMQType, requestID bytes.HexBytes, messageHash bytes.HexBytes, signature bytes.HexBytes, quorumHash bytes.HexBytes)) *Client_QuorumVerify_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(btcjson.LLMQType), args[1].(bytes.HexBytes), args[2].(bytes.HexBytes), args[3].(bytes.HexBytes), args[4].(bytes.HexBytes)) + }) + return _c +} + +func (_c *Client_QuorumVerify_Call) Return(_a0 bool, _a1 error) *Client_QuorumVerify_Call { + _c.Call.Return(_a0, _a1) + 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 { + _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 { diff --git a/go.mod b/go.mod index e37707cdc..9d3f0815d 100644 --- a/go.mod +++ b/go.mod @@ -51,7 +51,7 @@ require ( github.com/creachadair/taskgroup v0.13.2 github.com/go-pkgz/jrpc v0.2.0 github.com/google/go-cmp v0.6.0 - github.com/vektra/mockery/v2 v2.46.3 + github.com/vektra/mockery/v2 v2.49.1 ) require ( diff --git a/go.sum b/go.sum index 8a0ad753b..94f122f73 100644 --- a/go.sum +++ b/go.sum @@ -812,8 +812,8 @@ github.com/uudashr/gocognit v1.1.3 h1:l+a111VcDbKfynh+airAy/DJQKaXh2m9vkoysMPSZy github.com/uudashr/gocognit v1.1.3/go.mod h1:aKH8/e8xbTRBwjbCkwZ8qt4l2EpKXl31KMHgSS+lZ2U= github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts= github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk= -github.com/vektra/mockery/v2 v2.46.3 h1:Aia4iShZeNTy6CZJcvweK4X97XOzXcqb+k9jm8IqBS0= -github.com/vektra/mockery/v2 v2.46.3/go.mod h1:dDivqi0ShM8A29mLgZn13yZ14MdXlTM4V360u8JDWCQ= +github.com/vektra/mockery/v2 v2.49.1 h1:P33NkpxL5QNsteqdtOAEOJ94kKXaqdsTHeD6GtVuNUc= +github.com/vektra/mockery/v2 v2.49.1/go.mod h1:xO2DeYemEPC2tCzIZ+a1tifZ/7Laf/Chxg3vlc+oDsI= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= diff --git a/internal/consensus/mocks/gossiper.go b/internal/consensus/mocks/gossiper.go index b2f91225a..22a3d374a 100644 --- a/internal/consensus/mocks/gossiper.go +++ b/internal/consensus/mocks/gossiper.go @@ -14,36 +14,224 @@ type Gossiper struct { mock.Mock } +type Gossiper_Expecter struct { + mock *mock.Mock +} + +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) } +// Gossiper_GossipBlockPartsForCatchup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GossipBlockPartsForCatchup' +type Gossiper_GossipBlockPartsForCatchup_Call struct { + *mock.Call +} + +// GossipBlockPartsForCatchup is a helper method to define mock.On call +// - ctx context.Context +// - rs types.RoundState +// - prs *types.PeerRoundState +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)} +} + +func (_c *Gossiper_GossipBlockPartsForCatchup_Call) Run(run func(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState)) *Gossiper_GossipBlockPartsForCatchup_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.RoundState), args[2].(*types.PeerRoundState)) + }) + return _c +} + +func (_c *Gossiper_GossipBlockPartsForCatchup_Call) Return() *Gossiper_GossipBlockPartsForCatchup_Call { + _c.Call.Return() + return _c +} + +func (_c *Gossiper_GossipBlockPartsForCatchup_Call) RunAndReturn(run func(context.Context, types.RoundState, *types.PeerRoundState)) *Gossiper_GossipBlockPartsForCatchup_Call { + _c.Call.Return(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) } +// Gossiper_GossipCommit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GossipCommit' +type Gossiper_GossipCommit_Call struct { + *mock.Call +} + +// GossipCommit is a helper method to define mock.On call +// - ctx context.Context +// - rs types.RoundState +// - prs *types.PeerRoundState +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)} +} + +func (_c *Gossiper_GossipCommit_Call) Run(run func(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState)) *Gossiper_GossipCommit_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.RoundState), args[2].(*types.PeerRoundState)) + }) + return _c +} + +func (_c *Gossiper_GossipCommit_Call) Return() *Gossiper_GossipCommit_Call { + _c.Call.Return() + return _c +} + +func (_c *Gossiper_GossipCommit_Call) RunAndReturn(run func(context.Context, types.RoundState, *types.PeerRoundState)) *Gossiper_GossipCommit_Call { + _c.Call.Return(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) } +// Gossiper_GossipProposal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GossipProposal' +type Gossiper_GossipProposal_Call struct { + *mock.Call +} + +// GossipProposal is a helper method to define mock.On call +// - ctx context.Context +// - rs types.RoundState +// - prs *types.PeerRoundState +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)} +} + +func (_c *Gossiper_GossipProposal_Call) Run(run func(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState)) *Gossiper_GossipProposal_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.RoundState), args[2].(*types.PeerRoundState)) + }) + return _c +} + +func (_c *Gossiper_GossipProposal_Call) Return() *Gossiper_GossipProposal_Call { + _c.Call.Return() + return _c +} + +func (_c *Gossiper_GossipProposal_Call) RunAndReturn(run func(context.Context, types.RoundState, *types.PeerRoundState)) *Gossiper_GossipProposal_Call { + _c.Call.Return(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) } +// Gossiper_GossipProposalBlockParts_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GossipProposalBlockParts' +type Gossiper_GossipProposalBlockParts_Call struct { + *mock.Call +} + +// GossipProposalBlockParts is a helper method to define mock.On call +// - ctx context.Context +// - rs types.RoundState +// - prs *types.PeerRoundState +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)} +} + +func (_c *Gossiper_GossipProposalBlockParts_Call) Run(run func(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState)) *Gossiper_GossipProposalBlockParts_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.RoundState), args[2].(*types.PeerRoundState)) + }) + return _c +} + +func (_c *Gossiper_GossipProposalBlockParts_Call) Return() *Gossiper_GossipProposalBlockParts_Call { + _c.Call.Return() + return _c +} + +func (_c *Gossiper_GossipProposalBlockParts_Call) RunAndReturn(run func(context.Context, types.RoundState, *types.PeerRoundState)) *Gossiper_GossipProposalBlockParts_Call { + _c.Call.Return(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) } +// Gossiper_GossipVote_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GossipVote' +type Gossiper_GossipVote_Call struct { + *mock.Call +} + +// GossipVote is a helper method to define mock.On call +// - ctx context.Context +// - rs types.RoundState +// - prs *types.PeerRoundState +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)} +} + +func (_c *Gossiper_GossipVote_Call) Run(run func(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState)) *Gossiper_GossipVote_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.RoundState), args[2].(*types.PeerRoundState)) + }) + return _c +} + +func (_c *Gossiper_GossipVote_Call) Return() *Gossiper_GossipVote_Call { + _c.Call.Return() + return _c +} + +func (_c *Gossiper_GossipVote_Call) RunAndReturn(run func(context.Context, types.RoundState, *types.PeerRoundState)) *Gossiper_GossipVote_Call { + _c.Call.Return(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) } +// Gossiper_GossipVoteSetMaj23_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GossipVoteSetMaj23' +type Gossiper_GossipVoteSetMaj23_Call struct { + *mock.Call +} + +// GossipVoteSetMaj23 is a helper method to define mock.On call +// - ctx context.Context +// - rs types.RoundState +// - prs *types.PeerRoundState +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)} +} + +func (_c *Gossiper_GossipVoteSetMaj23_Call) Run(run func(ctx context.Context, rs types.RoundState, prs *types.PeerRoundState)) *Gossiper_GossipVoteSetMaj23_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.RoundState), args[2].(*types.PeerRoundState)) + }) + return _c +} + +func (_c *Gossiper_GossipVoteSetMaj23_Call) Return() *Gossiper_GossipVoteSetMaj23_Call { + _c.Call.Return() + return _c +} + +func (_c *Gossiper_GossipVoteSetMaj23_Call) RunAndReturn(run func(context.Context, types.RoundState, *types.PeerRoundState)) *Gossiper_GossipVoteSetMaj23_Call { + _c.Call.Return(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 { diff --git a/internal/consensus/versioned/selectproposer/mocks/proposerselector.go b/internal/consensus/versioned/selectproposer/mocks/proposerselector.go index e2071d276..6daf7600a 100644 --- a/internal/consensus/versioned/selectproposer/mocks/proposerselector.go +++ b/internal/consensus/versioned/selectproposer/mocks/proposerselector.go @@ -13,6 +13,14 @@ type ProposerSelector struct { mock.Mock } +type ProposerSelector_Expecter struct { + mock *mock.Mock +} + +func (_m *ProposerSelector) EXPECT() *ProposerSelector_Expecter { + return &ProposerSelector_Expecter{mock: &_m.Mock} +} + // Copy provides a mock function with given fields: func (_m *ProposerSelector) Copy() selectproposer.ProposerSelector { ret := _m.Called() @@ -33,6 +41,33 @@ func (_m *ProposerSelector) Copy() selectproposer.ProposerSelector { return r0 } +// ProposerSelector_Copy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Copy' +type ProposerSelector_Copy_Call struct { + *mock.Call +} + +// Copy is a helper method to define mock.On call +func (_e *ProposerSelector_Expecter) Copy() *ProposerSelector_Copy_Call { + return &ProposerSelector_Copy_Call{Call: _e.mock.On("Copy")} +} + +func (_c *ProposerSelector_Copy_Call) Run(run func()) *ProposerSelector_Copy_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ProposerSelector_Copy_Call) Return(_a0 selectproposer.ProposerSelector) *ProposerSelector_Copy_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProposerSelector_Copy_Call) RunAndReturn(run func() selectproposer.ProposerSelector) *ProposerSelector_Copy_Call { + _c.Call.Return(run) + 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) @@ -63,6 +98,35 @@ func (_m *ProposerSelector) GetProposer(height int64, round int32) (*types.Valid return r0, r1 } +// ProposerSelector_GetProposer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProposer' +type ProposerSelector_GetProposer_Call struct { + *mock.Call +} + +// GetProposer is a helper method to define mock.On call +// - height int64 +// - round int32 +func (_e *ProposerSelector_Expecter) GetProposer(height interface{}, round interface{}) *ProposerSelector_GetProposer_Call { + return &ProposerSelector_GetProposer_Call{Call: _e.mock.On("GetProposer", height, round)} +} + +func (_c *ProposerSelector_GetProposer_Call) Run(run func(height int64, round int32)) *ProposerSelector_GetProposer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64), args[1].(int32)) + }) + return _c +} + +func (_c *ProposerSelector_GetProposer_Call) Return(_a0 *types.Validator, _a1 error) *ProposerSelector_GetProposer_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *ProposerSelector_GetProposer_Call) RunAndReturn(run func(int64, 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) @@ -83,6 +147,35 @@ func (_m *ProposerSelector) MustGetProposer(height int64, round int32) *types.Va return r0 } +// ProposerSelector_MustGetProposer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MustGetProposer' +type ProposerSelector_MustGetProposer_Call struct { + *mock.Call +} + +// MustGetProposer is a helper method to define mock.On call +// - height int64 +// - round int32 +func (_e *ProposerSelector_Expecter) MustGetProposer(height interface{}, round interface{}) *ProposerSelector_MustGetProposer_Call { + return &ProposerSelector_MustGetProposer_Call{Call: _e.mock.On("MustGetProposer", height, round)} +} + +func (_c *ProposerSelector_MustGetProposer_Call) Run(run func(height int64, round int32)) *ProposerSelector_MustGetProposer_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64), args[1].(int32)) + }) + return _c +} + +func (_c *ProposerSelector_MustGetProposer_Call) Return(_a0 *types.Validator) *ProposerSelector_MustGetProposer_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProposerSelector_MustGetProposer_Call) RunAndReturn(run func(int64, 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) @@ -101,6 +194,35 @@ func (_m *ProposerSelector) UpdateHeightRound(height int64, round int32) error { return r0 } +// ProposerSelector_UpdateHeightRound_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateHeightRound' +type ProposerSelector_UpdateHeightRound_Call struct { + *mock.Call +} + +// UpdateHeightRound is a helper method to define mock.On call +// - height int64 +// - round int32 +func (_e *ProposerSelector_Expecter) UpdateHeightRound(height interface{}, round interface{}) *ProposerSelector_UpdateHeightRound_Call { + return &ProposerSelector_UpdateHeightRound_Call{Call: _e.mock.On("UpdateHeightRound", height, round)} +} + +func (_c *ProposerSelector_UpdateHeightRound_Call) Run(run func(height int64, round int32)) *ProposerSelector_UpdateHeightRound_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64), args[1].(int32)) + }) + return _c +} + +func (_c *ProposerSelector_UpdateHeightRound_Call) Return(_a0 error) *ProposerSelector_UpdateHeightRound_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProposerSelector_UpdateHeightRound_Call) RunAndReturn(run func(int64, int32) error) *ProposerSelector_UpdateHeightRound_Call { + _c.Call.Return(run) + return _c +} + // ValidatorSet provides a mock function with given fields: func (_m *ProposerSelector) ValidatorSet() *types.ValidatorSet { ret := _m.Called() @@ -121,6 +243,33 @@ func (_m *ProposerSelector) ValidatorSet() *types.ValidatorSet { return r0 } +// ProposerSelector_ValidatorSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatorSet' +type ProposerSelector_ValidatorSet_Call struct { + *mock.Call +} + +// ValidatorSet is a helper method to define mock.On call +func (_e *ProposerSelector_Expecter) ValidatorSet() *ProposerSelector_ValidatorSet_Call { + return &ProposerSelector_ValidatorSet_Call{Call: _e.mock.On("ValidatorSet")} +} + +func (_c *ProposerSelector_ValidatorSet_Call) Run(run func()) *ProposerSelector_ValidatorSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ProposerSelector_ValidatorSet_Call) Return(_a0 *types.ValidatorSet) *ProposerSelector_ValidatorSet_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ProposerSelector_ValidatorSet_Call) RunAndReturn(run func() *types.ValidatorSet) *ProposerSelector_ValidatorSet_Call { + _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 { diff --git a/internal/evidence/mocks/blockstore.go b/internal/evidence/mocks/blockstore.go index 0062c4c65..0d34b27b2 100644 --- a/internal/evidence/mocks/blockstore.go +++ b/internal/evidence/mocks/blockstore.go @@ -12,6 +12,14 @@ type BlockStore struct { mock.Mock } +type BlockStore_Expecter struct { + mock *mock.Mock +} + +func (_m *BlockStore) EXPECT() *BlockStore_Expecter { + return &BlockStore_Expecter{mock: &_m.Mock} +} + // Base provides a mock function with given fields: func (_m *BlockStore) Base() int64 { ret := _m.Called() @@ -30,6 +38,33 @@ func (_m *BlockStore) Base() int64 { return r0 } +// BlockStore_Base_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Base' +type BlockStore_Base_Call struct { + *mock.Call +} + +// Base is a helper method to define mock.On call +func (_e *BlockStore_Expecter) Base() *BlockStore_Base_Call { + return &BlockStore_Base_Call{Call: _e.mock.On("Base")} +} + +func (_c *BlockStore_Base_Call) Run(run func()) *BlockStore_Base_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BlockStore_Base_Call) Return(_a0 int64) *BlockStore_Base_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BlockStore_Base_Call) RunAndReturn(run func() int64) *BlockStore_Base_Call { + _c.Call.Return(run) + return _c +} + // Height provides a mock function with given fields: func (_m *BlockStore) Height() int64 { ret := _m.Called() @@ -48,6 +83,33 @@ func (_m *BlockStore) Height() int64 { return r0 } +// BlockStore_Height_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Height' +type BlockStore_Height_Call struct { + *mock.Call +} + +// Height is a helper method to define mock.On call +func (_e *BlockStore_Expecter) Height() *BlockStore_Height_Call { + return &BlockStore_Height_Call{Call: _e.mock.On("Height")} +} + +func (_c *BlockStore_Height_Call) Run(run func()) *BlockStore_Height_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BlockStore_Height_Call) Return(_a0 int64) *BlockStore_Height_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BlockStore_Height_Call) RunAndReturn(run func() int64) *BlockStore_Height_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) @@ -68,6 +130,34 @@ func (_m *BlockStore) LoadBlockCommit(height int64) *types.Commit { return r0 } +// BlockStore_LoadBlockCommit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadBlockCommit' +type BlockStore_LoadBlockCommit_Call struct { + *mock.Call +} + +// LoadBlockCommit is a helper method to define mock.On call +// - height int64 +func (_e *BlockStore_Expecter) LoadBlockCommit(height interface{}) *BlockStore_LoadBlockCommit_Call { + return &BlockStore_LoadBlockCommit_Call{Call: _e.mock.On("LoadBlockCommit", height)} +} + +func (_c *BlockStore_LoadBlockCommit_Call) Run(run func(height int64)) *BlockStore_LoadBlockCommit_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64)) + }) + return _c +} + +func (_c *BlockStore_LoadBlockCommit_Call) Return(_a0 *types.Commit) *BlockStore_LoadBlockCommit_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BlockStore_LoadBlockCommit_Call) RunAndReturn(run func(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) @@ -88,6 +178,34 @@ func (_m *BlockStore) LoadBlockMeta(height int64) *types.BlockMeta { return r0 } +// BlockStore_LoadBlockMeta_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadBlockMeta' +type BlockStore_LoadBlockMeta_Call struct { + *mock.Call +} + +// LoadBlockMeta is a helper method to define mock.On call +// - height int64 +func (_e *BlockStore_Expecter) LoadBlockMeta(height interface{}) *BlockStore_LoadBlockMeta_Call { + return &BlockStore_LoadBlockMeta_Call{Call: _e.mock.On("LoadBlockMeta", height)} +} + +func (_c *BlockStore_LoadBlockMeta_Call) Run(run func(height int64)) *BlockStore_LoadBlockMeta_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64)) + }) + return _c +} + +func (_c *BlockStore_LoadBlockMeta_Call) Return(_a0 *types.BlockMeta) *BlockStore_LoadBlockMeta_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BlockStore_LoadBlockMeta_Call) RunAndReturn(run func(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 { diff --git a/internal/mempool/mocks/mempool.go b/internal/mempool/mocks/mempool.go index 6f4996f40..671bbea63 100644 --- a/internal/mempool/mocks/mempool.go +++ b/internal/mempool/mocks/mempool.go @@ -19,6 +19,14 @@ type Mempool struct { mock.Mock } +type Mempool_Expecter struct { + mock *mock.Mock +} + +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) @@ -37,16 +45,101 @@ func (_m *Mempool) CheckTx(ctx context.Context, tx types.Tx, cb func(*abcitypes. return r0 } +// Mempool_CheckTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckTx' +type Mempool_CheckTx_Call struct { + *mock.Call +} + +// CheckTx is a helper method to define mock.On call +// - ctx context.Context +// - tx types.Tx +// - cb func(*abcitypes.ResponseCheckTx) +// - txInfo mempool.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 { + _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)) + }) + return _c +} + +func (_c *Mempool_CheckTx_Call) Return(_a0 error) *Mempool_CheckTx_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Mempool_CheckTx_Call) RunAndReturn(run func(context.Context, types.Tx, func(*abcitypes.ResponseCheckTx), mempool.TxInfo) error) *Mempool_CheckTx_Call { + _c.Call.Return(run) + return _c +} + // EnableTxsAvailable provides a mock function with given fields: func (_m *Mempool) EnableTxsAvailable() { _m.Called() } +// Mempool_EnableTxsAvailable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnableTxsAvailable' +type Mempool_EnableTxsAvailable_Call struct { + *mock.Call +} + +// EnableTxsAvailable is a helper method to define mock.On call +func (_e *Mempool_Expecter) EnableTxsAvailable() *Mempool_EnableTxsAvailable_Call { + return &Mempool_EnableTxsAvailable_Call{Call: _e.mock.On("EnableTxsAvailable")} +} + +func (_c *Mempool_EnableTxsAvailable_Call) Run(run func()) *Mempool_EnableTxsAvailable_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Mempool_EnableTxsAvailable_Call) Return() *Mempool_EnableTxsAvailable_Call { + _c.Call.Return() + return _c +} + +func (_c *Mempool_EnableTxsAvailable_Call) RunAndReturn(run func()) *Mempool_EnableTxsAvailable_Call { + _c.Call.Return(run) + return _c +} + // Flush provides a mock function with given fields: func (_m *Mempool) Flush() { _m.Called() } +// Mempool_Flush_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Flush' +type Mempool_Flush_Call struct { + *mock.Call +} + +// Flush is a helper method to define mock.On call +func (_e *Mempool_Expecter) Flush() *Mempool_Flush_Call { + return &Mempool_Flush_Call{Call: _e.mock.On("Flush")} +} + +func (_c *Mempool_Flush_Call) Run(run func()) *Mempool_Flush_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Mempool_Flush_Call) Return() *Mempool_Flush_Call { + _c.Call.Return() + return _c +} + +func (_c *Mempool_Flush_Call) RunAndReturn(run func()) *Mempool_Flush_Call { + _c.Call.Return(run) + return _c +} + // FlushAppConn provides a mock function with given fields: _a0 func (_m *Mempool) FlushAppConn(_a0 context.Context) error { ret := _m.Called(_a0) @@ -65,11 +158,66 @@ func (_m *Mempool) FlushAppConn(_a0 context.Context) error { return r0 } +// Mempool_FlushAppConn_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FlushAppConn' +type Mempool_FlushAppConn_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Mempool_FlushAppConn_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Mempool_FlushAppConn_Call) RunAndReturn(run func(context.Context) error) *Mempool_FlushAppConn_Call { + _c.Call.Return(run) + return _c +} + // Lock provides a mock function with given fields: func (_m *Mempool) Lock() { _m.Called() } +// Mempool_Lock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Lock' +type Mempool_Lock_Call struct { + *mock.Call +} + +// Lock is a helper method to define mock.On call +func (_e *Mempool_Expecter) Lock() *Mempool_Lock_Call { + return &Mempool_Lock_Call{Call: _e.mock.On("Lock")} +} + +func (_c *Mempool_Lock_Call) Run(run func()) *Mempool_Lock_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Mempool_Lock_Call) Return() *Mempool_Lock_Call { + _c.Call.Return() + return _c +} + +func (_c *Mempool_Lock_Call) RunAndReturn(run func()) *Mempool_Lock_Call { + _c.Call.Return(run) + 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) @@ -90,6 +238,35 @@ func (_m *Mempool) ReapMaxBytesMaxGas(maxBytes int64, maxGas int64) types.Txs { return r0 } +// Mempool_ReapMaxBytesMaxGas_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReapMaxBytesMaxGas' +type Mempool_ReapMaxBytesMaxGas_Call struct { + *mock.Call +} + +// ReapMaxBytesMaxGas is a helper method to define mock.On call +// - maxBytes int64 +// - maxGas int64 +func (_e *Mempool_Expecter) ReapMaxBytesMaxGas(maxBytes interface{}, maxGas interface{}) *Mempool_ReapMaxBytesMaxGas_Call { + return &Mempool_ReapMaxBytesMaxGas_Call{Call: _e.mock.On("ReapMaxBytesMaxGas", maxBytes, maxGas)} +} + +func (_c *Mempool_ReapMaxBytesMaxGas_Call) Run(run func(maxBytes int64, maxGas int64)) *Mempool_ReapMaxBytesMaxGas_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64), args[1].(int64)) + }) + return _c +} + +func (_c *Mempool_ReapMaxBytesMaxGas_Call) Return(_a0 types.Txs) *Mempool_ReapMaxBytesMaxGas_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Mempool_ReapMaxBytesMaxGas_Call) RunAndReturn(run func(int64, 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) @@ -110,6 +287,34 @@ func (_m *Mempool) ReapMaxTxs(max int) types.Txs { return r0 } +// Mempool_ReapMaxTxs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReapMaxTxs' +type Mempool_ReapMaxTxs_Call struct { + *mock.Call +} + +// ReapMaxTxs is a helper method to define mock.On call +// - max int +func (_e *Mempool_Expecter) ReapMaxTxs(max interface{}) *Mempool_ReapMaxTxs_Call { + return &Mempool_ReapMaxTxs_Call{Call: _e.mock.On("ReapMaxTxs", max)} +} + +func (_c *Mempool_ReapMaxTxs_Call) Run(run func(max int)) *Mempool_ReapMaxTxs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int)) + }) + return _c +} + +func (_c *Mempool_ReapMaxTxs_Call) Return(_a0 types.Txs) *Mempool_ReapMaxTxs_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Mempool_ReapMaxTxs_Call) RunAndReturn(run func(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) @@ -128,6 +333,34 @@ func (_m *Mempool) RemoveTxByKey(txKey types.TxKey) error { return r0 } +// Mempool_RemoveTxByKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveTxByKey' +type Mempool_RemoveTxByKey_Call struct { + *mock.Call +} + +// RemoveTxByKey is a helper method to define mock.On call +// - txKey types.TxKey +func (_e *Mempool_Expecter) RemoveTxByKey(txKey interface{}) *Mempool_RemoveTxByKey_Call { + return &Mempool_RemoveTxByKey_Call{Call: _e.mock.On("RemoveTxByKey", txKey)} +} + +func (_c *Mempool_RemoveTxByKey_Call) Run(run func(txKey types.TxKey)) *Mempool_RemoveTxByKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(types.TxKey)) + }) + return _c +} + +func (_c *Mempool_RemoveTxByKey_Call) Return(_a0 error) *Mempool_RemoveTxByKey_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Mempool_RemoveTxByKey_Call) RunAndReturn(run func(types.TxKey) error) *Mempool_RemoveTxByKey_Call { + _c.Call.Return(run) + return _c +} + // Size provides a mock function with given fields: func (_m *Mempool) Size() int { ret := _m.Called() @@ -146,6 +379,33 @@ func (_m *Mempool) Size() int { return r0 } +// Mempool_Size_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Size' +type Mempool_Size_Call struct { + *mock.Call +} + +// Size is a helper method to define mock.On call +func (_e *Mempool_Expecter) Size() *Mempool_Size_Call { + return &Mempool_Size_Call{Call: _e.mock.On("Size")} +} + +func (_c *Mempool_Size_Call) Run(run func()) *Mempool_Size_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Mempool_Size_Call) Return(_a0 int) *Mempool_Size_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Mempool_Size_Call) RunAndReturn(run func() int) *Mempool_Size_Call { + _c.Call.Return(run) + return _c +} + // SizeBytes provides a mock function with given fields: func (_m *Mempool) SizeBytes() int64 { ret := _m.Called() @@ -164,6 +424,33 @@ func (_m *Mempool) SizeBytes() int64 { return r0 } +// Mempool_SizeBytes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SizeBytes' +type Mempool_SizeBytes_Call struct { + *mock.Call +} + +// SizeBytes is a helper method to define mock.On call +func (_e *Mempool_Expecter) SizeBytes() *Mempool_SizeBytes_Call { + return &Mempool_SizeBytes_Call{Call: _e.mock.On("SizeBytes")} +} + +func (_c *Mempool_SizeBytes_Call) Run(run func()) *Mempool_SizeBytes_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Mempool_SizeBytes_Call) Return(_a0 int64) *Mempool_SizeBytes_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Mempool_SizeBytes_Call) RunAndReturn(run func() int64) *Mempool_SizeBytes_Call { + _c.Call.Return(run) + return _c +} + // TxsAvailable provides a mock function with given fields: func (_m *Mempool) TxsAvailable() <-chan struct{} { ret := _m.Called() @@ -184,11 +471,65 @@ func (_m *Mempool) TxsAvailable() <-chan struct{} { return r0 } +// Mempool_TxsAvailable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TxsAvailable' +type Mempool_TxsAvailable_Call struct { + *mock.Call +} + +// TxsAvailable is a helper method to define mock.On call +func (_e *Mempool_Expecter) TxsAvailable() *Mempool_TxsAvailable_Call { + return &Mempool_TxsAvailable_Call{Call: _e.mock.On("TxsAvailable")} +} + +func (_c *Mempool_TxsAvailable_Call) Run(run func()) *Mempool_TxsAvailable_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Mempool_TxsAvailable_Call) Return(_a0 <-chan struct{}) *Mempool_TxsAvailable_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Mempool_TxsAvailable_Call) RunAndReturn(run func() <-chan struct{}) *Mempool_TxsAvailable_Call { + _c.Call.Return(run) + return _c +} + // Unlock provides a mock function with given fields: func (_m *Mempool) Unlock() { _m.Called() } +// Mempool_Unlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unlock' +type Mempool_Unlock_Call struct { + *mock.Call +} + +// Unlock is a helper method to define mock.On call +func (_e *Mempool_Expecter) Unlock() *Mempool_Unlock_Call { + return &Mempool_Unlock_Call{Call: _e.mock.On("Unlock")} +} + +func (_c *Mempool_Unlock_Call) Run(run func()) *Mempool_Unlock_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Mempool_Unlock_Call) Return() *Mempool_Unlock_Call { + _c.Call.Return() + return _c +} + +func (_c *Mempool_Unlock_Call) RunAndReturn(run func()) *Mempool_Unlock_Call { + _c.Call.Return(run) + 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) @@ -207,6 +548,40 @@ func (_m *Mempool) Update(ctx context.Context, blockHeight int64, blockTxs types return r0 } +// Mempool_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type Mempool_Update_Call struct { + *mock.Call +} + +// 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 +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 { + _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)) + }) + return _c +} + +func (_c *Mempool_Update_Call) Return(_a0 error) *Mempool_Update_Call { + _c.Call.Return(_a0) + 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 { + _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 { diff --git a/internal/p2p/client/mocks/blockclient.go b/internal/p2p/client/mocks/blockclient.go index 5afae1d30..d4b8d0e3b 100644 --- a/internal/p2p/client/mocks/blockclient.go +++ b/internal/p2p/client/mocks/blockclient.go @@ -19,6 +19,14 @@ type BlockClient struct { mock.Mock } +type BlockClient_Expecter struct { + mock *mock.Mock +} + +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) @@ -49,6 +57,36 @@ func (_m *BlockClient) GetBlock(ctx context.Context, height int64, peerID types. return r0, r1 } +// BlockClient_GetBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlock' +type BlockClient_GetBlock_Call struct { + *mock.Call +} + +// GetBlock is a helper method to define mock.On call +// - ctx context.Context +// - height int64 +// - peerID types.NodeID +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)} +} + +func (_c *BlockClient_GetBlock_Call) Run(run func(ctx context.Context, height int64, peerID types.NodeID)) *BlockClient_GetBlock_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(types.NodeID)) + }) + return _c +} + +func (_c *BlockClient_GetBlock_Call) Return(_a0 *promise.Promise[*blocksync.BlockResponse], _a1 error) *BlockClient_GetBlock_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BlockClient_GetBlock_Call) RunAndReturn(run func(context.Context, int64, 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) @@ -67,6 +105,34 @@ func (_m *BlockClient) GetSyncStatus(ctx context.Context) error { return r0 } +// BlockClient_GetSyncStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSyncStatus' +type BlockClient_GetSyncStatus_Call struct { + *mock.Call +} + +// GetSyncStatus is a helper method to define mock.On call +// - ctx context.Context +func (_e *BlockClient_Expecter) GetSyncStatus(ctx interface{}) *BlockClient_GetSyncStatus_Call { + return &BlockClient_GetSyncStatus_Call{Call: _e.mock.On("GetSyncStatus", ctx)} +} + +func (_c *BlockClient_GetSyncStatus_Call) Run(run func(ctx context.Context)) *BlockClient_GetSyncStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *BlockClient_GetSyncStatus_Call) Return(_a0 error) *BlockClient_GetSyncStatus_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BlockClient_GetSyncStatus_Call) RunAndReturn(run func(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) @@ -85,6 +151,35 @@ func (_m *BlockClient) Send(ctx context.Context, msg any) error { return r0 } +// BlockClient_Send_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Send' +type BlockClient_Send_Call struct { + *mock.Call +} + +// Send is a helper method to define mock.On call +// - ctx context.Context +// - msg any +func (_e *BlockClient_Expecter) Send(ctx interface{}, msg interface{}) *BlockClient_Send_Call { + return &BlockClient_Send_Call{Call: _e.mock.On("Send", ctx, msg)} +} + +func (_c *BlockClient_Send_Call) Run(run func(ctx context.Context, msg any)) *BlockClient_Send_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(any)) + }) + return _c +} + +func (_c *BlockClient_Send_Call) Return(_a0 error) *BlockClient_Send_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BlockClient_Send_Call) RunAndReturn(run func(context.Context, 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 { diff --git a/internal/p2p/client/mocks/snapshotclient.go b/internal/p2p/client/mocks/snapshotclient.go index a88f2e269..543143be7 100644 --- a/internal/p2p/client/mocks/snapshotclient.go +++ b/internal/p2p/client/mocks/snapshotclient.go @@ -18,6 +18,14 @@ type SnapshotClient struct { mock.Mock } +type SnapshotClient_Expecter struct { + mock *mock.Mock +} + +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) @@ -48,6 +56,38 @@ func (_m *SnapshotClient) GetChunk(ctx context.Context, peerID types.NodeID, hei return r0, r1 } +// SnapshotClient_GetChunk_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetChunk' +type SnapshotClient_GetChunk_Call struct { + *mock.Call +} + +// GetChunk is a helper method to define mock.On call +// - ctx context.Context +// - peerID types.NodeID +// - height uint64 +// - format uint32 +// - index uint32 +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)} +} + +func (_c *SnapshotClient_GetChunk_Call) Run(run func(ctx context.Context, peerID types.NodeID, height uint64, format uint32, index uint32)) *SnapshotClient_GetChunk_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.NodeID), args[2].(uint64), args[3].(uint32), args[4].(uint32)) + }) + return _c +} + +func (_c *SnapshotClient_GetChunk_Call) Return(_a0 *promise.Promise[*statesync.ChunkResponse], _a1 error) *SnapshotClient_GetChunk_Call { + _c.Call.Return(_a0, _a1) + 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 { + _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) @@ -78,6 +118,36 @@ func (_m *SnapshotClient) GetLightBlock(ctx context.Context, peerID types.NodeID return r0, r1 } +// SnapshotClient_GetLightBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLightBlock' +type SnapshotClient_GetLightBlock_Call struct { + *mock.Call +} + +// GetLightBlock is a helper method to define mock.On call +// - ctx context.Context +// - peerID types.NodeID +// - height uint64 +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)} +} + +func (_c *SnapshotClient_GetLightBlock_Call) Run(run func(ctx context.Context, peerID types.NodeID, height uint64)) *SnapshotClient_GetLightBlock_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.NodeID), args[2].(uint64)) + }) + return _c +} + +func (_c *SnapshotClient_GetLightBlock_Call) Return(_a0 *promise.Promise[*statesync.LightBlockResponse], _a1 error) *SnapshotClient_GetLightBlock_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SnapshotClient_GetLightBlock_Call) RunAndReturn(run func(context.Context, types.NodeID, 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) @@ -108,6 +178,36 @@ func (_m *SnapshotClient) GetParams(ctx context.Context, peerID types.NodeID, he return r0, r1 } +// SnapshotClient_GetParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetParams' +type SnapshotClient_GetParams_Call struct { + *mock.Call +} + +// GetParams is a helper method to define mock.On call +// - ctx context.Context +// - peerID types.NodeID +// - height uint64 +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)} +} + +func (_c *SnapshotClient_GetParams_Call) Run(run func(ctx context.Context, peerID types.NodeID, height uint64)) *SnapshotClient_GetParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.NodeID), args[2].(uint64)) + }) + return _c +} + +func (_c *SnapshotClient_GetParams_Call) Return(_a0 *promise.Promise[*statesync.ParamsResponse], _a1 error) *SnapshotClient_GetParams_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *SnapshotClient_GetParams_Call) RunAndReturn(run func(context.Context, types.NodeID, 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) @@ -126,6 +226,35 @@ func (_m *SnapshotClient) GetSnapshots(ctx context.Context, peerID types.NodeID) return r0 } +// SnapshotClient_GetSnapshots_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSnapshots' +type SnapshotClient_GetSnapshots_Call struct { + *mock.Call +} + +// GetSnapshots is a helper method to define mock.On call +// - ctx context.Context +// - peerID types.NodeID +func (_e *SnapshotClient_Expecter) GetSnapshots(ctx interface{}, peerID interface{}) *SnapshotClient_GetSnapshots_Call { + return &SnapshotClient_GetSnapshots_Call{Call: _e.mock.On("GetSnapshots", ctx, peerID)} +} + +func (_c *SnapshotClient_GetSnapshots_Call) Run(run func(ctx context.Context, peerID types.NodeID)) *SnapshotClient_GetSnapshots_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(types.NodeID)) + }) + return _c +} + +func (_c *SnapshotClient_GetSnapshots_Call) Return(_a0 error) *SnapshotClient_GetSnapshots_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *SnapshotClient_GetSnapshots_Call) RunAndReturn(run func(context.Context, 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 { diff --git a/internal/p2p/mocks/channel.go b/internal/p2p/mocks/channel.go index ae54580e6..9ff79d4f5 100644 --- a/internal/p2p/mocks/channel.go +++ b/internal/p2p/mocks/channel.go @@ -14,6 +14,14 @@ type Channel struct { mock.Mock } +type Channel_Expecter struct { + mock *mock.Mock +} + +func (_m *Channel) EXPECT() *Channel_Expecter { + return &Channel_Expecter{mock: &_m.Mock} +} + // Err provides a mock function with given fields: func (_m *Channel) Err() error { ret := _m.Called() @@ -32,6 +40,33 @@ func (_m *Channel) Err() error { return r0 } +// Channel_Err_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Err' +type Channel_Err_Call struct { + *mock.Call +} + +// Err is a helper method to define mock.On call +func (_e *Channel_Expecter) Err() *Channel_Err_Call { + return &Channel_Err_Call{Call: _e.mock.On("Err")} +} + +func (_c *Channel_Err_Call) Run(run func()) *Channel_Err_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Channel_Err_Call) Return(_a0 error) *Channel_Err_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Channel_Err_Call) RunAndReturn(run func() error) *Channel_Err_Call { + _c.Call.Return(run) + return _c +} + // Receive provides a mock function with given fields: _a0 func (_m *Channel) Receive(_a0 context.Context) p2p.ChannelIterator { ret := _m.Called(_a0) @@ -52,6 +87,34 @@ func (_m *Channel) Receive(_a0 context.Context) p2p.ChannelIterator { return r0 } +// Channel_Receive_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Receive' +type Channel_Receive_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Channel_Receive_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Channel_Receive_Call) RunAndReturn(run func(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) @@ -70,6 +133,35 @@ func (_m *Channel) Send(_a0 context.Context, _a1 p2p.Envelope) error { return r0 } +// Channel_Send_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Send' +type Channel_Send_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Channel_Send_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *Channel_Send_Call) RunAndReturn(run func(context.Context, 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) @@ -88,6 +180,35 @@ func (_m *Channel) SendError(_a0 context.Context, _a1 p2p.PeerError) error { return r0 } +// Channel_SendError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendError' +type Channel_SendError_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Channel_SendError_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *Channel_SendError_Call) RunAndReturn(run func(context.Context, p2p.PeerError) error) *Channel_SendError_Call { + _c.Call.Return(run) + return _c +} + // String provides a mock function with given fields: func (_m *Channel) String() string { ret := _m.Called() @@ -106,6 +227,33 @@ func (_m *Channel) String() string { return r0 } +// Channel_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' +type Channel_String_Call struct { + *mock.Call +} + +// String is a helper method to define mock.On call +func (_e *Channel_Expecter) String() *Channel_String_Call { + return &Channel_String_Call{Call: _e.mock.On("String")} +} + +func (_c *Channel_String_Call) Run(run func()) *Channel_String_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Channel_String_Call) Return(_a0 string) *Channel_String_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Channel_String_Call) RunAndReturn(run func() string) *Channel_String_Call { + _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 { diff --git a/internal/p2p/mocks/connection.go b/internal/p2p/mocks/connection.go index 8555ef9e3..1b0611d4b 100644 --- a/internal/p2p/mocks/connection.go +++ b/internal/p2p/mocks/connection.go @@ -20,6 +20,14 @@ type Connection struct { mock.Mock } +type Connection_Expecter struct { + mock *mock.Mock +} + +func (_m *Connection) EXPECT() *Connection_Expecter { + return &Connection_Expecter{mock: &_m.Mock} +} + // Close provides a mock function with given fields: func (_m *Connection) Close() error { ret := _m.Called() @@ -38,6 +46,33 @@ func (_m *Connection) Close() error { return r0 } +// Connection_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Connection_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Connection_Expecter) Close() *Connection_Close_Call { + return &Connection_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Connection_Close_Call) Run(run func()) *Connection_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Connection_Close_Call) Return(_a0 error) *Connection_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Connection_Close_Call) RunAndReturn(run func() error) *Connection_Close_Call { + _c.Call.Return(run) + 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) @@ -75,6 +110,37 @@ func (_m *Connection) Handshake(_a0 context.Context, _a1 time.Duration, _a2 type return r0, r1, r2 } +// Connection_Handshake_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Handshake' +type Connection_Handshake_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Connection_Handshake_Call) Run(run func(_a0 context.Context, _a1 time.Duration, _a2 types.NodeInfo, _a3 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) + 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 { + _c.Call.Return(run) + return _c +} + // LocalEndpoint provides a mock function with given fields: func (_m *Connection) LocalEndpoint() p2p.Endpoint { ret := _m.Called() @@ -93,6 +159,33 @@ func (_m *Connection) LocalEndpoint() p2p.Endpoint { return r0 } +// Connection_LocalEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LocalEndpoint' +type Connection_LocalEndpoint_Call struct { + *mock.Call +} + +// LocalEndpoint is a helper method to define mock.On call +func (_e *Connection_Expecter) LocalEndpoint() *Connection_LocalEndpoint_Call { + return &Connection_LocalEndpoint_Call{Call: _e.mock.On("LocalEndpoint")} +} + +func (_c *Connection_LocalEndpoint_Call) Run(run func()) *Connection_LocalEndpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Connection_LocalEndpoint_Call) Return(_a0 p2p.Endpoint) *Connection_LocalEndpoint_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Connection_LocalEndpoint_Call) RunAndReturn(run func() p2p.Endpoint) *Connection_LocalEndpoint_Call { + _c.Call.Return(run) + 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) @@ -130,6 +223,34 @@ func (_m *Connection) ReceiveMessage(_a0 context.Context) (p2p.ChannelID, []byte return r0, r1, r2 } +// Connection_ReceiveMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReceiveMessage' +type Connection_ReceiveMessage_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Connection_ReceiveMessage_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Connection_ReceiveMessage_Call) RunAndReturn(run func(context.Context) (p2p.ChannelID, []byte, error)) *Connection_ReceiveMessage_Call { + _c.Call.Return(run) + return _c +} + // RemoteEndpoint provides a mock function with given fields: func (_m *Connection) RemoteEndpoint() p2p.Endpoint { ret := _m.Called() @@ -148,6 +269,33 @@ func (_m *Connection) RemoteEndpoint() p2p.Endpoint { return r0 } +// Connection_RemoteEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoteEndpoint' +type Connection_RemoteEndpoint_Call struct { + *mock.Call +} + +// RemoteEndpoint is a helper method to define mock.On call +func (_e *Connection_Expecter) RemoteEndpoint() *Connection_RemoteEndpoint_Call { + return &Connection_RemoteEndpoint_Call{Call: _e.mock.On("RemoteEndpoint")} +} + +func (_c *Connection_RemoteEndpoint_Call) Run(run func()) *Connection_RemoteEndpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Connection_RemoteEndpoint_Call) Return(_a0 p2p.Endpoint) *Connection_RemoteEndpoint_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Connection_RemoteEndpoint_Call) RunAndReturn(run func() p2p.Endpoint) *Connection_RemoteEndpoint_Call { + _c.Call.Return(run) + 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) @@ -166,6 +314,36 @@ func (_m *Connection) SendMessage(_a0 context.Context, _a1 p2p.ChannelID, _a2 [] return r0 } +// Connection_SendMessage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendMessage' +type Connection_SendMessage_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Connection_SendMessage_Call) Run(run func(_a0 context.Context, _a1 p2p.ChannelID, _a2 []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) + return _c +} + +func (_c *Connection_SendMessage_Call) RunAndReturn(run func(context.Context, p2p.ChannelID, []byte) error) *Connection_SendMessage_Call { + _c.Call.Return(run) + return _c +} + // String provides a mock function with given fields: func (_m *Connection) String() string { ret := _m.Called() @@ -184,6 +362,33 @@ func (_m *Connection) String() string { return r0 } +// Connection_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' +type Connection_String_Call struct { + *mock.Call +} + +// String is a helper method to define mock.On call +func (_e *Connection_Expecter) String() *Connection_String_Call { + return &Connection_String_Call{Call: _e.mock.On("String")} +} + +func (_c *Connection_String_Call) Run(run func()) *Connection_String_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Connection_String_Call) Return(_a0 string) *Connection_String_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Connection_String_Call) RunAndReturn(run func() string) *Connection_String_Call { + _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 { diff --git a/internal/p2p/mocks/transport.go b/internal/p2p/mocks/transport.go index 5ffc747d2..90cc99b41 100644 --- a/internal/p2p/mocks/transport.go +++ b/internal/p2p/mocks/transport.go @@ -14,6 +14,14 @@ type Transport struct { mock.Mock } +type Transport_Expecter struct { + mock *mock.Mock +} + +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) @@ -44,11 +52,67 @@ func (_m *Transport) Accept(_a0 context.Context) (p2p.Connection, error) { return r0, r1 } +// Transport_Accept_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Accept' +type Transport_Accept_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Transport_Accept_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Transport_Accept_Call) RunAndReturn(run func(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) } +// Transport_AddChannelDescriptors_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddChannelDescriptors' +type Transport_AddChannelDescriptors_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Transport_AddChannelDescriptors_Call) Run(run func(_a0 []*p2p.ChannelDescriptor)) *Transport_AddChannelDescriptors_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]*p2p.ChannelDescriptor)) + }) + return _c +} + +func (_c *Transport_AddChannelDescriptors_Call) Return() *Transport_AddChannelDescriptors_Call { + _c.Call.Return() + return _c +} + +func (_c *Transport_AddChannelDescriptors_Call) RunAndReturn(run func([]*p2p.ChannelDescriptor)) *Transport_AddChannelDescriptors_Call { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *Transport) Close() error { ret := _m.Called() @@ -67,6 +131,33 @@ func (_m *Transport) Close() error { return r0 } +// Transport_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Transport_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Transport_Expecter) Close() *Transport_Close_Call { + return &Transport_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Transport_Close_Call) Run(run func()) *Transport_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transport_Close_Call) Return(_a0 error) *Transport_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transport_Close_Call) RunAndReturn(run func() error) *Transport_Close_Call { + _c.Call.Return(run) + 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) @@ -97,6 +188,35 @@ func (_m *Transport) Dial(_a0 context.Context, _a1 *p2p.Endpoint) (p2p.Connectio return r0, r1 } +// Transport_Dial_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Dial' +type Transport_Dial_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Transport_Dial_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *Transport_Dial_Call) RunAndReturn(run func(context.Context, *p2p.Endpoint) (p2p.Connection, error)) *Transport_Dial_Call { + _c.Call.Return(run) + return _c +} + // Endpoint provides a mock function with given fields: func (_m *Transport) Endpoint() (*p2p.Endpoint, error) { ret := _m.Called() @@ -127,6 +247,33 @@ func (_m *Transport) Endpoint() (*p2p.Endpoint, error) { return r0, r1 } +// Transport_Endpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Endpoint' +type Transport_Endpoint_Call struct { + *mock.Call +} + +// Endpoint is a helper method to define mock.On call +func (_e *Transport_Expecter) Endpoint() *Transport_Endpoint_Call { + return &Transport_Endpoint_Call{Call: _e.mock.On("Endpoint")} +} + +func (_c *Transport_Endpoint_Call) Run(run func()) *Transport_Endpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transport_Endpoint_Call) Return(_a0 *p2p.Endpoint, _a1 error) *Transport_Endpoint_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Transport_Endpoint_Call) RunAndReturn(run func() (*p2p.Endpoint, error)) *Transport_Endpoint_Call { + _c.Call.Return(run) + return _c +} + // Listen provides a mock function with given fields: _a0 func (_m *Transport) Listen(_a0 *p2p.Endpoint) error { ret := _m.Called(_a0) @@ -145,6 +292,34 @@ func (_m *Transport) Listen(_a0 *p2p.Endpoint) error { return r0 } +// Transport_Listen_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Listen' +type Transport_Listen_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Transport_Listen_Call) Run(run func(_a0 *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) + return _c +} + +func (_c *Transport_Listen_Call) RunAndReturn(run func(*p2p.Endpoint) error) *Transport_Listen_Call { + _c.Call.Return(run) + return _c +} + // Protocols provides a mock function with given fields: func (_m *Transport) Protocols() []p2p.Protocol { ret := _m.Called() @@ -165,6 +340,33 @@ func (_m *Transport) Protocols() []p2p.Protocol { return r0 } +// Transport_Protocols_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Protocols' +type Transport_Protocols_Call struct { + *mock.Call +} + +// Protocols is a helper method to define mock.On call +func (_e *Transport_Expecter) Protocols() *Transport_Protocols_Call { + return &Transport_Protocols_Call{Call: _e.mock.On("Protocols")} +} + +func (_c *Transport_Protocols_Call) Run(run func()) *Transport_Protocols_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transport_Protocols_Call) Return(_a0 []p2p.Protocol) *Transport_Protocols_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transport_Protocols_Call) RunAndReturn(run func() []p2p.Protocol) *Transport_Protocols_Call { + _c.Call.Return(run) + return _c +} + // String provides a mock function with given fields: func (_m *Transport) String() string { ret := _m.Called() @@ -183,6 +385,33 @@ func (_m *Transport) String() string { return r0 } +// Transport_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String' +type Transport_String_Call struct { + *mock.Call +} + +// String is a helper method to define mock.On call +func (_e *Transport_Expecter) String() *Transport_String_Call { + return &Transport_String_Call{Call: _e.mock.On("String")} +} + +func (_c *Transport_String_Call) Run(run func()) *Transport_String_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Transport_String_Call) Return(_a0 string) *Transport_String_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Transport_String_Call) RunAndReturn(run func() string) *Transport_String_Call { + _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 { diff --git a/internal/state/indexer/mocks/eventsink.go b/internal/state/indexer/mocks/eventsink.go index 8288781bc..a40a3729d 100644 --- a/internal/state/indexer/mocks/eventsink.go +++ b/internal/state/indexer/mocks/eventsink.go @@ -20,6 +20,14 @@ type EventSink struct { mock.Mock } +type EventSink_Expecter struct { + mock *mock.Mock +} + +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) @@ -50,6 +58,34 @@ func (_m *EventSink) GetTxByHash(_a0 []byte) (*types.TxResult, error) { return r0, r1 } +// EventSink_GetTxByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTxByHash' +type EventSink_GetTxByHash_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *EventSink_GetTxByHash_Call) Run(run func(_a0 []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) + return _c +} + +func (_c *EventSink_GetTxByHash_Call) RunAndReturn(run func([]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) @@ -78,6 +114,34 @@ func (_m *EventSink) HasBlock(_a0 int64) (bool, error) { return r0, r1 } +// EventSink_HasBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasBlock' +type EventSink_HasBlock_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *EventSink_HasBlock_Call) Run(run func(_a0 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) + return _c +} + +func (_c *EventSink_HasBlock_Call) RunAndReturn(run func(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) @@ -96,6 +160,34 @@ func (_m *EventSink) IndexBlockEvents(_a0 tenderdashtypes.EventDataNewBlockHeade return r0 } +// EventSink_IndexBlockEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IndexBlockEvents' +type EventSink_IndexBlockEvents_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *EventSink_IndexBlockEvents_Call) Run(run func(_a0 tenderdashtypes.EventDataNewBlockHeader)) *EventSink_IndexBlockEvents_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(tenderdashtypes.EventDataNewBlockHeader)) + }) + return _c +} + +func (_c *EventSink_IndexBlockEvents_Call) Return(_a0 error) *EventSink_IndexBlockEvents_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EventSink_IndexBlockEvents_Call) RunAndReturn(run func(tenderdashtypes.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) @@ -114,6 +206,34 @@ func (_m *EventSink) IndexTxEvents(_a0 []*types.TxResult) error { return r0 } +// EventSink_IndexTxEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IndexTxEvents' +type EventSink_IndexTxEvents_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *EventSink_IndexTxEvents_Call) Run(run func(_a0 []*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) + return _c +} + +func (_c *EventSink_IndexTxEvents_Call) RunAndReturn(run func([]*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) @@ -144,6 +264,35 @@ func (_m *EventSink) SearchBlockEvents(_a0 context.Context, _a1 *query.Query) ([ return r0, r1 } +// EventSink_SearchBlockEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SearchBlockEvents' +type EventSink_SearchBlockEvents_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *EventSink_SearchBlockEvents_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *EventSink_SearchBlockEvents_Call) RunAndReturn(run func(context.Context, *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) @@ -174,6 +323,35 @@ func (_m *EventSink) SearchTxEvents(_a0 context.Context, _a1 *query.Query) ([]*t return r0, r1 } +// EventSink_SearchTxEvents_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SearchTxEvents' +type EventSink_SearchTxEvents_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *EventSink_SearchTxEvents_Call) Run(run func(_a0 context.Context, _a1 *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) + return _c +} + +func (_c *EventSink_SearchTxEvents_Call) RunAndReturn(run func(context.Context, *query.Query) ([]*types.TxResult, error)) *EventSink_SearchTxEvents_Call { + _c.Call.Return(run) + return _c +} + // Stop provides a mock function with given fields: func (_m *EventSink) Stop() error { ret := _m.Called() @@ -192,6 +370,33 @@ func (_m *EventSink) Stop() error { return r0 } +// EventSink_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop' +type EventSink_Stop_Call struct { + *mock.Call +} + +// Stop is a helper method to define mock.On call +func (_e *EventSink_Expecter) Stop() *EventSink_Stop_Call { + return &EventSink_Stop_Call{Call: _e.mock.On("Stop")} +} + +func (_c *EventSink_Stop_Call) Run(run func()) *EventSink_Stop_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EventSink_Stop_Call) Return(_a0 error) *EventSink_Stop_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EventSink_Stop_Call) RunAndReturn(run func() error) *EventSink_Stop_Call { + _c.Call.Return(run) + return _c +} + // Type provides a mock function with given fields: func (_m *EventSink) Type() indexer.EventSinkType { ret := _m.Called() @@ -210,6 +415,33 @@ func (_m *EventSink) Type() indexer.EventSinkType { return r0 } +// EventSink_Type_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Type' +type EventSink_Type_Call struct { + *mock.Call +} + +// Type is a helper method to define mock.On call +func (_e *EventSink_Expecter) Type() *EventSink_Type_Call { + return &EventSink_Type_Call{Call: _e.mock.On("Type")} +} + +func (_c *EventSink_Type_Call) Run(run func()) *EventSink_Type_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *EventSink_Type_Call) Return(_a0 indexer.EventSinkType) *EventSink_Type_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *EventSink_Type_Call) RunAndReturn(run func() indexer.EventSinkType) *EventSink_Type_Call { + _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 { diff --git a/internal/state/mocks/blockstore.go b/internal/state/mocks/blockstore.go index 63873d194..dc3b8e9e0 100644 --- a/internal/state/mocks/blockstore.go +++ b/internal/state/mocks/blockstore.go @@ -13,6 +13,14 @@ type BlockStore struct { mock.Mock } +type BlockStore_Expecter struct { + mock *mock.Mock +} + +func (_m *BlockStore) EXPECT() *BlockStore_Expecter { + return &BlockStore_Expecter{mock: &_m.Mock} +} + // Base provides a mock function with given fields: func (_m *BlockStore) Base() int64 { ret := _m.Called() @@ -31,6 +39,33 @@ func (_m *BlockStore) Base() int64 { return r0 } +// BlockStore_Base_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Base' +type BlockStore_Base_Call struct { + *mock.Call +} + +// Base is a helper method to define mock.On call +func (_e *BlockStore_Expecter) Base() *BlockStore_Base_Call { + return &BlockStore_Base_Call{Call: _e.mock.On("Base")} +} + +func (_c *BlockStore_Base_Call) Run(run func()) *BlockStore_Base_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BlockStore_Base_Call) Return(_a0 int64) *BlockStore_Base_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BlockStore_Base_Call) RunAndReturn(run func() int64) *BlockStore_Base_Call { + _c.Call.Return(run) + return _c +} + // CoreChainLockedHeight provides a mock function with given fields: func (_m *BlockStore) CoreChainLockedHeight() uint32 { ret := _m.Called() @@ -49,6 +84,33 @@ func (_m *BlockStore) CoreChainLockedHeight() uint32 { return r0 } +// BlockStore_CoreChainLockedHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CoreChainLockedHeight' +type BlockStore_CoreChainLockedHeight_Call struct { + *mock.Call +} + +// CoreChainLockedHeight is a helper method to define mock.On call +func (_e *BlockStore_Expecter) CoreChainLockedHeight() *BlockStore_CoreChainLockedHeight_Call { + return &BlockStore_CoreChainLockedHeight_Call{Call: _e.mock.On("CoreChainLockedHeight")} +} + +func (_c *BlockStore_CoreChainLockedHeight_Call) Run(run func()) *BlockStore_CoreChainLockedHeight_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BlockStore_CoreChainLockedHeight_Call) Return(_a0 uint32) *BlockStore_CoreChainLockedHeight_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BlockStore_CoreChainLockedHeight_Call) RunAndReturn(run func() uint32) *BlockStore_CoreChainLockedHeight_Call { + _c.Call.Return(run) + return _c +} + // Height provides a mock function with given fields: func (_m *BlockStore) Height() int64 { ret := _m.Called() @@ -67,6 +129,33 @@ func (_m *BlockStore) Height() int64 { return r0 } +// BlockStore_Height_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Height' +type BlockStore_Height_Call struct { + *mock.Call +} + +// Height is a helper method to define mock.On call +func (_e *BlockStore_Expecter) Height() *BlockStore_Height_Call { + return &BlockStore_Height_Call{Call: _e.mock.On("Height")} +} + +func (_c *BlockStore_Height_Call) Run(run func()) *BlockStore_Height_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BlockStore_Height_Call) Return(_a0 int64) *BlockStore_Height_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BlockStore_Height_Call) RunAndReturn(run func() int64) *BlockStore_Height_Call { + _c.Call.Return(run) + return _c +} + // LoadBaseMeta provides a mock function with given fields: func (_m *BlockStore) LoadBaseMeta() *types.BlockMeta { ret := _m.Called() @@ -87,6 +176,33 @@ func (_m *BlockStore) LoadBaseMeta() *types.BlockMeta { return r0 } +// BlockStore_LoadBaseMeta_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadBaseMeta' +type BlockStore_LoadBaseMeta_Call struct { + *mock.Call +} + +// LoadBaseMeta is a helper method to define mock.On call +func (_e *BlockStore_Expecter) LoadBaseMeta() *BlockStore_LoadBaseMeta_Call { + return &BlockStore_LoadBaseMeta_Call{Call: _e.mock.On("LoadBaseMeta")} +} + +func (_c *BlockStore_LoadBaseMeta_Call) Run(run func()) *BlockStore_LoadBaseMeta_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BlockStore_LoadBaseMeta_Call) Return(_a0 *types.BlockMeta) *BlockStore_LoadBaseMeta_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BlockStore_LoadBaseMeta_Call) RunAndReturn(run func() *types.BlockMeta) *BlockStore_LoadBaseMeta_Call { + _c.Call.Return(run) + return _c +} + // LoadBlock provides a mock function with given fields: height func (_m *BlockStore) LoadBlock(height int64) *types.Block { ret := _m.Called(height) @@ -107,6 +223,34 @@ func (_m *BlockStore) LoadBlock(height int64) *types.Block { return r0 } +// BlockStore_LoadBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadBlock' +type BlockStore_LoadBlock_Call struct { + *mock.Call +} + +// LoadBlock is a helper method to define mock.On call +// - height int64 +func (_e *BlockStore_Expecter) LoadBlock(height interface{}) *BlockStore_LoadBlock_Call { + return &BlockStore_LoadBlock_Call{Call: _e.mock.On("LoadBlock", height)} +} + +func (_c *BlockStore_LoadBlock_Call) Run(run func(height int64)) *BlockStore_LoadBlock_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64)) + }) + return _c +} + +func (_c *BlockStore_LoadBlock_Call) Return(_a0 *types.Block) *BlockStore_LoadBlock_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BlockStore_LoadBlock_Call) RunAndReturn(run func(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) @@ -127,6 +271,34 @@ func (_m *BlockStore) LoadBlockByHash(hash []byte) *types.Block { return r0 } +// BlockStore_LoadBlockByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadBlockByHash' +type BlockStore_LoadBlockByHash_Call struct { + *mock.Call +} + +// LoadBlockByHash is a helper method to define mock.On call +// - hash []byte +func (_e *BlockStore_Expecter) LoadBlockByHash(hash interface{}) *BlockStore_LoadBlockByHash_Call { + return &BlockStore_LoadBlockByHash_Call{Call: _e.mock.On("LoadBlockByHash", hash)} +} + +func (_c *BlockStore_LoadBlockByHash_Call) Run(run func(hash []byte)) *BlockStore_LoadBlockByHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte)) + }) + return _c +} + +func (_c *BlockStore_LoadBlockByHash_Call) Return(_a0 *types.Block) *BlockStore_LoadBlockByHash_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BlockStore_LoadBlockByHash_Call) RunAndReturn(run func([]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) @@ -147,6 +319,34 @@ func (_m *BlockStore) LoadBlockCommit(height int64) *types.Commit { return r0 } +// BlockStore_LoadBlockCommit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadBlockCommit' +type BlockStore_LoadBlockCommit_Call struct { + *mock.Call +} + +// LoadBlockCommit is a helper method to define mock.On call +// - height int64 +func (_e *BlockStore_Expecter) LoadBlockCommit(height interface{}) *BlockStore_LoadBlockCommit_Call { + return &BlockStore_LoadBlockCommit_Call{Call: _e.mock.On("LoadBlockCommit", height)} +} + +func (_c *BlockStore_LoadBlockCommit_Call) Run(run func(height int64)) *BlockStore_LoadBlockCommit_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64)) + }) + return _c +} + +func (_c *BlockStore_LoadBlockCommit_Call) Return(_a0 *types.Commit) *BlockStore_LoadBlockCommit_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BlockStore_LoadBlockCommit_Call) RunAndReturn(run func(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) @@ -167,6 +367,34 @@ func (_m *BlockStore) LoadBlockMeta(height int64) *types.BlockMeta { return r0 } +// BlockStore_LoadBlockMeta_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadBlockMeta' +type BlockStore_LoadBlockMeta_Call struct { + *mock.Call +} + +// LoadBlockMeta is a helper method to define mock.On call +// - height int64 +func (_e *BlockStore_Expecter) LoadBlockMeta(height interface{}) *BlockStore_LoadBlockMeta_Call { + return &BlockStore_LoadBlockMeta_Call{Call: _e.mock.On("LoadBlockMeta", height)} +} + +func (_c *BlockStore_LoadBlockMeta_Call) Run(run func(height int64)) *BlockStore_LoadBlockMeta_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64)) + }) + return _c +} + +func (_c *BlockStore_LoadBlockMeta_Call) Return(_a0 *types.BlockMeta) *BlockStore_LoadBlockMeta_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BlockStore_LoadBlockMeta_Call) RunAndReturn(run func(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) @@ -187,6 +415,34 @@ func (_m *BlockStore) LoadBlockMetaByHash(hash []byte) *types.BlockMeta { return r0 } +// BlockStore_LoadBlockMetaByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadBlockMetaByHash' +type BlockStore_LoadBlockMetaByHash_Call struct { + *mock.Call +} + +// LoadBlockMetaByHash is a helper method to define mock.On call +// - hash []byte +func (_e *BlockStore_Expecter) LoadBlockMetaByHash(hash interface{}) *BlockStore_LoadBlockMetaByHash_Call { + return &BlockStore_LoadBlockMetaByHash_Call{Call: _e.mock.On("LoadBlockMetaByHash", hash)} +} + +func (_c *BlockStore_LoadBlockMetaByHash_Call) Run(run func(hash []byte)) *BlockStore_LoadBlockMetaByHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].([]byte)) + }) + return _c +} + +func (_c *BlockStore_LoadBlockMetaByHash_Call) Return(_a0 *types.BlockMeta) *BlockStore_LoadBlockMetaByHash_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BlockStore_LoadBlockMetaByHash_Call) RunAndReturn(run func([]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) @@ -207,6 +463,35 @@ func (_m *BlockStore) LoadBlockPart(height int64, index int) *types.Part { return r0 } +// BlockStore_LoadBlockPart_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadBlockPart' +type BlockStore_LoadBlockPart_Call struct { + *mock.Call +} + +// LoadBlockPart is a helper method to define mock.On call +// - height int64 +// - index int +func (_e *BlockStore_Expecter) LoadBlockPart(height interface{}, index interface{}) *BlockStore_LoadBlockPart_Call { + return &BlockStore_LoadBlockPart_Call{Call: _e.mock.On("LoadBlockPart", height, index)} +} + +func (_c *BlockStore_LoadBlockPart_Call) Run(run func(height int64, index int)) *BlockStore_LoadBlockPart_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64), args[1].(int)) + }) + return _c +} + +func (_c *BlockStore_LoadBlockPart_Call) Return(_a0 *types.Part) *BlockStore_LoadBlockPart_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BlockStore_LoadBlockPart_Call) RunAndReturn(run func(int64, int) *types.Part) *BlockStore_LoadBlockPart_Call { + _c.Call.Return(run) + return _c +} + // LoadSeenCommit provides a mock function with given fields: func (_m *BlockStore) LoadSeenCommit() *types.Commit { ret := _m.Called() @@ -227,6 +512,33 @@ func (_m *BlockStore) LoadSeenCommit() *types.Commit { return r0 } +// BlockStore_LoadSeenCommit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadSeenCommit' +type BlockStore_LoadSeenCommit_Call struct { + *mock.Call +} + +// LoadSeenCommit is a helper method to define mock.On call +func (_e *BlockStore_Expecter) LoadSeenCommit() *BlockStore_LoadSeenCommit_Call { + return &BlockStore_LoadSeenCommit_Call{Call: _e.mock.On("LoadSeenCommit")} +} + +func (_c *BlockStore_LoadSeenCommit_Call) Run(run func()) *BlockStore_LoadSeenCommit_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BlockStore_LoadSeenCommit_Call) Return(_a0 *types.Commit) *BlockStore_LoadSeenCommit_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BlockStore_LoadSeenCommit_Call) RunAndReturn(run func() *types.Commit) *BlockStore_LoadSeenCommit_Call { + _c.Call.Return(run) + return _c +} + // LoadSeenCommitAt provides a mock function with given fields: height func (_m *BlockStore) LoadSeenCommitAt(height int64) *types.Commit { ret := _m.Called(height) @@ -247,6 +559,34 @@ func (_m *BlockStore) LoadSeenCommitAt(height int64) *types.Commit { return r0 } +// BlockStore_LoadSeenCommitAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadSeenCommitAt' +type BlockStore_LoadSeenCommitAt_Call struct { + *mock.Call +} + +// LoadSeenCommitAt is a helper method to define mock.On call +// - height int64 +func (_e *BlockStore_Expecter) LoadSeenCommitAt(height interface{}) *BlockStore_LoadSeenCommitAt_Call { + return &BlockStore_LoadSeenCommitAt_Call{Call: _e.mock.On("LoadSeenCommitAt", height)} +} + +func (_c *BlockStore_LoadSeenCommitAt_Call) Run(run func(height int64)) *BlockStore_LoadSeenCommitAt_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64)) + }) + return _c +} + +func (_c *BlockStore_LoadSeenCommitAt_Call) Return(_a0 *types.Commit) *BlockStore_LoadSeenCommitAt_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BlockStore_LoadSeenCommitAt_Call) RunAndReturn(run func(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) @@ -275,11 +615,69 @@ func (_m *BlockStore) PruneBlocks(height int64) (uint64, error) { return r0, r1 } +// BlockStore_PruneBlocks_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PruneBlocks' +type BlockStore_PruneBlocks_Call struct { + *mock.Call +} + +// PruneBlocks is a helper method to define mock.On call +// - height int64 +func (_e *BlockStore_Expecter) PruneBlocks(height interface{}) *BlockStore_PruneBlocks_Call { + return &BlockStore_PruneBlocks_Call{Call: _e.mock.On("PruneBlocks", height)} +} + +func (_c *BlockStore_PruneBlocks_Call) Run(run func(height int64)) *BlockStore_PruneBlocks_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64)) + }) + return _c +} + +func (_c *BlockStore_PruneBlocks_Call) Return(_a0 uint64, _a1 error) *BlockStore_PruneBlocks_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *BlockStore_PruneBlocks_Call) RunAndReturn(run func(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) } +// BlockStore_SaveBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveBlock' +type BlockStore_SaveBlock_Call struct { + *mock.Call +} + +// SaveBlock is a helper method to define mock.On call +// - block *types.Block +// - blockParts *types.PartSet +// - seenCommit *types.Commit +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)} +} + +func (_c *BlockStore_SaveBlock_Call) Run(run func(block *types.Block, blockParts *types.PartSet, seenCommit *types.Commit)) *BlockStore_SaveBlock_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(*types.Block), args[1].(*types.PartSet), args[2].(*types.Commit)) + }) + return _c +} + +func (_c *BlockStore_SaveBlock_Call) Return() *BlockStore_SaveBlock_Call { + _c.Call.Return() + return _c +} + +func (_c *BlockStore_SaveBlock_Call) RunAndReturn(run func(*types.Block, *types.PartSet, *types.Commit)) *BlockStore_SaveBlock_Call { + _c.Call.Return(run) + return _c +} + // Size provides a mock function with given fields: func (_m *BlockStore) Size() int64 { ret := _m.Called() @@ -298,6 +696,33 @@ func (_m *BlockStore) Size() int64 { return r0 } +// BlockStore_Size_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Size' +type BlockStore_Size_Call struct { + *mock.Call +} + +// Size is a helper method to define mock.On call +func (_e *BlockStore_Expecter) Size() *BlockStore_Size_Call { + return &BlockStore_Size_Call{Call: _e.mock.On("Size")} +} + +func (_c *BlockStore_Size_Call) Run(run func()) *BlockStore_Size_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *BlockStore_Size_Call) Return(_a0 int64) *BlockStore_Size_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *BlockStore_Size_Call) RunAndReturn(run func() int64) *BlockStore_Size_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 { diff --git a/internal/state/mocks/evidencepool.go b/internal/state/mocks/evidencepool.go index ff16885fb..3b2f161f3 100644 --- a/internal/state/mocks/evidencepool.go +++ b/internal/state/mocks/evidencepool.go @@ -16,6 +16,14 @@ type EvidencePool struct { mock.Mock } +type EvidencePool_Expecter struct { + mock *mock.Mock +} + +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) @@ -34,6 +42,35 @@ func (_m *EvidencePool) AddEvidence(_a0 context.Context, _a1 types.Evidence) err return r0 } +// EvidencePool_AddEvidence_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddEvidence' +type EvidencePool_AddEvidence_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *EvidencePool_AddEvidence_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *EvidencePool_AddEvidence_Call) RunAndReturn(run func(context.Context, 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) @@ -52,6 +89,35 @@ func (_m *EvidencePool) CheckEvidence(_a0 context.Context, _a1 types.EvidenceLis return r0 } +// EvidencePool_CheckEvidence_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckEvidence' +type EvidencePool_CheckEvidence_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *EvidencePool_CheckEvidence_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *EvidencePool_CheckEvidence_Call) RunAndReturn(run func(context.Context, 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) @@ -82,11 +148,69 @@ func (_m *EvidencePool) PendingEvidence(maxBytes int64) ([]types.Evidence, int64 return r0, r1 } +// EvidencePool_PendingEvidence_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PendingEvidence' +type EvidencePool_PendingEvidence_Call struct { + *mock.Call +} + +// PendingEvidence is a helper method to define mock.On call +// - maxBytes int64 +func (_e *EvidencePool_Expecter) PendingEvidence(maxBytes interface{}) *EvidencePool_PendingEvidence_Call { + return &EvidencePool_PendingEvidence_Call{Call: _e.mock.On("PendingEvidence", maxBytes)} +} + +func (_c *EvidencePool_PendingEvidence_Call) Run(run func(maxBytes int64)) *EvidencePool_PendingEvidence_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64)) + }) + return _c +} + +func (_c *EvidencePool_PendingEvidence_Call) Return(ev []types.Evidence, size int64) *EvidencePool_PendingEvidence_Call { + _c.Call.Return(ev, size) + return _c +} + +func (_c *EvidencePool_PendingEvidence_Call) RunAndReturn(run func(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) } +// EvidencePool_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type EvidencePool_Update_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *EvidencePool_Update_Call) Run(run func(_a0 context.Context, _a1 state.State, _a2 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)) + }) + return _c +} + +func (_c *EvidencePool_Update_Call) Return() *EvidencePool_Update_Call { + _c.Call.Return() + return _c +} + +func (_c *EvidencePool_Update_Call) RunAndReturn(run func(context.Context, state.State, types.EvidenceList)) *EvidencePool_Update_Call { + _c.Call.Return(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 { diff --git a/internal/state/mocks/executor.go b/internal/state/mocks/executor.go index e287c60cc..23a56e2b5 100644 --- a/internal/state/mocks/executor.go +++ b/internal/state/mocks/executor.go @@ -16,6 +16,14 @@ type Executor struct { mock.Mock } +type Executor_Expecter struct { + mock *mock.Mock +} + +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) @@ -44,6 +52,38 @@ func (_m *Executor) ApplyBlock(ctx context.Context, _a1 state.State, blockID typ return r0, r1 } +// Executor_ApplyBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyBlock' +type Executor_ApplyBlock_Call struct { + *mock.Call +} + +// 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)} +} + +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 { + _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) + 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 { + _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) @@ -81,11 +121,74 @@ func (_m *Executor) CreateProposalBlock(ctx context.Context, height int64, round return r0, r1, r2 } +// Executor_CreateProposalBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateProposalBlock' +type Executor_CreateProposalBlock_Call struct { + *mock.Call +} + +// 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 { + _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) + 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 { + _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) } +// Executor_ExtendVote_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExtendVote' +type Executor_ExtendVote_Call struct { + *mock.Call +} + +// ExtendVote is a helper method to define mock.On call +// - ctx context.Context +// - vote *types.Vote +func (_e *Executor_Expecter) ExtendVote(ctx interface{}, vote interface{}) *Executor_ExtendVote_Call { + return &Executor_ExtendVote_Call{Call: _e.mock.On("ExtendVote", ctx, vote)} +} + +func (_c *Executor_ExtendVote_Call) Run(run func(ctx context.Context, vote *types.Vote)) *Executor_ExtendVote_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*types.Vote)) + }) + return _c +} + +func (_c *Executor_ExtendVote_Call) Return() *Executor_ExtendVote_Call { + _c.Call.Return() + return _c +} + +func (_c *Executor_ExtendVote_Call) RunAndReturn(run func(context.Context, *types.Vote)) *Executor_ExtendVote_Call { + _c.Call.Return(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) @@ -114,6 +217,39 @@ func (_m *Executor) FinalizeBlock(ctx context.Context, _a1 state.State, uncommit return r0, r1 } +// Executor_FinalizeBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FinalizeBlock' +type Executor_FinalizeBlock_Call struct { + *mock.Call +} + +// 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)} +} + +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 { + _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) + 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 { + _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) @@ -142,6 +278,38 @@ func (_m *Executor) ProcessProposal(ctx context.Context, block *types.Block, rou return r0, r1 } +// Executor_ProcessProposal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProcessProposal' +type Executor_ProcessProposal_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Executor_ProcessProposal_Call) Run(run func(ctx context.Context, block *types.Block, round int32, _a3 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) + return _c +} + +func (_c *Executor_ProcessProposal_Call) RunAndReturn(run func(context.Context, *types.Block, int32, state.State, 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) @@ -160,6 +328,36 @@ func (_m *Executor) ValidateBlock(ctx context.Context, _a1 state.State, block *t return r0 } +// Executor_ValidateBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidateBlock' +type Executor_ValidateBlock_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Executor_ValidateBlock_Call) Run(run func(ctx context.Context, _a1 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) + return _c +} + +func (_c *Executor_ValidateBlock_Call) RunAndReturn(run func(context.Context, state.State, *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) @@ -178,6 +376,37 @@ func (_m *Executor) ValidateBlockWithRoundState(ctx context.Context, _a1 state.S return r0 } +// Executor_ValidateBlockWithRoundState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidateBlockWithRoundState' +type Executor_ValidateBlockWithRoundState_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Executor_ValidateBlockWithRoundState_Call) Run(run func(ctx context.Context, _a1 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) + return _c +} + +func (_c *Executor_ValidateBlockWithRoundState_Call) RunAndReturn(run func(context.Context, state.State, state.CurrentRoundState, *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) @@ -196,6 +425,35 @@ func (_m *Executor) VerifyVoteExtension(ctx context.Context, vote *types.Vote) e return r0 } +// Executor_VerifyVoteExtension_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifyVoteExtension' +type Executor_VerifyVoteExtension_Call struct { + *mock.Call +} + +// VerifyVoteExtension is a helper method to define mock.On call +// - ctx context.Context +// - vote *types.Vote +func (_e *Executor_Expecter) VerifyVoteExtension(ctx interface{}, vote interface{}) *Executor_VerifyVoteExtension_Call { + return &Executor_VerifyVoteExtension_Call{Call: _e.mock.On("VerifyVoteExtension", ctx, vote)} +} + +func (_c *Executor_VerifyVoteExtension_Call) Run(run func(ctx context.Context, vote *types.Vote)) *Executor_VerifyVoteExtension_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*types.Vote)) + }) + return _c +} + +func (_c *Executor_VerifyVoteExtension_Call) Return(_a0 error) *Executor_VerifyVoteExtension_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Executor_VerifyVoteExtension_Call) RunAndReturn(run func(context.Context, *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 { diff --git a/internal/state/mocks/store.go b/internal/state/mocks/store.go index 006a8b4e0..556985c83 100644 --- a/internal/state/mocks/store.go +++ b/internal/state/mocks/store.go @@ -17,6 +17,14 @@ type Store struct { mock.Mock } +type Store_Expecter struct { + mock *mock.Mock +} + +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) @@ -35,6 +43,34 @@ func (_m *Store) Bootstrap(_a0 state.State) error { return r0 } +// Store_Bootstrap_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Bootstrap' +type Store_Bootstrap_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Store_Bootstrap_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Store_Bootstrap_Call) RunAndReturn(run func(state.State) error) *Store_Bootstrap_Call { + _c.Call.Return(run) + return _c +} + // Close provides a mock function with given fields: func (_m *Store) Close() error { ret := _m.Called() @@ -53,6 +89,33 @@ func (_m *Store) Close() error { return r0 } +// Store_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' +type Store_Close_Call struct { + *mock.Call +} + +// Close is a helper method to define mock.On call +func (_e *Store_Expecter) Close() *Store_Close_Call { + return &Store_Close_Call{Call: _e.mock.On("Close")} +} + +func (_c *Store_Close_Call) Run(run func()) *Store_Close_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Store_Close_Call) Return(_a0 error) *Store_Close_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_Close_Call) RunAndReturn(run func() error) *Store_Close_Call { + _c.Call.Return(run) + return _c +} + // Load provides a mock function with given fields: func (_m *Store) Load() (state.State, error) { ret := _m.Called() @@ -81,6 +144,33 @@ func (_m *Store) Load() (state.State, error) { return r0, r1 } +// Store_Load_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Load' +type Store_Load_Call struct { + *mock.Call +} + +// Load is a helper method to define mock.On call +func (_e *Store_Expecter) Load() *Store_Load_Call { + return &Store_Load_Call{Call: _e.mock.On("Load")} +} + +func (_c *Store_Load_Call) Run(run func()) *Store_Load_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Store_Load_Call) Return(_a0 state.State, _a1 error) *Store_Load_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_Load_Call) RunAndReturn(run func() (state.State, error)) *Store_Load_Call { + _c.Call.Return(run) + return _c +} + // LoadABCIResponses provides a mock function with given fields: _a0 func (_m *Store) LoadABCIResponses(_a0 int64) (*tendermintstate.ABCIResponses, error) { ret := _m.Called(_a0) @@ -111,6 +201,34 @@ func (_m *Store) LoadABCIResponses(_a0 int64) (*tendermintstate.ABCIResponses, e return r0, r1 } +// Store_LoadABCIResponses_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadABCIResponses' +type Store_LoadABCIResponses_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Store_LoadABCIResponses_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Store_LoadABCIResponses_Call) RunAndReturn(run func(int64) (*tendermintstate.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) @@ -139,6 +257,34 @@ func (_m *Store) LoadConsensusParams(_a0 int64) (types.ConsensusParams, error) { return r0, r1 } +// Store_LoadConsensusParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadConsensusParams' +type Store_LoadConsensusParams_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Store_LoadConsensusParams_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Store_LoadConsensusParams_Call) RunAndReturn(run func(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) @@ -169,6 +315,35 @@ func (_m *Store) LoadValidators(_a0 int64, _a1 selectproposer.BlockStore) (*type return r0, r1 } +// Store_LoadValidators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadValidators' +type Store_LoadValidators_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Store_LoadValidators_Call) Run(run func(_a0 int64, _a1 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) + return _c +} + +func (_c *Store_LoadValidators_Call) RunAndReturn(run func(int64, 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) @@ -187,6 +362,34 @@ func (_m *Store) PruneStates(_a0 int64) error { return r0 } +// Store_PruneStates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PruneStates' +type Store_PruneStates_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Store_PruneStates_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Store_PruneStates_Call) RunAndReturn(run func(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) @@ -205,6 +408,34 @@ func (_m *Store) Save(_a0 state.State) error { return r0 } +// Store_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save' +type Store_Save_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Store_Save_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Store_Save_Call) RunAndReturn(run func(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) @@ -223,6 +454,35 @@ func (_m *Store) SaveABCIResponses(_a0 int64, _a1 tendermintstate.ABCIResponses) return r0 } +// Store_SaveABCIResponses_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveABCIResponses' +type Store_SaveABCIResponses_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Store_SaveABCIResponses_Call) Run(run func(_a0 int64, _a1 tendermintstate.ABCIResponses)) *Store_SaveABCIResponses_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64), args[1].(tendermintstate.ABCIResponses)) + }) + return _c +} + +func (_c *Store_SaveABCIResponses_Call) Return(_a0 error) *Store_SaveABCIResponses_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_SaveABCIResponses_Call) RunAndReturn(run func(int64, tendermintstate.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) @@ -241,6 +501,36 @@ func (_m *Store) SaveValidatorSets(_a0 int64, _a1 int64, _a2 *types.ValidatorSet return r0 } +// Store_SaveValidatorSets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveValidatorSets' +type Store_SaveValidatorSets_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Store_SaveValidatorSets_Call) Run(run func(_a0 int64, _a1 int64, _a2 *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) + return _c +} + +func (_c *Store_SaveValidatorSets_Call) RunAndReturn(run func(int64, int64, *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 { diff --git a/internal/statesync/mocks/stateprovider.go b/internal/statesync/mocks/stateprovider.go index 73b6b7b37..8ac2b1544 100644 --- a/internal/statesync/mocks/stateprovider.go +++ b/internal/statesync/mocks/stateprovider.go @@ -19,6 +19,14 @@ type StateProvider struct { mock.Mock } +type StateProvider_Expecter struct { + mock *mock.Mock +} + +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) @@ -49,6 +57,35 @@ func (_m *StateProvider) AppHash(ctx context.Context, height uint64) (bytes.HexB return r0, r1 } +// StateProvider_AppHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AppHash' +type StateProvider_AppHash_Call struct { + *mock.Call +} + +// AppHash is a helper method to define mock.On call +// - ctx context.Context +// - height uint64 +func (_e *StateProvider_Expecter) AppHash(ctx interface{}, height interface{}) *StateProvider_AppHash_Call { + return &StateProvider_AppHash_Call{Call: _e.mock.On("AppHash", ctx, height)} +} + +func (_c *StateProvider_AppHash_Call) Run(run func(ctx context.Context, height uint64)) *StateProvider_AppHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64)) + }) + return _c +} + +func (_c *StateProvider_AppHash_Call) Return(_a0 bytes.HexBytes, _a1 error) *StateProvider_AppHash_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *StateProvider_AppHash_Call) RunAndReturn(run func(context.Context, 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) @@ -79,6 +116,35 @@ func (_m *StateProvider) Commit(ctx context.Context, height uint64) (*types.Comm return r0, r1 } +// StateProvider_Commit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Commit' +type StateProvider_Commit_Call struct { + *mock.Call +} + +// Commit is a helper method to define mock.On call +// - ctx context.Context +// - height uint64 +func (_e *StateProvider_Expecter) Commit(ctx interface{}, height interface{}) *StateProvider_Commit_Call { + return &StateProvider_Commit_Call{Call: _e.mock.On("Commit", ctx, height)} +} + +func (_c *StateProvider_Commit_Call) Run(run func(ctx context.Context, height uint64)) *StateProvider_Commit_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64)) + }) + return _c +} + +func (_c *StateProvider_Commit_Call) Return(_a0 *types.Commit, _a1 error) *StateProvider_Commit_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *StateProvider_Commit_Call) RunAndReturn(run func(context.Context, 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) @@ -107,6 +173,35 @@ func (_m *StateProvider) State(ctx context.Context, height uint64) (state.State, return r0, r1 } +// StateProvider_State_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'State' +type StateProvider_State_Call struct { + *mock.Call +} + +// State is a helper method to define mock.On call +// - ctx context.Context +// - height uint64 +func (_e *StateProvider_Expecter) State(ctx interface{}, height interface{}) *StateProvider_State_Call { + return &StateProvider_State_Call{Call: _e.mock.On("State", ctx, height)} +} + +func (_c *StateProvider_State_Call) Run(run func(ctx context.Context, height uint64)) *StateProvider_State_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64)) + }) + return _c +} + +func (_c *StateProvider_State_Call) Return(_a0 state.State, _a1 error) *StateProvider_State_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *StateProvider_State_Call) RunAndReturn(run func(context.Context, 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 { diff --git a/libs/store/mocks/store.go b/libs/store/mocks/store.go index 4a2b232fb..35a294875 100644 --- a/libs/store/mocks/store.go +++ b/libs/store/mocks/store.go @@ -12,6 +12,14 @@ type Store[K comparable, V any] struct { mock.Mock } +type Store_Expecter[K comparable, V any] struct { + mock *mock.Mock +} + +func (_m *Store[K, V]) EXPECT() *Store_Expecter[K, V] { + return &Store_Expecter[K, V]{mock: &_m.Mock} +} + // All provides a mock function with given fields: func (_m *Store[K, V]) All() []V { ret := _m.Called() @@ -32,11 +40,66 @@ func (_m *Store[K, V]) All() []V { return r0 } +// Store_All_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'All' +type Store_All_Call[K comparable, V any] struct { + *mock.Call +} + +// All is a helper method to define mock.On call +func (_e *Store_Expecter[K, V]) All() *Store_All_Call[K, V] { + return &Store_All_Call[K, V]{Call: _e.mock.On("All")} +} + +func (_c *Store_All_Call[K, V]) Run(run func()) *Store_All_Call[K, V] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Store_All_Call[K, V]) Return(_a0 []V) *Store_All_Call[K, V] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_All_Call[K, V]) RunAndReturn(run func() []V) *Store_All_Call[K, V] { + _c.Call.Return(run) + return _c +} + // Delete provides a mock function with given fields: key func (_m *Store[K, V]) Delete(key K) { _m.Called(key) } +// Store_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type Store_Delete_Call[K comparable, V any] struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - key K +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)} +} + +func (_c *Store_Delete_Call[K, V]) Run(run func(key K)) *Store_Delete_Call[K, V] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(K)) + }) + return _c +} + +func (_c *Store_Delete_Call[K, V]) Return() *Store_Delete_Call[K, V] { + _c.Call.Return() + return _c +} + +func (_c *Store_Delete_Call[K, V]) RunAndReturn(run func(K)) *Store_Delete_Call[K, V] { + _c.Call.Return(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) @@ -53,7 +116,9 @@ func (_m *Store[K, V]) Get(key K) (V, bool) { if rf, ok := ret.Get(0).(func(K) V); ok { r0 = rf(key) } else { - r0 = ret.Get(0).(V) + if ret.Get(0) != nil { + r0 = ret.Get(0).(V) + } } if rf, ok := ret.Get(1).(func(K) bool); ok { @@ -65,6 +130,34 @@ func (_m *Store[K, V]) Get(key K) (V, bool) { return r0, r1 } +// Store_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Store_Get_Call[K comparable, V any] struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - key K +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)} +} + +func (_c *Store_Get_Call[K, V]) Run(run func(key K)) *Store_Get_Call[K, V] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(K)) + }) + return _c +} + +func (_c *Store_Get_Call[K, V]) Return(_a0 V, _a1 bool) *Store_Get_Call[K, V] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_Get_Call[K, V]) RunAndReturn(run func(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) @@ -81,7 +174,9 @@ func (_m *Store[K, V]) GetAndDelete(key K) (V, bool) { if rf, ok := ret.Get(0).(func(K) V); ok { r0 = rf(key) } else { - r0 = ret.Get(0).(V) + if ret.Get(0) != nil { + r0 = ret.Get(0).(V) + } } if rf, ok := ret.Get(1).(func(K) bool); ok { @@ -93,6 +188,34 @@ func (_m *Store[K, V]) GetAndDelete(key K) (V, bool) { return r0, r1 } +// Store_GetAndDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAndDelete' +type Store_GetAndDelete_Call[K comparable, V any] struct { + *mock.Call +} + +// GetAndDelete is a helper method to define mock.On call +// - key K +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)} +} + +func (_c *Store_GetAndDelete_Call[K, V]) Run(run func(key K)) *Store_GetAndDelete_Call[K, V] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(K)) + }) + return _c +} + +func (_c *Store_GetAndDelete_Call[K, V]) Return(_a0 V, _a1 bool) *Store_GetAndDelete_Call[K, V] { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetAndDelete_Call[K, V]) RunAndReturn(run func(K) (V, bool)) *Store_GetAndDelete_Call[K, V] { + _c.Call.Return(run) + return _c +} + // IsZero provides a mock function with given fields: func (_m *Store[K, V]) IsZero() bool { ret := _m.Called() @@ -111,6 +234,33 @@ func (_m *Store[K, V]) IsZero() bool { return r0 } +// Store_IsZero_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsZero' +type Store_IsZero_Call[K comparable, V any] struct { + *mock.Call +} + +// IsZero is a helper method to define mock.On call +func (_e *Store_Expecter[K, V]) IsZero() *Store_IsZero_Call[K, V] { + return &Store_IsZero_Call[K, V]{Call: _e.mock.On("IsZero")} +} + +func (_c *Store_IsZero_Call[K, V]) Run(run func()) *Store_IsZero_Call[K, V] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Store_IsZero_Call[K, V]) Return(_a0 bool) *Store_IsZero_Call[K, V] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_IsZero_Call[K, V]) RunAndReturn(run func() bool) *Store_IsZero_Call[K, V] { + _c.Call.Return(run) + return _c +} + // Len provides a mock function with given fields: func (_m *Store[K, V]) Len() int { ret := _m.Called() @@ -129,11 +279,67 @@ func (_m *Store[K, V]) Len() int { return r0 } +// Store_Len_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Len' +type Store_Len_Call[K comparable, V any] struct { + *mock.Call +} + +// Len is a helper method to define mock.On call +func (_e *Store_Expecter[K, V]) Len() *Store_Len_Call[K, V] { + return &Store_Len_Call[K, V]{Call: _e.mock.On("Len")} +} + +func (_c *Store_Len_Call[K, V]) Run(run func()) *Store_Len_Call[K, V] { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Store_Len_Call[K, V]) Return(_a0 int) *Store_Len_Call[K, V] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_Len_Call[K, V]) RunAndReturn(run func() int) *Store_Len_Call[K, V] { + _c.Call.Return(run) + 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) } +// Store_Put_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Put' +type Store_Put_Call[K comparable, V any] struct { + *mock.Call +} + +// Put is a helper method to define mock.On call +// - key K +// - data V +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)} +} + +func (_c *Store_Put_Call[K, V]) Run(run func(key K, data V)) *Store_Put_Call[K, V] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(K), args[1].(V)) + }) + return _c +} + +func (_c *Store_Put_Call[K, V]) Return() *Store_Put_Call[K, V] { + _c.Call.Return() + return _c +} + +func (_c *Store_Put_Call[K, V]) RunAndReturn(run func(K, V)) *Store_Put_Call[K, V] { + _c.Call.Return(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) @@ -154,6 +360,35 @@ func (_m *Store[K, V]) Query(spec store.QueryFunc[K, V], limit int) []V { return r0 } +// Store_Query_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Query' +type Store_Query_Call[K comparable, V any] struct { + *mock.Call +} + +// Query is a helper method to define mock.On call +// - spec store.QueryFunc[K,V] +// - limit int +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)} +} + +func (_c *Store_Query_Call[K, V]) Run(run func(spec store.QueryFunc[K, V], limit int)) *Store_Query_Call[K, V] { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(store.QueryFunc[K, V]), args[1].(int)) + }) + return _c +} + +func (_c *Store_Query_Call[K, V]) Return(_a0 []V) *Store_Query_Call[K, V] { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_Query_Call[K, V]) RunAndReturn(run func(store.QueryFunc[K, V], 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)) @@ -166,6 +401,42 @@ func (_m *Store[K, V]) Update(key K, updates ...store.UpdateFunc[K, V]) { _m.Called(_ca...) } +// Store_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type Store_Update_Call[K comparable, V any] struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - key K +// - updates ...store.UpdateFunc[K,V] +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...)...)} +} + +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]) + } + } + run(args[0].(K), variadicArgs...) + }) + return _c +} + +func (_c *Store_Update_Call[K, V]) Return() *Store_Update_Call[K, V] { + _c.Call.Return() + return _c +} + +func (_c *Store_Update_Call[K, V]) RunAndReturn(run func(K, ...store.UpdateFunc[K, V])) *Store_Update_Call[K, V] { + _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[K comparable, V any](t interface { diff --git a/light/provider/mocks/provider.go b/light/provider/mocks/provider.go index 24cd675bf..137e9958b 100644 --- a/light/provider/mocks/provider.go +++ b/light/provider/mocks/provider.go @@ -15,6 +15,14 @@ type Provider struct { mock.Mock } +type Provider_Expecter struct { + mock *mock.Mock +} + +func (_m *Provider) EXPECT() *Provider_Expecter { + return &Provider_Expecter{mock: &_m.Mock} +} + // ID provides a mock function with given fields: func (_m *Provider) ID() string { ret := _m.Called() @@ -33,6 +41,33 @@ func (_m *Provider) ID() string { return r0 } +// Provider_ID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ID' +type Provider_ID_Call struct { + *mock.Call +} + +// ID is a helper method to define mock.On call +func (_e *Provider_Expecter) ID() *Provider_ID_Call { + return &Provider_ID_Call{Call: _e.mock.On("ID")} +} + +func (_c *Provider_ID_Call) Run(run func()) *Provider_ID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Provider_ID_Call) Return(_a0 string) *Provider_ID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Provider_ID_Call) RunAndReturn(run func() string) *Provider_ID_Call { + _c.Call.Return(run) + 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) @@ -63,6 +98,35 @@ func (_m *Provider) LightBlock(ctx context.Context, height int64) (*types.LightB return r0, r1 } +// Provider_LightBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LightBlock' +type Provider_LightBlock_Call struct { + *mock.Call +} + +// LightBlock is a helper method to define mock.On call +// - ctx context.Context +// - height int64 +func (_e *Provider_Expecter) LightBlock(ctx interface{}, height interface{}) *Provider_LightBlock_Call { + return &Provider_LightBlock_Call{Call: _e.mock.On("LightBlock", ctx, height)} +} + +func (_c *Provider_LightBlock_Call) Run(run func(ctx context.Context, height int64)) *Provider_LightBlock_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *Provider_LightBlock_Call) Return(_a0 *types.LightBlock, _a1 error) *Provider_LightBlock_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Provider_LightBlock_Call) RunAndReturn(run func(context.Context, 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) @@ -81,6 +145,35 @@ func (_m *Provider) ReportEvidence(_a0 context.Context, _a1 types.Evidence) erro return r0 } +// Provider_ReportEvidence_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReportEvidence' +type Provider_ReportEvidence_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Provider_ReportEvidence_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *Provider_ReportEvidence_Call) RunAndReturn(run func(context.Context, 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 { diff --git a/light/rpc/mocks/lightclient.go b/light/rpc/mocks/lightclient.go index 8d53cd4f9..6edc4304d 100644 --- a/light/rpc/mocks/lightclient.go +++ b/light/rpc/mocks/lightclient.go @@ -17,6 +17,14 @@ type LightClient struct { mock.Mock } +type LightClient_Expecter struct { + mock *mock.Mock +} + +func (_m *LightClient) EXPECT() *LightClient_Expecter { + return &LightClient_Expecter{mock: &_m.Mock} +} + // ChainID provides a mock function with given fields: func (_m *LightClient) ChainID() string { ret := _m.Called() @@ -35,6 +43,33 @@ func (_m *LightClient) ChainID() string { return r0 } +// LightClient_ChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChainID' +type LightClient_ChainID_Call struct { + *mock.Call +} + +// ChainID is a helper method to define mock.On call +func (_e *LightClient_Expecter) ChainID() *LightClient_ChainID_Call { + return &LightClient_ChainID_Call{Call: _e.mock.On("ChainID")} +} + +func (_c *LightClient_ChainID_Call) Run(run func()) *LightClient_ChainID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *LightClient_ChainID_Call) Return(_a0 string) *LightClient_ChainID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LightClient_ChainID_Call) RunAndReturn(run func() string) *LightClient_ChainID_Call { + _c.Call.Return(run) + return _c +} + // Status provides a mock function with given fields: ctx func (_m *LightClient) Status(ctx context.Context) *types.LightClientInfo { ret := _m.Called(ctx) @@ -55,6 +90,34 @@ func (_m *LightClient) Status(ctx context.Context) *types.LightClientInfo { return r0 } +// LightClient_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status' +type LightClient_Status_Call struct { + *mock.Call +} + +// Status is a helper method to define mock.On call +// - ctx context.Context +func (_e *LightClient_Expecter) Status(ctx interface{}) *LightClient_Status_Call { + return &LightClient_Status_Call{Call: _e.mock.On("Status", ctx)} +} + +func (_c *LightClient_Status_Call) Run(run func(ctx context.Context)) *LightClient_Status_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *LightClient_Status_Call) Return(_a0 *types.LightClientInfo) *LightClient_Status_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *LightClient_Status_Call) RunAndReturn(run func(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) @@ -85,6 +148,34 @@ func (_m *LightClient) TrustedLightBlock(height int64) (*types.LightBlock, error return r0, r1 } +// LightClient_TrustedLightBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TrustedLightBlock' +type LightClient_TrustedLightBlock_Call struct { + *mock.Call +} + +// TrustedLightBlock is a helper method to define mock.On call +// - height int64 +func (_e *LightClient_Expecter) TrustedLightBlock(height interface{}) *LightClient_TrustedLightBlock_Call { + return &LightClient_TrustedLightBlock_Call{Call: _e.mock.On("TrustedLightBlock", height)} +} + +func (_c *LightClient_TrustedLightBlock_Call) Run(run func(height int64)) *LightClient_TrustedLightBlock_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(int64)) + }) + return _c +} + +func (_c *LightClient_TrustedLightBlock_Call) Return(_a0 *types.LightBlock, _a1 error) *LightClient_TrustedLightBlock_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LightClient_TrustedLightBlock_Call) RunAndReturn(run func(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) @@ -115,6 +206,35 @@ func (_m *LightClient) Update(ctx context.Context, now time.Time) (*types.LightB return r0, r1 } +// LightClient_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update' +type LightClient_Update_Call struct { + *mock.Call +} + +// Update is a helper method to define mock.On call +// - ctx context.Context +// - now time.Time +func (_e *LightClient_Expecter) Update(ctx interface{}, now interface{}) *LightClient_Update_Call { + return &LightClient_Update_Call{Call: _e.mock.On("Update", ctx, now)} +} + +func (_c *LightClient_Update_Call) Run(run func(ctx context.Context, now time.Time)) *LightClient_Update_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(time.Time)) + }) + return _c +} + +func (_c *LightClient_Update_Call) Return(_a0 *types.LightBlock, _a1 error) *LightClient_Update_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LightClient_Update_Call) RunAndReturn(run func(context.Context, 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) @@ -145,6 +265,36 @@ func (_m *LightClient) VerifyLightBlockAtHeight(ctx context.Context, height int6 return r0, r1 } +// LightClient_VerifyLightBlockAtHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifyLightBlockAtHeight' +type LightClient_VerifyLightBlockAtHeight_Call struct { + *mock.Call +} + +// VerifyLightBlockAtHeight is a helper method to define mock.On call +// - ctx context.Context +// - height int64 +// - now time.Time +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)} +} + +func (_c *LightClient_VerifyLightBlockAtHeight_Call) Run(run func(ctx context.Context, height int64, now time.Time)) *LightClient_VerifyLightBlockAtHeight_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(time.Time)) + }) + return _c +} + +func (_c *LightClient_VerifyLightBlockAtHeight_Call) Return(_a0 *types.LightBlock, _a1 error) *LightClient_VerifyLightBlockAtHeight_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *LightClient_VerifyLightBlockAtHeight_Call) RunAndReturn(run func(context.Context, int64, 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 { diff --git a/rpc/client/mocks/client.go b/rpc/client/mocks/client.go index c62a3347a..0b4d6fbf4 100644 --- a/rpc/client/mocks/client.go +++ b/rpc/client/mocks/client.go @@ -20,6 +20,14 @@ type Client struct { mock.Mock } +type Client_Expecter struct { + mock *mock.Mock +} + +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) @@ -50,6 +58,34 @@ func (_m *Client) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo, erro return r0, r1 } +// Client_ABCIInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ABCIInfo' +type Client_ABCIInfo_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_ABCIInfo_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Client_ABCIInfo_Call) RunAndReturn(run func(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) @@ -80,6 +116,36 @@ func (_m *Client) ABCIQuery(ctx context.Context, path string, data bytes.HexByte return r0, r1 } +// Client_ABCIQuery_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ABCIQuery' +type Client_ABCIQuery_Call struct { + *mock.Call +} + +// ABCIQuery is a helper method to define mock.On call +// - ctx context.Context +// - path string +// - data bytes.HexBytes +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)} +} + +func (_c *Client_ABCIQuery_Call) Run(run func(ctx context.Context, path string, data bytes.HexBytes)) *Client_ABCIQuery_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(bytes.HexBytes)) + }) + return _c +} + +func (_c *Client_ABCIQuery_Call) Return(_a0 *coretypes.ResultABCIQuery, _a1 error) *Client_ABCIQuery_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_ABCIQuery_Call) RunAndReturn(run func(context.Context, string, 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) @@ -110,6 +176,37 @@ func (_m *Client) ABCIQueryWithOptions(ctx context.Context, path string, data by return r0, r1 } +// Client_ABCIQueryWithOptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ABCIQueryWithOptions' +type Client_ABCIQueryWithOptions_Call struct { + *mock.Call +} + +// ABCIQueryWithOptions is a helper method to define mock.On call +// - ctx context.Context +// - path string +// - data bytes.HexBytes +// - opts client.ABCIQueryOptions +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)} +} + +func (_c *Client_ABCIQueryWithOptions_Call) Run(run func(ctx context.Context, path string, data bytes.HexBytes, opts client.ABCIQueryOptions)) *Client_ABCIQueryWithOptions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(bytes.HexBytes), args[3].(client.ABCIQueryOptions)) + }) + return _c +} + +func (_c *Client_ABCIQueryWithOptions_Call) Return(_a0 *coretypes.ResultABCIQuery, _a1 error) *Client_ABCIQueryWithOptions_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_ABCIQueryWithOptions_Call) RunAndReturn(run func(context.Context, string, bytes.HexBytes, 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) @@ -140,6 +237,35 @@ func (_m *Client) Block(ctx context.Context, height *int64) (*coretypes.ResultBl return r0, r1 } +// Client_Block_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Block' +type Client_Block_Call struct { + *mock.Call +} + +// Block is a helper method to define mock.On call +// - ctx context.Context +// - height *int64 +func (_e *Client_Expecter) Block(ctx interface{}, height interface{}) *Client_Block_Call { + return &Client_Block_Call{Call: _e.mock.On("Block", ctx, height)} +} + +func (_c *Client_Block_Call) Run(run func(ctx context.Context, height *int64)) *Client_Block_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*int64)) + }) + return _c +} + +func (_c *Client_Block_Call) Return(_a0 *coretypes.ResultBlock, _a1 error) *Client_Block_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_Block_Call) RunAndReturn(run func(context.Context, *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) @@ -170,6 +296,35 @@ func (_m *Client) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*corety return r0, r1 } +// Client_BlockByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockByHash' +type Client_BlockByHash_Call struct { + *mock.Call +} + +// BlockByHash is a helper method to define mock.On call +// - ctx context.Context +// - hash bytes.HexBytes +func (_e *Client_Expecter) BlockByHash(ctx interface{}, hash interface{}) *Client_BlockByHash_Call { + return &Client_BlockByHash_Call{Call: _e.mock.On("BlockByHash", ctx, hash)} +} + +func (_c *Client_BlockByHash_Call) Run(run func(ctx context.Context, hash bytes.HexBytes)) *Client_BlockByHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bytes.HexBytes)) + }) + return _c +} + +func (_c *Client_BlockByHash_Call) Return(_a0 *coretypes.ResultBlock, _a1 error) *Client_BlockByHash_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_BlockByHash_Call) RunAndReturn(run func(context.Context, 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) @@ -200,6 +355,35 @@ func (_m *Client) BlockResults(ctx context.Context, height *int64) (*coretypes.R return r0, r1 } +// Client_BlockResults_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockResults' +type Client_BlockResults_Call struct { + *mock.Call +} + +// BlockResults is a helper method to define mock.On call +// - ctx context.Context +// - height *int64 +func (_e *Client_Expecter) BlockResults(ctx interface{}, height interface{}) *Client_BlockResults_Call { + return &Client_BlockResults_Call{Call: _e.mock.On("BlockResults", ctx, height)} +} + +func (_c *Client_BlockResults_Call) Run(run func(ctx context.Context, height *int64)) *Client_BlockResults_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*int64)) + }) + return _c +} + +func (_c *Client_BlockResults_Call) Return(_a0 *coretypes.ResultBlockResults, _a1 error) *Client_BlockResults_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_BlockResults_Call) RunAndReturn(run func(context.Context, *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) @@ -230,6 +414,38 @@ func (_m *Client) BlockSearch(ctx context.Context, query string, page *int, perP return r0, r1 } +// Client_BlockSearch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockSearch' +type Client_BlockSearch_Call struct { + *mock.Call +} + +// BlockSearch is a helper method to define mock.On call +// - ctx context.Context +// - query string +// - page *int +// - perPage *int +// - orderBy string +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)} +} + +func (_c *Client_BlockSearch_Call) Run(run func(ctx context.Context, query string, page *int, perPage *int, orderBy string)) *Client_BlockSearch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(*int), args[3].(*int), args[4].(string)) + }) + return _c +} + +func (_c *Client_BlockSearch_Call) Return(_a0 *coretypes.ResultBlockSearch, _a1 error) *Client_BlockSearch_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_BlockSearch_Call) RunAndReturn(run func(context.Context, string, *int, *int, 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) @@ -260,6 +476,36 @@ func (_m *Client) BlockchainInfo(ctx context.Context, minHeight int64, maxHeight return r0, r1 } +// Client_BlockchainInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockchainInfo' +type Client_BlockchainInfo_Call struct { + *mock.Call +} + +// BlockchainInfo is a helper method to define mock.On call +// - ctx context.Context +// - minHeight int64 +// - maxHeight int64 +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)} +} + +func (_c *Client_BlockchainInfo_Call) Run(run func(ctx context.Context, minHeight int64, maxHeight int64)) *Client_BlockchainInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(int64)) + }) + return _c +} + +func (_c *Client_BlockchainInfo_Call) Return(_a0 *coretypes.ResultBlockchainInfo, _a1 error) *Client_BlockchainInfo_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_BlockchainInfo_Call) RunAndReturn(run func(context.Context, int64, 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) @@ -290,6 +536,35 @@ func (_m *Client) BroadcastEvidence(_a0 context.Context, _a1 types.Evidence) (*c return r0, r1 } +// Client_BroadcastEvidence_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BroadcastEvidence' +type Client_BroadcastEvidence_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_BroadcastEvidence_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *Client_BroadcastEvidence_Call) RunAndReturn(run func(context.Context, 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) @@ -320,6 +595,35 @@ func (_m *Client) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretypes.Res return r0, r1 } +// Client_BroadcastTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BroadcastTx' +type Client_BroadcastTx_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_BroadcastTx_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *Client_BroadcastTx_Call) RunAndReturn(run func(context.Context, 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) @@ -350,6 +654,35 @@ func (_m *Client) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*coretype return r0, r1 } +// Client_BroadcastTxAsync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BroadcastTxAsync' +type Client_BroadcastTxAsync_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_BroadcastTxAsync_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *Client_BroadcastTxAsync_Call) RunAndReturn(run func(context.Context, 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) @@ -380,6 +713,35 @@ func (_m *Client) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*coretyp return r0, r1 } +// Client_BroadcastTxCommit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BroadcastTxCommit' +type Client_BroadcastTxCommit_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_BroadcastTxCommit_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *Client_BroadcastTxCommit_Call) RunAndReturn(run func(context.Context, 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) @@ -410,6 +772,35 @@ func (_m *Client) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*coretypes return r0, r1 } +// Client_BroadcastTxSync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BroadcastTxSync' +type Client_BroadcastTxSync_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_BroadcastTxSync_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *Client_BroadcastTxSync_Call) RunAndReturn(run func(context.Context, 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) @@ -440,6 +831,35 @@ func (_m *Client) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultC return r0, r1 } +// Client_CheckTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckTx' +type Client_CheckTx_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_CheckTx_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *Client_CheckTx_Call) RunAndReturn(run func(context.Context, 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) @@ -470,6 +890,35 @@ func (_m *Client) Commit(ctx context.Context, height *int64) (*coretypes.ResultC return r0, r1 } +// Client_Commit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Commit' +type Client_Commit_Call struct { + *mock.Call +} + +// Commit is a helper method to define mock.On call +// - ctx context.Context +// - height *int64 +func (_e *Client_Expecter) Commit(ctx interface{}, height interface{}) *Client_Commit_Call { + return &Client_Commit_Call{Call: _e.mock.On("Commit", ctx, height)} +} + +func (_c *Client_Commit_Call) Run(run func(ctx context.Context, height *int64)) *Client_Commit_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*int64)) + }) + return _c +} + +func (_c *Client_Commit_Call) Return(_a0 *coretypes.ResultCommit, _a1 error) *Client_Commit_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_Commit_Call) RunAndReturn(run func(context.Context, *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) @@ -500,6 +949,35 @@ func (_m *Client) ConsensusParams(ctx context.Context, height *int64) (*coretype return r0, r1 } +// Client_ConsensusParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConsensusParams' +type Client_ConsensusParams_Call struct { + *mock.Call +} + +// ConsensusParams is a helper method to define mock.On call +// - ctx context.Context +// - height *int64 +func (_e *Client_Expecter) ConsensusParams(ctx interface{}, height interface{}) *Client_ConsensusParams_Call { + return &Client_ConsensusParams_Call{Call: _e.mock.On("ConsensusParams", ctx, height)} +} + +func (_c *Client_ConsensusParams_Call) Run(run func(ctx context.Context, height *int64)) *Client_ConsensusParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*int64)) + }) + return _c +} + +func (_c *Client_ConsensusParams_Call) Return(_a0 *coretypes.ResultConsensusParams, _a1 error) *Client_ConsensusParams_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_ConsensusParams_Call) RunAndReturn(run func(context.Context, *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) @@ -530,6 +1008,34 @@ func (_m *Client) ConsensusState(_a0 context.Context) (*coretypes.ResultConsensu return r0, r1 } +// Client_ConsensusState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConsensusState' +type Client_ConsensusState_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_ConsensusState_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Client_ConsensusState_Call) RunAndReturn(run func(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) @@ -560,6 +1066,34 @@ func (_m *Client) DumpConsensusState(_a0 context.Context) (*coretypes.ResultDump return r0, r1 } +// Client_DumpConsensusState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DumpConsensusState' +type Client_DumpConsensusState_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_DumpConsensusState_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Client_DumpConsensusState_Call) RunAndReturn(run func(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) @@ -590,6 +1124,35 @@ func (_m *Client) Events(ctx context.Context, req *coretypes.RequestEvents) (*co return r0, r1 } +// Client_Events_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Events' +type Client_Events_Call struct { + *mock.Call +} + +// Events is a helper method to define mock.On call +// - ctx context.Context +// - req *coretypes.RequestEvents +func (_e *Client_Expecter) Events(ctx interface{}, req interface{}) *Client_Events_Call { + return &Client_Events_Call{Call: _e.mock.On("Events", ctx, req)} +} + +func (_c *Client_Events_Call) Run(run func(ctx context.Context, req *coretypes.RequestEvents)) *Client_Events_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*coretypes.RequestEvents)) + }) + return _c +} + +func (_c *Client_Events_Call) Return(_a0 *coretypes.ResultEvents, _a1 error) *Client_Events_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_Events_Call) RunAndReturn(run func(context.Context, *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) @@ -620,6 +1183,34 @@ func (_m *Client) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, error) return r0, r1 } +// Client_Genesis_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Genesis' +type Client_Genesis_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_Genesis_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Client_Genesis_Call) RunAndReturn(run func(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) @@ -650,6 +1241,35 @@ func (_m *Client) GenesisChunked(_a0 context.Context, _a1 uint) (*coretypes.Resu return r0, r1 } +// Client_GenesisChunked_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GenesisChunked' +type Client_GenesisChunked_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_GenesisChunked_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *Client_GenesisChunked_Call) RunAndReturn(run func(context.Context, 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) @@ -680,6 +1300,35 @@ func (_m *Client) Header(ctx context.Context, height *int64) (*coretypes.ResultH return r0, r1 } +// Client_Header_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Header' +type Client_Header_Call struct { + *mock.Call +} + +// Header is a helper method to define mock.On call +// - ctx context.Context +// - height *int64 +func (_e *Client_Expecter) Header(ctx interface{}, height interface{}) *Client_Header_Call { + return &Client_Header_Call{Call: _e.mock.On("Header", ctx, height)} +} + +func (_c *Client_Header_Call) Run(run func(ctx context.Context, height *int64)) *Client_Header_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*int64)) + }) + return _c +} + +func (_c *Client_Header_Call) Return(_a0 *coretypes.ResultHeader, _a1 error) *Client_Header_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_Header_Call) RunAndReturn(run func(context.Context, *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) @@ -710,6 +1359,35 @@ func (_m *Client) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*coret return r0, r1 } +// Client_HeaderByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HeaderByHash' +type Client_HeaderByHash_Call struct { + *mock.Call +} + +// HeaderByHash is a helper method to define mock.On call +// - ctx context.Context +// - hash bytes.HexBytes +func (_e *Client_Expecter) HeaderByHash(ctx interface{}, hash interface{}) *Client_HeaderByHash_Call { + return &Client_HeaderByHash_Call{Call: _e.mock.On("HeaderByHash", ctx, hash)} +} + +func (_c *Client_HeaderByHash_Call) Run(run func(ctx context.Context, hash bytes.HexBytes)) *Client_HeaderByHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bytes.HexBytes)) + }) + return _c +} + +func (_c *Client_HeaderByHash_Call) Return(_a0 *coretypes.ResultHeader, _a1 error) *Client_HeaderByHash_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_HeaderByHash_Call) RunAndReturn(run func(context.Context, 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) @@ -740,6 +1418,34 @@ func (_m *Client) Health(_a0 context.Context) (*coretypes.ResultHealth, error) { return r0, r1 } +// Client_Health_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Health' +type Client_Health_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_Health_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Client_Health_Call) RunAndReturn(run func(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) @@ -770,6 +1476,34 @@ func (_m *Client) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, error) return r0, r1 } +// Client_NetInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NetInfo' +type Client_NetInfo_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_NetInfo_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Client_NetInfo_Call) RunAndReturn(run func(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) @@ -800,6 +1534,34 @@ func (_m *Client) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.ResultUncon return r0, r1 } +// Client_NumUnconfirmedTxs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NumUnconfirmedTxs' +type Client_NumUnconfirmedTxs_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_NumUnconfirmedTxs_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Client_NumUnconfirmedTxs_Call) RunAndReturn(run func(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) @@ -818,6 +1580,35 @@ func (_m *Client) RemoveTx(_a0 context.Context, _a1 types.TxKey) error { return r0 } +// Client_RemoveTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveTx' +type Client_RemoveTx_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_RemoveTx_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *Client_RemoveTx_Call) RunAndReturn(run func(context.Context, 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) @@ -836,6 +1627,34 @@ func (_m *Client) Start(_a0 context.Context) error { return r0 } +// Client_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type Client_Start_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_Start_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Client_Start_Call) RunAndReturn(run func(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) @@ -866,6 +1685,34 @@ func (_m *Client) Status(_a0 context.Context) (*coretypes.ResultStatus, error) { return r0, r1 } +// Client_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status' +type Client_Status_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *Client_Status_Call) Run(run func(_a0 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) + return _c +} + +func (_c *Client_Status_Call) RunAndReturn(run func(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)) @@ -903,6 +1750,44 @@ func (_m *Client) Subscribe(ctx context.Context, subscriber string, query string return r0, r1 } +// Client_Subscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Subscribe' +type Client_Subscribe_Call struct { + *mock.Call +} + +// Subscribe is a helper method to define mock.On call +// - ctx context.Context +// - subscriber string +// - query string +// - outCapacity ...int +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...)...)} +} + +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) + } + } + run(args[0].(context.Context), args[1].(string), args[2].(string), variadicArgs...) + }) + return _c +} + +func (_c *Client_Subscribe_Call) Return(out <-chan coretypes.ResultEvent, err error) *Client_Subscribe_Call { + _c.Call.Return(out, err) + return _c +} + +func (_c *Client_Subscribe_Call) RunAndReturn(run func(context.Context, string, string, ...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) @@ -933,6 +1818,36 @@ func (_m *Client) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) (*cor return r0, r1 } +// Client_Tx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Tx' +type Client_Tx_Call struct { + *mock.Call +} + +// Tx is a helper method to define mock.On call +// - ctx context.Context +// - hash bytes.HexBytes +// - prove bool +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)} +} + +func (_c *Client_Tx_Call) Run(run func(ctx context.Context, hash bytes.HexBytes, prove bool)) *Client_Tx_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bytes.HexBytes), args[2].(bool)) + }) + return _c +} + +func (_c *Client_Tx_Call) Return(_a0 *coretypes.ResultTx, _a1 error) *Client_Tx_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_Tx_Call) RunAndReturn(run func(context.Context, bytes.HexBytes, 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) @@ -963,6 +1878,39 @@ func (_m *Client) TxSearch(ctx context.Context, query string, prove bool, page * return r0, r1 } +// Client_TxSearch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TxSearch' +type Client_TxSearch_Call struct { + *mock.Call +} + +// TxSearch is a helper method to define mock.On call +// - ctx context.Context +// - query string +// - prove bool +// - page *int +// - perPage *int +// - orderBy string +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)} +} + +func (_c *Client_TxSearch_Call) Run(run func(ctx context.Context, query string, prove bool, page *int, perPage *int, orderBy string)) *Client_TxSearch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(bool), args[3].(*int), args[4].(*int), args[5].(string)) + }) + return _c +} + +func (_c *Client_TxSearch_Call) Return(_a0 *coretypes.ResultTxSearch, _a1 error) *Client_TxSearch_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_TxSearch_Call) RunAndReturn(run func(context.Context, string, bool, *int, *int, string) (*coretypes.ResultTxSearch, error)) *Client_TxSearch_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) @@ -993,6 +1941,36 @@ func (_m *Client) UnconfirmedTxs(ctx context.Context, page *int, perPage *int) ( return r0, r1 } +// Client_UnconfirmedTxs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnconfirmedTxs' +type Client_UnconfirmedTxs_Call struct { + *mock.Call +} + +// UnconfirmedTxs is a helper method to define mock.On call +// - ctx context.Context +// - page *int +// - perPage *int +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)} +} + +func (_c *Client_UnconfirmedTxs_Call) Run(run func(ctx context.Context, page *int, perPage *int)) *Client_UnconfirmedTxs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*int), args[2].(*int)) + }) + return _c +} + +func (_c *Client_UnconfirmedTxs_Call) Return(_a0 *coretypes.ResultUnconfirmedTxs, _a1 error) *Client_UnconfirmedTxs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_UnconfirmedTxs_Call) RunAndReturn(run func(context.Context, *int, *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) @@ -1011,6 +1989,36 @@ func (_m *Client) Unsubscribe(ctx context.Context, subscriber string, query stri return r0 } +// Client_Unsubscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unsubscribe' +type Client_Unsubscribe_Call struct { + *mock.Call +} + +// Unsubscribe is a helper method to define mock.On call +// - ctx context.Context +// - subscriber string +// - query string +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)} +} + +func (_c *Client_Unsubscribe_Call) Run(run func(ctx context.Context, subscriber string, query string)) *Client_Unsubscribe_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *Client_Unsubscribe_Call) Return(_a0 error) *Client_Unsubscribe_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_Unsubscribe_Call) RunAndReturn(run func(context.Context, string, 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) @@ -1029,6 +2037,35 @@ func (_m *Client) UnsubscribeAll(ctx context.Context, subscriber string) error { return r0 } +// Client_UnsubscribeAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnsubscribeAll' +type Client_UnsubscribeAll_Call struct { + *mock.Call +} + +// UnsubscribeAll is a helper method to define mock.On call +// - ctx context.Context +// - subscriber string +func (_e *Client_Expecter) UnsubscribeAll(ctx interface{}, subscriber interface{}) *Client_UnsubscribeAll_Call { + return &Client_UnsubscribeAll_Call{Call: _e.mock.On("UnsubscribeAll", ctx, subscriber)} +} + +func (_c *Client_UnsubscribeAll_Call) Run(run func(ctx context.Context, subscriber string)) *Client_UnsubscribeAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Client_UnsubscribeAll_Call) Return(_a0 error) *Client_UnsubscribeAll_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Client_UnsubscribeAll_Call) RunAndReturn(run func(context.Context, 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) @@ -1059,6 +2096,38 @@ func (_m *Client) Validators(ctx context.Context, height *int64, page *int, perP return r0, r1 } +// Client_Validators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Validators' +type Client_Validators_Call struct { + *mock.Call +} + +// Validators is a helper method to define mock.On call +// - ctx context.Context +// - height *int64 +// - page *int +// - perPage *int +// - requestQuorumInfo *bool +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)} +} + +func (_c *Client_Validators_Call) Run(run func(ctx context.Context, height *int64, page *int, perPage *int, requestQuorumInfo *bool)) *Client_Validators_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*int64), args[2].(*int), args[3].(*int), args[4].(*bool)) + }) + return _c +} + +func (_c *Client_Validators_Call) Return(_a0 *coretypes.ResultValidators, _a1 error) *Client_Validators_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Client_Validators_Call) RunAndReturn(run func(context.Context, *int64, *int, *int, *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 { diff --git a/rpc/client/mocks/remoteclient.go b/rpc/client/mocks/remoteclient.go index 170878616..1fed245b7 100644 --- a/rpc/client/mocks/remoteclient.go +++ b/rpc/client/mocks/remoteclient.go @@ -20,6 +20,14 @@ type RemoteClient struct { mock.Mock } +type RemoteClient_Expecter struct { + mock *mock.Mock +} + +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) @@ -50,6 +58,34 @@ func (_m *RemoteClient) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo return r0, r1 } +// RemoteClient_ABCIInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ABCIInfo' +type RemoteClient_ABCIInfo_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *RemoteClient_ABCIInfo_Call) Run(run func(_a0 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) + return _c +} + +func (_c *RemoteClient_ABCIInfo_Call) RunAndReturn(run func(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) @@ -80,6 +116,36 @@ func (_m *RemoteClient) ABCIQuery(ctx context.Context, path string, data bytes.H return r0, r1 } +// RemoteClient_ABCIQuery_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ABCIQuery' +type RemoteClient_ABCIQuery_Call struct { + *mock.Call +} + +// ABCIQuery is a helper method to define mock.On call +// - ctx context.Context +// - path string +// - data bytes.HexBytes +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)} +} + +func (_c *RemoteClient_ABCIQuery_Call) Run(run func(ctx context.Context, path string, data bytes.HexBytes)) *RemoteClient_ABCIQuery_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(bytes.HexBytes)) + }) + return _c +} + +func (_c *RemoteClient_ABCIQuery_Call) Return(_a0 *coretypes.ResultABCIQuery, _a1 error) *RemoteClient_ABCIQuery_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RemoteClient_ABCIQuery_Call) RunAndReturn(run func(context.Context, string, 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) @@ -110,6 +176,37 @@ func (_m *RemoteClient) ABCIQueryWithOptions(ctx context.Context, path string, d return r0, r1 } +// RemoteClient_ABCIQueryWithOptions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ABCIQueryWithOptions' +type RemoteClient_ABCIQueryWithOptions_Call struct { + *mock.Call +} + +// ABCIQueryWithOptions is a helper method to define mock.On call +// - ctx context.Context +// - path string +// - data bytes.HexBytes +// - opts client.ABCIQueryOptions +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)} +} + +func (_c *RemoteClient_ABCIQueryWithOptions_Call) Run(run func(ctx context.Context, path string, data bytes.HexBytes, opts client.ABCIQueryOptions)) *RemoteClient_ABCIQueryWithOptions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(bytes.HexBytes), args[3].(client.ABCIQueryOptions)) + }) + return _c +} + +func (_c *RemoteClient_ABCIQueryWithOptions_Call) Return(_a0 *coretypes.ResultABCIQuery, _a1 error) *RemoteClient_ABCIQueryWithOptions_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RemoteClient_ABCIQueryWithOptions_Call) RunAndReturn(run func(context.Context, string, bytes.HexBytes, 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) @@ -140,6 +237,35 @@ func (_m *RemoteClient) Block(ctx context.Context, height *int64) (*coretypes.Re return r0, r1 } +// RemoteClient_Block_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Block' +type RemoteClient_Block_Call struct { + *mock.Call +} + +// Block is a helper method to define mock.On call +// - ctx context.Context +// - height *int64 +func (_e *RemoteClient_Expecter) Block(ctx interface{}, height interface{}) *RemoteClient_Block_Call { + return &RemoteClient_Block_Call{Call: _e.mock.On("Block", ctx, height)} +} + +func (_c *RemoteClient_Block_Call) Run(run func(ctx context.Context, height *int64)) *RemoteClient_Block_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*int64)) + }) + return _c +} + +func (_c *RemoteClient_Block_Call) Return(_a0 *coretypes.ResultBlock, _a1 error) *RemoteClient_Block_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RemoteClient_Block_Call) RunAndReturn(run func(context.Context, *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) @@ -170,6 +296,35 @@ func (_m *RemoteClient) BlockByHash(ctx context.Context, hash bytes.HexBytes) (* return r0, r1 } +// RemoteClient_BlockByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockByHash' +type RemoteClient_BlockByHash_Call struct { + *mock.Call +} + +// BlockByHash is a helper method to define mock.On call +// - ctx context.Context +// - hash bytes.HexBytes +func (_e *RemoteClient_Expecter) BlockByHash(ctx interface{}, hash interface{}) *RemoteClient_BlockByHash_Call { + return &RemoteClient_BlockByHash_Call{Call: _e.mock.On("BlockByHash", ctx, hash)} +} + +func (_c *RemoteClient_BlockByHash_Call) Run(run func(ctx context.Context, hash bytes.HexBytes)) *RemoteClient_BlockByHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bytes.HexBytes)) + }) + return _c +} + +func (_c *RemoteClient_BlockByHash_Call) Return(_a0 *coretypes.ResultBlock, _a1 error) *RemoteClient_BlockByHash_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RemoteClient_BlockByHash_Call) RunAndReturn(run func(context.Context, 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) @@ -200,6 +355,35 @@ func (_m *RemoteClient) BlockResults(ctx context.Context, height *int64) (*coret return r0, r1 } +// RemoteClient_BlockResults_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockResults' +type RemoteClient_BlockResults_Call struct { + *mock.Call +} + +// BlockResults is a helper method to define mock.On call +// - ctx context.Context +// - height *int64 +func (_e *RemoteClient_Expecter) BlockResults(ctx interface{}, height interface{}) *RemoteClient_BlockResults_Call { + return &RemoteClient_BlockResults_Call{Call: _e.mock.On("BlockResults", ctx, height)} +} + +func (_c *RemoteClient_BlockResults_Call) Run(run func(ctx context.Context, height *int64)) *RemoteClient_BlockResults_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*int64)) + }) + return _c +} + +func (_c *RemoteClient_BlockResults_Call) Return(_a0 *coretypes.ResultBlockResults, _a1 error) *RemoteClient_BlockResults_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RemoteClient_BlockResults_Call) RunAndReturn(run func(context.Context, *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) @@ -230,6 +414,38 @@ func (_m *RemoteClient) BlockSearch(ctx context.Context, query string, page *int return r0, r1 } +// RemoteClient_BlockSearch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockSearch' +type RemoteClient_BlockSearch_Call struct { + *mock.Call +} + +// BlockSearch is a helper method to define mock.On call +// - ctx context.Context +// - query string +// - page *int +// - perPage *int +// - orderBy string +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)} +} + +func (_c *RemoteClient_BlockSearch_Call) Run(run func(ctx context.Context, query string, page *int, perPage *int, orderBy string)) *RemoteClient_BlockSearch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(*int), args[3].(*int), args[4].(string)) + }) + return _c +} + +func (_c *RemoteClient_BlockSearch_Call) Return(_a0 *coretypes.ResultBlockSearch, _a1 error) *RemoteClient_BlockSearch_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RemoteClient_BlockSearch_Call) RunAndReturn(run func(context.Context, string, *int, *int, 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) @@ -260,6 +476,36 @@ func (_m *RemoteClient) BlockchainInfo(ctx context.Context, minHeight int64, max return r0, r1 } +// RemoteClient_BlockchainInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BlockchainInfo' +type RemoteClient_BlockchainInfo_Call struct { + *mock.Call +} + +// BlockchainInfo is a helper method to define mock.On call +// - ctx context.Context +// - minHeight int64 +// - maxHeight int64 +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)} +} + +func (_c *RemoteClient_BlockchainInfo_Call) Run(run func(ctx context.Context, minHeight int64, maxHeight int64)) *RemoteClient_BlockchainInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(int64)) + }) + return _c +} + +func (_c *RemoteClient_BlockchainInfo_Call) Return(_a0 *coretypes.ResultBlockchainInfo, _a1 error) *RemoteClient_BlockchainInfo_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RemoteClient_BlockchainInfo_Call) RunAndReturn(run func(context.Context, int64, 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) @@ -290,6 +536,35 @@ func (_m *RemoteClient) BroadcastEvidence(_a0 context.Context, _a1 types.Evidenc return r0, r1 } +// RemoteClient_BroadcastEvidence_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BroadcastEvidence' +type RemoteClient_BroadcastEvidence_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *RemoteClient_BroadcastEvidence_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *RemoteClient_BroadcastEvidence_Call) RunAndReturn(run func(context.Context, 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) @@ -320,6 +595,35 @@ func (_m *RemoteClient) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretyp return r0, r1 } +// RemoteClient_BroadcastTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BroadcastTx' +type RemoteClient_BroadcastTx_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *RemoteClient_BroadcastTx_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *RemoteClient_BroadcastTx_Call) RunAndReturn(run func(context.Context, 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) @@ -350,6 +654,35 @@ func (_m *RemoteClient) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*co return r0, r1 } +// RemoteClient_BroadcastTxAsync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BroadcastTxAsync' +type RemoteClient_BroadcastTxAsync_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *RemoteClient_BroadcastTxAsync_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *RemoteClient_BroadcastTxAsync_Call) RunAndReturn(run func(context.Context, 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) @@ -380,6 +713,35 @@ func (_m *RemoteClient) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*c return r0, r1 } +// RemoteClient_BroadcastTxCommit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BroadcastTxCommit' +type RemoteClient_BroadcastTxCommit_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *RemoteClient_BroadcastTxCommit_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *RemoteClient_BroadcastTxCommit_Call) RunAndReturn(run func(context.Context, 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) @@ -410,6 +772,35 @@ func (_m *RemoteClient) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*cor return r0, r1 } +// RemoteClient_BroadcastTxSync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BroadcastTxSync' +type RemoteClient_BroadcastTxSync_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *RemoteClient_BroadcastTxSync_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *RemoteClient_BroadcastTxSync_Call) RunAndReturn(run func(context.Context, 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) @@ -440,6 +831,35 @@ func (_m *RemoteClient) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.R return r0, r1 } +// RemoteClient_CheckTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckTx' +type RemoteClient_CheckTx_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *RemoteClient_CheckTx_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *RemoteClient_CheckTx_Call) RunAndReturn(run func(context.Context, 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) @@ -470,6 +890,35 @@ func (_m *RemoteClient) Commit(ctx context.Context, height *int64) (*coretypes.R return r0, r1 } +// RemoteClient_Commit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Commit' +type RemoteClient_Commit_Call struct { + *mock.Call +} + +// Commit is a helper method to define mock.On call +// - ctx context.Context +// - height *int64 +func (_e *RemoteClient_Expecter) Commit(ctx interface{}, height interface{}) *RemoteClient_Commit_Call { + return &RemoteClient_Commit_Call{Call: _e.mock.On("Commit", ctx, height)} +} + +func (_c *RemoteClient_Commit_Call) Run(run func(ctx context.Context, height *int64)) *RemoteClient_Commit_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*int64)) + }) + return _c +} + +func (_c *RemoteClient_Commit_Call) Return(_a0 *coretypes.ResultCommit, _a1 error) *RemoteClient_Commit_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RemoteClient_Commit_Call) RunAndReturn(run func(context.Context, *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) @@ -500,6 +949,35 @@ func (_m *RemoteClient) ConsensusParams(ctx context.Context, height *int64) (*co return r0, r1 } +// RemoteClient_ConsensusParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConsensusParams' +type RemoteClient_ConsensusParams_Call struct { + *mock.Call +} + +// ConsensusParams is a helper method to define mock.On call +// - ctx context.Context +// - height *int64 +func (_e *RemoteClient_Expecter) ConsensusParams(ctx interface{}, height interface{}) *RemoteClient_ConsensusParams_Call { + return &RemoteClient_ConsensusParams_Call{Call: _e.mock.On("ConsensusParams", ctx, height)} +} + +func (_c *RemoteClient_ConsensusParams_Call) Run(run func(ctx context.Context, height *int64)) *RemoteClient_ConsensusParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*int64)) + }) + return _c +} + +func (_c *RemoteClient_ConsensusParams_Call) Return(_a0 *coretypes.ResultConsensusParams, _a1 error) *RemoteClient_ConsensusParams_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RemoteClient_ConsensusParams_Call) RunAndReturn(run func(context.Context, *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) @@ -530,6 +1008,34 @@ func (_m *RemoteClient) ConsensusState(_a0 context.Context) (*coretypes.ResultCo return r0, r1 } +// RemoteClient_ConsensusState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConsensusState' +type RemoteClient_ConsensusState_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *RemoteClient_ConsensusState_Call) Run(run func(_a0 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) + return _c +} + +func (_c *RemoteClient_ConsensusState_Call) RunAndReturn(run func(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) @@ -560,6 +1066,34 @@ func (_m *RemoteClient) DumpConsensusState(_a0 context.Context) (*coretypes.Resu return r0, r1 } +// RemoteClient_DumpConsensusState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DumpConsensusState' +type RemoteClient_DumpConsensusState_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *RemoteClient_DumpConsensusState_Call) Run(run func(_a0 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) + return _c +} + +func (_c *RemoteClient_DumpConsensusState_Call) RunAndReturn(run func(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) @@ -590,6 +1124,35 @@ func (_m *RemoteClient) Events(ctx context.Context, req *coretypes.RequestEvents return r0, r1 } +// RemoteClient_Events_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Events' +type RemoteClient_Events_Call struct { + *mock.Call +} + +// Events is a helper method to define mock.On call +// - ctx context.Context +// - req *coretypes.RequestEvents +func (_e *RemoteClient_Expecter) Events(ctx interface{}, req interface{}) *RemoteClient_Events_Call { + return &RemoteClient_Events_Call{Call: _e.mock.On("Events", ctx, req)} +} + +func (_c *RemoteClient_Events_Call) Run(run func(ctx context.Context, req *coretypes.RequestEvents)) *RemoteClient_Events_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*coretypes.RequestEvents)) + }) + return _c +} + +func (_c *RemoteClient_Events_Call) Return(_a0 *coretypes.ResultEvents, _a1 error) *RemoteClient_Events_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RemoteClient_Events_Call) RunAndReturn(run func(context.Context, *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) @@ -620,6 +1183,34 @@ func (_m *RemoteClient) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, return r0, r1 } +// RemoteClient_Genesis_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Genesis' +type RemoteClient_Genesis_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *RemoteClient_Genesis_Call) Run(run func(_a0 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) + return _c +} + +func (_c *RemoteClient_Genesis_Call) RunAndReturn(run func(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) @@ -650,6 +1241,35 @@ func (_m *RemoteClient) GenesisChunked(_a0 context.Context, _a1 uint) (*coretype return r0, r1 } +// RemoteClient_GenesisChunked_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GenesisChunked' +type RemoteClient_GenesisChunked_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *RemoteClient_GenesisChunked_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *RemoteClient_GenesisChunked_Call) RunAndReturn(run func(context.Context, 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) @@ -680,6 +1300,35 @@ func (_m *RemoteClient) Header(ctx context.Context, height *int64) (*coretypes.R return r0, r1 } +// RemoteClient_Header_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Header' +type RemoteClient_Header_Call struct { + *mock.Call +} + +// Header is a helper method to define mock.On call +// - ctx context.Context +// - height *int64 +func (_e *RemoteClient_Expecter) Header(ctx interface{}, height interface{}) *RemoteClient_Header_Call { + return &RemoteClient_Header_Call{Call: _e.mock.On("Header", ctx, height)} +} + +func (_c *RemoteClient_Header_Call) Run(run func(ctx context.Context, height *int64)) *RemoteClient_Header_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*int64)) + }) + return _c +} + +func (_c *RemoteClient_Header_Call) Return(_a0 *coretypes.ResultHeader, _a1 error) *RemoteClient_Header_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RemoteClient_Header_Call) RunAndReturn(run func(context.Context, *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) @@ -710,6 +1359,35 @@ func (_m *RemoteClient) HeaderByHash(ctx context.Context, hash bytes.HexBytes) ( return r0, r1 } +// RemoteClient_HeaderByHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HeaderByHash' +type RemoteClient_HeaderByHash_Call struct { + *mock.Call +} + +// HeaderByHash is a helper method to define mock.On call +// - ctx context.Context +// - hash bytes.HexBytes +func (_e *RemoteClient_Expecter) HeaderByHash(ctx interface{}, hash interface{}) *RemoteClient_HeaderByHash_Call { + return &RemoteClient_HeaderByHash_Call{Call: _e.mock.On("HeaderByHash", ctx, hash)} +} + +func (_c *RemoteClient_HeaderByHash_Call) Run(run func(ctx context.Context, hash bytes.HexBytes)) *RemoteClient_HeaderByHash_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bytes.HexBytes)) + }) + return _c +} + +func (_c *RemoteClient_HeaderByHash_Call) Return(_a0 *coretypes.ResultHeader, _a1 error) *RemoteClient_HeaderByHash_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RemoteClient_HeaderByHash_Call) RunAndReturn(run func(context.Context, 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) @@ -740,6 +1418,34 @@ func (_m *RemoteClient) Health(_a0 context.Context) (*coretypes.ResultHealth, er return r0, r1 } +// RemoteClient_Health_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Health' +type RemoteClient_Health_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *RemoteClient_Health_Call) Run(run func(_a0 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) + return _c +} + +func (_c *RemoteClient_Health_Call) RunAndReturn(run func(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) @@ -770,6 +1476,34 @@ func (_m *RemoteClient) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, return r0, r1 } +// RemoteClient_NetInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NetInfo' +type RemoteClient_NetInfo_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *RemoteClient_NetInfo_Call) Run(run func(_a0 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) + return _c +} + +func (_c *RemoteClient_NetInfo_Call) RunAndReturn(run func(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) @@ -800,6 +1534,34 @@ func (_m *RemoteClient) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.Resul return r0, r1 } +// RemoteClient_NumUnconfirmedTxs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NumUnconfirmedTxs' +type RemoteClient_NumUnconfirmedTxs_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *RemoteClient_NumUnconfirmedTxs_Call) Run(run func(_a0 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) + return _c +} + +func (_c *RemoteClient_NumUnconfirmedTxs_Call) RunAndReturn(run func(context.Context) (*coretypes.ResultUnconfirmedTxs, error)) *RemoteClient_NumUnconfirmedTxs_Call { + _c.Call.Return(run) + return _c +} + // Remote provides a mock function with given fields: func (_m *RemoteClient) Remote() string { ret := _m.Called() @@ -818,6 +1580,33 @@ func (_m *RemoteClient) Remote() string { return r0 } +// RemoteClient_Remote_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Remote' +type RemoteClient_Remote_Call struct { + *mock.Call +} + +// Remote is a helper method to define mock.On call +func (_e *RemoteClient_Expecter) Remote() *RemoteClient_Remote_Call { + return &RemoteClient_Remote_Call{Call: _e.mock.On("Remote")} +} + +func (_c *RemoteClient_Remote_Call) Run(run func()) *RemoteClient_Remote_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *RemoteClient_Remote_Call) Return(_a0 string) *RemoteClient_Remote_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RemoteClient_Remote_Call) RunAndReturn(run func() string) *RemoteClient_Remote_Call { + _c.Call.Return(run) + 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) @@ -836,6 +1625,35 @@ func (_m *RemoteClient) RemoveTx(_a0 context.Context, _a1 types.TxKey) error { return r0 } +// RemoteClient_RemoveTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveTx' +type RemoteClient_RemoveTx_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *RemoteClient_RemoveTx_Call) Run(run func(_a0 context.Context, _a1 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) + return _c +} + +func (_c *RemoteClient_RemoveTx_Call) RunAndReturn(run func(context.Context, 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) @@ -854,6 +1672,34 @@ func (_m *RemoteClient) Start(_a0 context.Context) error { return r0 } +// RemoteClient_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type RemoteClient_Start_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *RemoteClient_Start_Call) Run(run func(_a0 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) + return _c +} + +func (_c *RemoteClient_Start_Call) RunAndReturn(run func(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) @@ -884,6 +1730,34 @@ func (_m *RemoteClient) Status(_a0 context.Context) (*coretypes.ResultStatus, er return r0, r1 } +// RemoteClient_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status' +type RemoteClient_Status_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *RemoteClient_Status_Call) Run(run func(_a0 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) + return _c +} + +func (_c *RemoteClient_Status_Call) RunAndReturn(run func(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)) @@ -921,6 +1795,44 @@ func (_m *RemoteClient) Subscribe(ctx context.Context, subscriber string, query return r0, r1 } +// RemoteClient_Subscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Subscribe' +type RemoteClient_Subscribe_Call struct { + *mock.Call +} + +// Subscribe is a helper method to define mock.On call +// - ctx context.Context +// - subscriber string +// - query string +// - outCapacity ...int +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...)...)} +} + +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) + } + } + run(args[0].(context.Context), args[1].(string), args[2].(string), variadicArgs...) + }) + return _c +} + +func (_c *RemoteClient_Subscribe_Call) Return(out <-chan coretypes.ResultEvent, err error) *RemoteClient_Subscribe_Call { + _c.Call.Return(out, err) + return _c +} + +func (_c *RemoteClient_Subscribe_Call) RunAndReturn(run func(context.Context, string, string, ...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) @@ -951,6 +1863,36 @@ func (_m *RemoteClient) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) return r0, r1 } +// RemoteClient_Tx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Tx' +type RemoteClient_Tx_Call struct { + *mock.Call +} + +// Tx is a helper method to define mock.On call +// - ctx context.Context +// - hash bytes.HexBytes +// - prove bool +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)} +} + +func (_c *RemoteClient_Tx_Call) Run(run func(ctx context.Context, hash bytes.HexBytes, prove bool)) *RemoteClient_Tx_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(bytes.HexBytes), args[2].(bool)) + }) + return _c +} + +func (_c *RemoteClient_Tx_Call) Return(_a0 *coretypes.ResultTx, _a1 error) *RemoteClient_Tx_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RemoteClient_Tx_Call) RunAndReturn(run func(context.Context, bytes.HexBytes, 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) @@ -981,6 +1923,39 @@ func (_m *RemoteClient) TxSearch(ctx context.Context, query string, prove bool, return r0, r1 } +// RemoteClient_TxSearch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'TxSearch' +type RemoteClient_TxSearch_Call struct { + *mock.Call +} + +// TxSearch is a helper method to define mock.On call +// - ctx context.Context +// - query string +// - prove bool +// - page *int +// - perPage *int +// - orderBy string +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)} +} + +func (_c *RemoteClient_TxSearch_Call) Run(run func(ctx context.Context, query string, prove bool, page *int, perPage *int, orderBy string)) *RemoteClient_TxSearch_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(bool), args[3].(*int), args[4].(*int), args[5].(string)) + }) + return _c +} + +func (_c *RemoteClient_TxSearch_Call) Return(_a0 *coretypes.ResultTxSearch, _a1 error) *RemoteClient_TxSearch_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RemoteClient_TxSearch_Call) RunAndReturn(run func(context.Context, string, bool, *int, *int, string) (*coretypes.ResultTxSearch, error)) *RemoteClient_TxSearch_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) @@ -1011,6 +1986,36 @@ func (_m *RemoteClient) UnconfirmedTxs(ctx context.Context, page *int, perPage * return r0, r1 } +// RemoteClient_UnconfirmedTxs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnconfirmedTxs' +type RemoteClient_UnconfirmedTxs_Call struct { + *mock.Call +} + +// UnconfirmedTxs is a helper method to define mock.On call +// - ctx context.Context +// - page *int +// - perPage *int +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)} +} + +func (_c *RemoteClient_UnconfirmedTxs_Call) Run(run func(ctx context.Context, page *int, perPage *int)) *RemoteClient_UnconfirmedTxs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*int), args[2].(*int)) + }) + return _c +} + +func (_c *RemoteClient_UnconfirmedTxs_Call) Return(_a0 *coretypes.ResultUnconfirmedTxs, _a1 error) *RemoteClient_UnconfirmedTxs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RemoteClient_UnconfirmedTxs_Call) RunAndReturn(run func(context.Context, *int, *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) @@ -1029,6 +2034,36 @@ func (_m *RemoteClient) Unsubscribe(ctx context.Context, subscriber string, quer return r0 } +// RemoteClient_Unsubscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unsubscribe' +type RemoteClient_Unsubscribe_Call struct { + *mock.Call +} + +// Unsubscribe is a helper method to define mock.On call +// - ctx context.Context +// - subscriber string +// - query string +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)} +} + +func (_c *RemoteClient_Unsubscribe_Call) Run(run func(ctx context.Context, subscriber string, query string)) *RemoteClient_Unsubscribe_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *RemoteClient_Unsubscribe_Call) Return(_a0 error) *RemoteClient_Unsubscribe_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RemoteClient_Unsubscribe_Call) RunAndReturn(run func(context.Context, string, 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) @@ -1047,6 +2082,35 @@ func (_m *RemoteClient) UnsubscribeAll(ctx context.Context, subscriber string) e return r0 } +// RemoteClient_UnsubscribeAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnsubscribeAll' +type RemoteClient_UnsubscribeAll_Call struct { + *mock.Call +} + +// UnsubscribeAll is a helper method to define mock.On call +// - ctx context.Context +// - subscriber string +func (_e *RemoteClient_Expecter) UnsubscribeAll(ctx interface{}, subscriber interface{}) *RemoteClient_UnsubscribeAll_Call { + return &RemoteClient_UnsubscribeAll_Call{Call: _e.mock.On("UnsubscribeAll", ctx, subscriber)} +} + +func (_c *RemoteClient_UnsubscribeAll_Call) Run(run func(ctx context.Context, subscriber string)) *RemoteClient_UnsubscribeAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *RemoteClient_UnsubscribeAll_Call) Return(_a0 error) *RemoteClient_UnsubscribeAll_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *RemoteClient_UnsubscribeAll_Call) RunAndReturn(run func(context.Context, 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) @@ -1077,6 +2141,38 @@ func (_m *RemoteClient) Validators(ctx context.Context, height *int64, page *int return r0, r1 } +// RemoteClient_Validators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Validators' +type RemoteClient_Validators_Call struct { + *mock.Call +} + +// Validators is a helper method to define mock.On call +// - ctx context.Context +// - height *int64 +// - page *int +// - perPage *int +// - requestQuorumInfo *bool +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)} +} + +func (_c *RemoteClient_Validators_Call) Run(run func(ctx context.Context, height *int64, page *int, perPage *int, requestQuorumInfo *bool)) *RemoteClient_Validators_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*int64), args[2].(*int), args[3].(*int), args[4].(*bool)) + }) + return _c +} + +func (_c *RemoteClient_Validators_Call) Return(_a0 *coretypes.ResultValidators, _a1 error) *RemoteClient_Validators_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RemoteClient_Validators_Call) RunAndReturn(run func(context.Context, *int64, *int, *int, *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 { diff --git a/scripts/mockery_generate.sh b/scripts/mockery_generate.sh index 66d1fbbd1..f9e94f77a 100755 --- a/scripts/mockery_generate.sh +++ b/scripts/mockery_generate.sh @@ -6,10 +6,11 @@ # 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.46.3 +VERSION=v2.49.1 if ! mockery --version 2>/dev/null | grep $VERSION; then - echo "Please install mockery $VERSION" + 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 fi diff --git a/types/mocks/blockeventpublisher.go b/types/mocks/blockeventpublisher.go index 8f5c17f63..c94dac30f 100644 --- a/types/mocks/blockeventpublisher.go +++ b/types/mocks/blockeventpublisher.go @@ -12,6 +12,14 @@ type BlockEventPublisher struct { mock.Mock } +type BlockEventPublisher_Expecter struct { + mock *mock.Mock +} + +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) @@ -30,6 +38,34 @@ func (_m *BlockEventPublisher) PublishEventNewBlock(_a0 types.EventDataNewBlock) return r0 } +// BlockEventPublisher_PublishEventNewBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PublishEventNewBlock' +type BlockEventPublisher_PublishEventNewBlock_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *BlockEventPublisher_PublishEventNewBlock_Call) Run(run func(_a0 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) + return _c +} + +func (_c *BlockEventPublisher_PublishEventNewBlock_Call) RunAndReturn(run func(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) @@ -48,6 +84,34 @@ func (_m *BlockEventPublisher) PublishEventNewBlockHeader(_a0 types.EventDataNew return r0 } +// BlockEventPublisher_PublishEventNewBlockHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PublishEventNewBlockHeader' +type BlockEventPublisher_PublishEventNewBlockHeader_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *BlockEventPublisher_PublishEventNewBlockHeader_Call) Run(run func(_a0 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) + return _c +} + +func (_c *BlockEventPublisher_PublishEventNewBlockHeader_Call) RunAndReturn(run func(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) @@ -66,6 +130,34 @@ func (_m *BlockEventPublisher) PublishEventNewEvidence(_a0 types.EventDataNewEvi return r0 } +// BlockEventPublisher_PublishEventNewEvidence_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PublishEventNewEvidence' +type BlockEventPublisher_PublishEventNewEvidence_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *BlockEventPublisher_PublishEventNewEvidence_Call) Run(run func(_a0 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) + return _c +} + +func (_c *BlockEventPublisher_PublishEventNewEvidence_Call) RunAndReturn(run func(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) @@ -84,6 +176,34 @@ func (_m *BlockEventPublisher) PublishEventTx(_a0 types.EventDataTx) error { return r0 } +// BlockEventPublisher_PublishEventTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PublishEventTx' +type BlockEventPublisher_PublishEventTx_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *BlockEventPublisher_PublishEventTx_Call) Run(run func(_a0 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) + return _c +} + +func (_c *BlockEventPublisher_PublishEventTx_Call) RunAndReturn(run func(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) @@ -102,6 +222,34 @@ func (_m *BlockEventPublisher) PublishEventValidatorSetUpdates(_a0 types.EventDa return r0 } +// BlockEventPublisher_PublishEventValidatorSetUpdates_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PublishEventValidatorSetUpdates' +type BlockEventPublisher_PublishEventValidatorSetUpdates_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *BlockEventPublisher_PublishEventValidatorSetUpdates_Call) Run(run func(_a0 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) + return _c +} + +func (_c *BlockEventPublisher_PublishEventValidatorSetUpdates_Call) RunAndReturn(run func(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 { diff --git a/types/mocks/privvalidator.go b/types/mocks/privvalidator.go index 94c966348..dc21796ed 100644 --- a/types/mocks/privvalidator.go +++ b/types/mocks/privvalidator.go @@ -24,6 +24,14 @@ type PrivValidator struct { mock.Mock } +type PrivValidator_Expecter struct { + mock *mock.Mock +} + +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) @@ -44,6 +52,35 @@ func (_m *PrivValidator) ExtractIntoValidator(ctx context.Context, quorumHash cr return r0 } +// PrivValidator_ExtractIntoValidator_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ExtractIntoValidator' +type PrivValidator_ExtractIntoValidator_Call struct { + *mock.Call +} + +// ExtractIntoValidator is a helper method to define mock.On call +// - ctx context.Context +// - quorumHash crypto.QuorumHash +func (_e *PrivValidator_Expecter) ExtractIntoValidator(ctx interface{}, quorumHash interface{}) *PrivValidator_ExtractIntoValidator_Call { + return &PrivValidator_ExtractIntoValidator_Call{Call: _e.mock.On("ExtractIntoValidator", ctx, quorumHash)} +} + +func (_c *PrivValidator_ExtractIntoValidator_Call) Run(run func(ctx context.Context, quorumHash crypto.QuorumHash)) *PrivValidator_ExtractIntoValidator_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(crypto.QuorumHash)) + }) + return _c +} + +func (_c *PrivValidator_ExtractIntoValidator_Call) Return(_a0 *types.Validator) *PrivValidator_ExtractIntoValidator_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PrivValidator_ExtractIntoValidator_Call) RunAndReturn(run func(context.Context, 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) @@ -74,6 +111,34 @@ func (_m *PrivValidator) GetFirstQuorumHash(_a0 context.Context) (crypto.QuorumH return r0, r1 } +// PrivValidator_GetFirstQuorumHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFirstQuorumHash' +type PrivValidator_GetFirstQuorumHash_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *PrivValidator_GetFirstQuorumHash_Call) Run(run func(_a0 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) + return _c +} + +func (_c *PrivValidator_GetFirstQuorumHash_Call) RunAndReturn(run func(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) @@ -102,6 +167,35 @@ func (_m *PrivValidator) GetHeight(ctx context.Context, quorumHash crypto.Quorum return r0, r1 } +// PrivValidator_GetHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetHeight' +type PrivValidator_GetHeight_Call struct { + *mock.Call +} + +// GetHeight is a helper method to define mock.On call +// - ctx context.Context +// - quorumHash crypto.QuorumHash +func (_e *PrivValidator_Expecter) GetHeight(ctx interface{}, quorumHash interface{}) *PrivValidator_GetHeight_Call { + return &PrivValidator_GetHeight_Call{Call: _e.mock.On("GetHeight", ctx, quorumHash)} +} + +func (_c *PrivValidator_GetHeight_Call) Run(run func(ctx context.Context, quorumHash crypto.QuorumHash)) *PrivValidator_GetHeight_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(crypto.QuorumHash)) + }) + return _c +} + +func (_c *PrivValidator_GetHeight_Call) Return(_a0 int64, _a1 error) *PrivValidator_GetHeight_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PrivValidator_GetHeight_Call) RunAndReturn(run func(context.Context, 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) @@ -132,6 +226,35 @@ func (_m *PrivValidator) GetPrivateKey(ctx context.Context, quorumHash crypto.Qu return r0, r1 } +// PrivValidator_GetPrivateKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPrivateKey' +type PrivValidator_GetPrivateKey_Call struct { + *mock.Call +} + +// GetPrivateKey is a helper method to define mock.On call +// - ctx context.Context +// - quorumHash crypto.QuorumHash +func (_e *PrivValidator_Expecter) GetPrivateKey(ctx interface{}, quorumHash interface{}) *PrivValidator_GetPrivateKey_Call { + return &PrivValidator_GetPrivateKey_Call{Call: _e.mock.On("GetPrivateKey", ctx, quorumHash)} +} + +func (_c *PrivValidator_GetPrivateKey_Call) Run(run func(ctx context.Context, quorumHash crypto.QuorumHash)) *PrivValidator_GetPrivateKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(crypto.QuorumHash)) + }) + return _c +} + +func (_c *PrivValidator_GetPrivateKey_Call) Return(_a0 crypto.PrivKey, _a1 error) *PrivValidator_GetPrivateKey_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PrivValidator_GetPrivateKey_Call) RunAndReturn(run func(context.Context, 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) @@ -162,6 +285,34 @@ func (_m *PrivValidator) GetProTxHash(_a0 context.Context) (crypto.ProTxHash, er return r0, r1 } +// PrivValidator_GetProTxHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProTxHash' +type PrivValidator_GetProTxHash_Call struct { + *mock.Call +} + +// 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)} +} + +func (_c *PrivValidator_GetProTxHash_Call) Run(run func(_a0 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) + return _c +} + +func (_c *PrivValidator_GetProTxHash_Call) RunAndReturn(run func(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) @@ -192,6 +343,35 @@ func (_m *PrivValidator) GetPubKey(ctx context.Context, quorumHash crypto.Quorum return r0, r1 } +// PrivValidator_GetPubKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPubKey' +type PrivValidator_GetPubKey_Call struct { + *mock.Call +} + +// GetPubKey is a helper method to define mock.On call +// - ctx context.Context +// - quorumHash crypto.QuorumHash +func (_e *PrivValidator_Expecter) GetPubKey(ctx interface{}, quorumHash interface{}) *PrivValidator_GetPubKey_Call { + return &PrivValidator_GetPubKey_Call{Call: _e.mock.On("GetPubKey", ctx, quorumHash)} +} + +func (_c *PrivValidator_GetPubKey_Call) Run(run func(ctx context.Context, quorumHash crypto.QuorumHash)) *PrivValidator_GetPubKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(crypto.QuorumHash)) + }) + return _c +} + +func (_c *PrivValidator_GetPubKey_Call) Return(_a0 crypto.PubKey, _a1 error) *PrivValidator_GetPubKey_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PrivValidator_GetPubKey_Call) RunAndReturn(run func(context.Context, 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) @@ -222,6 +402,35 @@ func (_m *PrivValidator) GetThresholdPublicKey(ctx context.Context, quorumHash c return r0, r1 } +// PrivValidator_GetThresholdPublicKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetThresholdPublicKey' +type PrivValidator_GetThresholdPublicKey_Call struct { + *mock.Call +} + +// GetThresholdPublicKey is a helper method to define mock.On call +// - ctx context.Context +// - quorumHash crypto.QuorumHash +func (_e *PrivValidator_Expecter) GetThresholdPublicKey(ctx interface{}, quorumHash interface{}) *PrivValidator_GetThresholdPublicKey_Call { + return &PrivValidator_GetThresholdPublicKey_Call{Call: _e.mock.On("GetThresholdPublicKey", ctx, quorumHash)} +} + +func (_c *PrivValidator_GetThresholdPublicKey_Call) Run(run func(ctx context.Context, quorumHash crypto.QuorumHash)) *PrivValidator_GetThresholdPublicKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(crypto.QuorumHash)) + }) + return _c +} + +func (_c *PrivValidator_GetThresholdPublicKey_Call) Return(_a0 crypto.PubKey, _a1 error) *PrivValidator_GetThresholdPublicKey_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PrivValidator_GetThresholdPublicKey_Call) RunAndReturn(run func(context.Context, 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) @@ -252,6 +461,38 @@ func (_m *PrivValidator) SignProposal(ctx context.Context, chainID string, quoru return r0, r1 } +// PrivValidator_SignProposal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignProposal' +type PrivValidator_SignProposal_Call struct { + *mock.Call +} + +// SignProposal is a helper method to define mock.On call +// - ctx context.Context +// - chainID string +// - quorumType btcjson.LLMQType +// - quorumHash crypto.QuorumHash +// - proposal *tenderminttypes.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 { + _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)) + }) + return _c +} + +func (_c *PrivValidator_SignProposal_Call) Return(_a0 bytes.HexBytes, _a1 error) *PrivValidator_SignProposal_Call { + _c.Call.Return(_a0, _a1) + 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 { + _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) @@ -270,11 +511,76 @@ func (_m *PrivValidator) SignVote(ctx context.Context, chainID string, quorumTyp return r0 } +// PrivValidator_SignVote_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SignVote' +type PrivValidator_SignVote_Call struct { + *mock.Call +} + +// 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 +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 { + _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)) + }) + return _c +} + +func (_c *PrivValidator_SignVote_Call) Return(_a0 error) *PrivValidator_SignVote_Call { + _c.Call.Return(_a0) + 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 { + _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) } +// PrivValidator_UpdatePrivateKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePrivateKey' +type PrivValidator_UpdatePrivateKey_Call struct { + *mock.Call +} + +// UpdatePrivateKey is a helper method to define mock.On call +// - ctx context.Context +// - privateKey crypto.PrivKey +// - quorumHash crypto.QuorumHash +// - thresholdPublicKey crypto.PubKey +// - height int64 +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)} +} + +func (_c *PrivValidator_UpdatePrivateKey_Call) Run(run func(ctx context.Context, privateKey crypto.PrivKey, quorumHash crypto.QuorumHash, thresholdPublicKey crypto.PubKey, height int64)) *PrivValidator_UpdatePrivateKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(crypto.PrivKey), args[2].(crypto.QuorumHash), args[3].(crypto.PubKey), args[4].(int64)) + }) + return _c +} + +func (_c *PrivValidator_UpdatePrivateKey_Call) Return() *PrivValidator_UpdatePrivateKey_Call { + _c.Call.Return() + return _c +} + +func (_c *PrivValidator_UpdatePrivateKey_Call) RunAndReturn(run func(context.Context, crypto.PrivKey, crypto.QuorumHash, crypto.PubKey, int64)) *PrivValidator_UpdatePrivateKey_Call { + _c.Call.Return(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 {