diff --git a/abci/client/client.go b/abci/client/client.go index dca406feb..5827ee18f 100644 --- a/abci/client/client.go +++ b/abci/client/client.go @@ -14,6 +14,8 @@ const ( echoRetryIntervalSeconds = 1 ) +//go:generate ../../scripts/mockery_generate.sh Client + // Client defines an interface for an ABCI client. // All `Async` methods return a `ReqRes` object. // All `Sync` methods return the appropriate protobuf ResponseXxx struct and an error. diff --git a/abci/client/mocks/client.go b/abci/client/mocks/client.go index 6d7f99b0f..03249447b 100644 --- a/abci/client/mocks/client.go +++ b/abci/client/mocks/client.go @@ -1,4 +1,4 @@ -// Code generated by mockery v1.1.1. DO NOT EDIT. +// Code generated by mockery. DO NOT EDIT. package mocks @@ -575,6 +575,45 @@ func (_m *Client) OnStop() { _m.Called() } +// PrepareProposalAsync provides a mock function with given fields: _a0 +func (_m *Client) PrepareProposalAsync(_a0 types.RequestPrepareProposal) *abcicli.ReqRes { + ret := _m.Called(_a0) + + var r0 *abcicli.ReqRes + if rf, ok := ret.Get(0).(func(types.RequestPrepareProposal) *abcicli.ReqRes); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*abcicli.ReqRes) + } + } + + return r0 +} + +// PrepareProposalSync provides a mock function with given fields: _a0 +func (_m *Client) PrepareProposalSync(_a0 types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error) { + ret := _m.Called(_a0) + + var r0 *types.ResponsePrepareProposal + if rf, ok := ret.Get(0).(func(types.RequestPrepareProposal) *types.ResponsePrepareProposal); ok { + r0 = rf(_a0) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.ResponsePrepareProposal) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func(types.RequestPrepareProposal) error); ok { + r1 = rf(_a0) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // QueryAsync provides a mock function with given fields: _a0 func (_m *Client) QueryAsync(_a0 types.RequestQuery) *abcicli.ReqRes { ret := _m.Called(_a0) @@ -734,3 +773,18 @@ func (_m *Client) String() string { return r0 } + +type NewClientT interface { + mock.TestingT + Cleanup(func()) +} + +// 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. +func NewClient(t NewClientT) *Client { + mock := &Client{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +}