diff --git a/.github/workflows/check-generated.yml b/.github/workflows/check-generated.yml index 54471d1c3f..f8703ac002 100644 --- a/.github/workflows/check-generated.yml +++ b/.github/workflows/check-generated.yml @@ -31,11 +31,11 @@ jobs: run: | set -euo pipefail - readonly MOCKERY=2.46.2 # N.B. no leading "v" + readonly MOCKERY=2.46.3 # 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 - if ! git diff --stat --exit-code ; then + if ! git diff --exit-code ; then echo ">> ERROR:" echo ">>" echo ">> Generated mocks require update (either Mockery or source files may have changed)." diff --git a/.mockery.yaml b/.mockery.yaml new file mode 100644 index 0000000000..80776dad4b --- /dev/null +++ b/.mockery.yaml @@ -0,0 +1,71 @@ +--- +with-expecter: false +dir: "{{.InterfaceDir}}/mocks" +mockname: "{{.InterfaceName}}" +outpkg: "mocks" +filename: "{{.InterfaceName | lower}}.go" +log-level: "warn" +disable-version-string: true +all: false +packages: + github.com/dashpay/tenderdash/abci/client: + interfaces: + Client: + github.com/dashpay/tenderdash/abci/types: + interfaces: + Application: + github.com/dashpay/tenderdash/dash/core: + interfaces: + Client: + github.com/dashpay/tenderdash/internal/consensus: + interfaces: + Gossiper: + github.com/dashpay/tenderdash/internal/consensus/versioned/selectproposer: + interfaces: + ProposerSelector: + github.com/dashpay/tenderdash/internal/evidence: + interfaces: + BlockStore: + github.com/dashpay/tenderdash/internal/mempool: + interfaces: + Mempool: + github.com/dashpay/tenderdash/internal/p2p: + interfaces: + Transport: + Connection: + Channel: + github.com/dashpay/tenderdash/internal/p2p/client: + interfaces: + Client: + BlockClient: + SnapshotClient: + github.com/dashpay/tenderdash/internal/state: + interfaces: + BlockStore: + EvidencePool: + Executor: + Store: + github.com/dashpay/tenderdash/internal/state/indexer: + interfaces: + EventSink: + github.com/dashpay/tenderdash/internal/statesync: + interfaces: + StateProvider: + github.com/dashpay/tenderdash/libs/store: + interfaces: + Store: + github.com/dashpay/tenderdash/light/provider: + interfaces: + Provider: + github.com/dashpay/tenderdash/light/rpc: + interfaces: + LightClient: + github.com/dashpay/tenderdash/rpc/client: + interfaces: + Client: + RemoteClient: + github.com/dashpay/tenderdash/types: + interfaces: + Store: + PrivValidator: + BlockEventPublisher: diff --git a/Makefile b/Makefile index 011256ad9b..fefd7ccc73 100644 --- a/Makefile +++ b/Makefile @@ -314,7 +314,7 @@ build-docker: ############################################################################### mockery: - go generate -run="./scripts/mockery_generate.sh" ./... + ./scripts/mockery_generate.sh .PHONY: mockery ############################################################################### diff --git a/cmd/tenderdash/commands/reindex_event_test.go b/cmd/tenderdash/commands/reindex_event_test.go index 7ee321c586..de55ad924e 100644 --- a/cmd/tenderdash/commands/reindex_event_test.go +++ b/cmd/tenderdash/commands/reindex_event_test.go @@ -13,6 +13,7 @@ import ( abcitypes "github.com/dashpay/tenderdash/abci/types" "github.com/dashpay/tenderdash/config" "github.com/dashpay/tenderdash/internal/state/indexer" + indexermocks "github.com/dashpay/tenderdash/internal/state/indexer/mocks" "github.com/dashpay/tenderdash/internal/state/mocks" "github.com/dashpay/tenderdash/libs/log" "github.com/dashpay/tenderdash/proto/tendermint/state" @@ -136,7 +137,7 @@ func TestLoadBlockStore(t *testing.T) { func TestReIndexEvent(t *testing.T) { mockBlockStore := &mocks.BlockStore{} mockStateStore := &mocks.Store{} - mockEventSink := &mocks.EventSink{} + mockEventSink := &indexermocks.EventSink{} mockBlockStore. On("Base").Return(base). diff --git a/go.mod b/go.mod index 54f87581c9..149e488f03 100644 --- a/go.mod +++ b/go.mod @@ -51,7 +51,7 @@ require ( github.com/creachadair/taskgroup v0.12.0 github.com/go-pkgz/jrpc v0.2.0 github.com/google/go-cmp v0.6.0 - github.com/vektra/mockery/v2 v2.46.2 + github.com/vektra/mockery/v2 v2.46.3 ) require ( diff --git a/go.sum b/go.sum index 35bd591134..cda2b07f72 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.2 h1:bpUncWvkiDzqn+aWwt4dY1aS0F8Ob4k8+WJrWU/Kh4s= -github.com/vektra/mockery/v2 v2.46.2/go.mod h1:dDivqi0ShM8A29mLgZn13yZ14MdXlTM4V360u8JDWCQ= +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/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/blocksync/mocks/block_client.go b/internal/blocksync/mocks/block_client.go deleted file mode 100644 index bdf95bee04..0000000000 --- a/internal/blocksync/mocks/block_client.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package mocks - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - - promise "github.com/dashpay/tenderdash/libs/promise" - blocksync "github.com/dashpay/tenderdash/proto/tendermint/blocksync" - types "github.com/dashpay/tenderdash/types" -) - -// BlockClient is an autogenerated mock type for the BlockClient type -type BlockClient struct { - mock.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) - - var r0 *promise.Promise[*blocksync.BlockResponse] - if rf, ok := ret.Get(0).(func(context.Context, int64, types.NodeID) *promise.Promise[*blocksync.BlockResponse]); ok { - r0 = rf(ctx, height, peerID) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*promise.Promise[*blocksync.BlockResponse]) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, int64, types.NodeID) error); ok { - r1 = rf(ctx, height, peerID) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Send provides a mock function with given fields: ctx, msg -func (_m *BlockClient) Send(ctx context.Context, msg interface{}) error { - ret := _m.Called(ctx, msg) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, interface{}) error); ok { - r0 = rf(ctx, msg) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -type mockConstructorTestingTNewBlockClient interface { - mock.TestingT - Cleanup(func()) -} - -// 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. -func NewBlockClient(t mockConstructorTestingTNewBlockClient) *BlockClient { - mock := &BlockClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/internal/consensus/mocks/fast_sync_reactor.go b/internal/consensus/mocks/fast_sync_reactor.go deleted file mode 100644 index ea4907e268..0000000000 --- a/internal/consensus/mocks/fast_sync_reactor.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by mockery 2.7.5. DO NOT EDIT. - -package mocks - -import ( - mock "github.com/stretchr/testify/mock" - - state "github.com/dashpay/tenderdash/internal/state" - - time "time" -) - -// BlockSyncReactor is an autogenerated mock type for the BlockSyncReactor type -type BlockSyncReactor struct { - mock.Mock -} - -// GetMaxPeerBlockHeight provides a mock function with given fields: -func (_m *BlockSyncReactor) GetMaxPeerBlockHeight() int64 { - ret := _m.Called() - - var r0 int64 - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int64) - } - - return r0 -} - -// GetRemainingSyncTime provides a mock function with given fields: -func (_m *BlockSyncReactor) GetRemainingSyncTime() time.Duration { - ret := _m.Called() - - var r0 time.Duration - if rf, ok := ret.Get(0).(func() time.Duration); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(time.Duration) - } - - return r0 -} - -// GetTotalSyncedTime provides a mock function with given fields: -func (_m *BlockSyncReactor) GetTotalSyncedTime() time.Duration { - ret := _m.Called() - - var r0 time.Duration - if rf, ok := ret.Get(0).(func() time.Duration); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(time.Duration) - } - - return r0 -} - -// SwitchToBlockSync provides a mock function with given fields: _a0 -func (_m *BlockSyncReactor) SwitchToBlockSync(_a0 state.State) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(state.State) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} diff --git a/internal/consensus/versioned/selectproposer/mocks/proposer_selector.go b/internal/consensus/versioned/selectproposer/mocks/proposerselector.go similarity index 100% rename from internal/consensus/versioned/selectproposer/mocks/proposer_selector.go rename to internal/consensus/versioned/selectproposer/mocks/proposerselector.go diff --git a/internal/evidence/mocks/block_store.go b/internal/evidence/mocks/blockstore.go similarity index 100% rename from internal/evidence/mocks/block_store.go rename to internal/evidence/mocks/blockstore.go diff --git a/internal/p2p/client/mocks/block_client.go b/internal/p2p/client/mocks/blockclient.go similarity index 100% rename from internal/p2p/client/mocks/block_client.go rename to internal/p2p/client/mocks/blockclient.go diff --git a/internal/p2p/client/mocks/snapshot_client.go b/internal/p2p/client/mocks/snapshotclient.go similarity index 100% rename from internal/p2p/client/mocks/snapshot_client.go rename to internal/p2p/client/mocks/snapshotclient.go diff --git a/internal/proxy/mocks/app_conn_mempool.go b/internal/proxy/mocks/app_conn_mempool.go deleted file mode 100644 index 67a1f7e382..0000000000 --- a/internal/proxy/mocks/app_conn_mempool.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package mocks - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - - types "github.com/dashpay/tenderdash/abci/types" -) - -// AppConnMempool is an autogenerated mock type for the AppConnMempool type -type AppConnMempool struct { - mock.Mock -} - -// CheckTx provides a mock function with given fields: _a0, _a1 -func (_m *AppConnMempool) CheckTx(_a0 context.Context, _a1 types.RequestCheckTx) (*types.ResponseCheckTx, error) { - ret := _m.Called(_a0, _a1) - - var r0 *types.ResponseCheckTx - if rf, ok := ret.Get(0).(func(context.Context, types.RequestCheckTx) *types.ResponseCheckTx); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseCheckTx) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, types.RequestCheckTx) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Error provides a mock function with given fields: -func (_m *AppConnMempool) Error() error { - ret := _m.Called() - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Flush provides a mock function with given fields: _a0 -func (_m *AppConnMempool) Flush(_a0 context.Context) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} diff --git a/internal/proxy/mocks/app_conn_query.go b/internal/proxy/mocks/app_conn_query.go deleted file mode 100644 index 996bc2eef2..0000000000 --- a/internal/proxy/mocks/app_conn_query.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package mocks - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - - types "github.com/dashpay/tenderdash/abci/types" -) - -// AppConnQuery is an autogenerated mock type for the AppConnQuery type -type AppConnQuery struct { - mock.Mock -} - -// Echo provides a mock function with given fields: _a0, _a1 -func (_m *AppConnQuery) Echo(_a0 context.Context, _a1 string) (*types.ResponseEcho, error) { - ret := _m.Called(_a0, _a1) - - var r0 *types.ResponseEcho - if rf, ok := ret.Get(0).(func(context.Context, string) *types.ResponseEcho); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseEcho) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Error provides a mock function with given fields: -func (_m *AppConnQuery) Error() error { - ret := _m.Called() - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Info provides a mock function with given fields: _a0, _a1 -func (_m *AppConnQuery) Info(_a0 context.Context, _a1 types.RequestInfo) (*types.ResponseInfo, error) { - ret := _m.Called(_a0, _a1) - - var r0 *types.ResponseInfo - if rf, ok := ret.Get(0).(func(context.Context, types.RequestInfo) *types.ResponseInfo); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseInfo) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, types.RequestInfo) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Query provides a mock function with given fields: _a0, _a1 -func (_m *AppConnQuery) Query(_a0 context.Context, _a1 types.RequestQuery) (*types.ResponseQuery, error) { - ret := _m.Called(_a0, _a1) - - var r0 *types.ResponseQuery - if rf, ok := ret.Get(0).(func(context.Context, types.RequestQuery) *types.ResponseQuery); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseQuery) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, types.RequestQuery) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} diff --git a/internal/proxy/mocks/app_conn_snapshot.go b/internal/proxy/mocks/app_conn_snapshot.go deleted file mode 100644 index 4b438e16a5..0000000000 --- a/internal/proxy/mocks/app_conn_snapshot.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package mocks - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - - types "github.com/dashpay/tenderdash/abci/types" -) - -// AppConnSnapshot is an autogenerated mock type for the AppConnSnapshot type -type AppConnSnapshot struct { - mock.Mock -} - -// ApplySnapshotChunk provides a mock function with given fields: _a0, _a1 -func (_m *AppConnSnapshot) ApplySnapshotChunk(_a0 context.Context, _a1 types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error) { - ret := _m.Called(_a0, _a1) - - var r0 *types.ResponseApplySnapshotChunk - if rf, ok := ret.Get(0).(func(context.Context, types.RequestApplySnapshotChunk) *types.ResponseApplySnapshotChunk); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseApplySnapshotChunk) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, types.RequestApplySnapshotChunk) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Error provides a mock function with given fields: -func (_m *AppConnSnapshot) Error() error { - ret := _m.Called() - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ListSnapshots provides a mock function with given fields: _a0, _a1 -func (_m *AppConnSnapshot) ListSnapshots(_a0 context.Context, _a1 types.RequestListSnapshots) (*types.ResponseListSnapshots, error) { - ret := _m.Called(_a0, _a1) - - var r0 *types.ResponseListSnapshots - if rf, ok := ret.Get(0).(func(context.Context, types.RequestListSnapshots) *types.ResponseListSnapshots); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseListSnapshots) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, types.RequestListSnapshots) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// LoadSnapshotChunk provides a mock function with given fields: _a0, _a1 -func (_m *AppConnSnapshot) LoadSnapshotChunk(_a0 context.Context, _a1 types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error) { - ret := _m.Called(_a0, _a1) - - var r0 *types.ResponseLoadSnapshotChunk - if rf, ok := ret.Get(0).(func(context.Context, types.RequestLoadSnapshotChunk) *types.ResponseLoadSnapshotChunk); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseLoadSnapshotChunk) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, types.RequestLoadSnapshotChunk) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// OfferSnapshot provides a mock function with given fields: _a0, _a1 -func (_m *AppConnSnapshot) OfferSnapshot(_a0 context.Context, _a1 types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error) { - ret := _m.Called(_a0, _a1) - - var r0 *types.ResponseOfferSnapshot - if rf, ok := ret.Get(0).(func(context.Context, types.RequestOfferSnapshot) *types.ResponseOfferSnapshot); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.ResponseOfferSnapshot) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, types.RequestOfferSnapshot) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} diff --git a/internal/state/indexer/mocks/event_sink.go b/internal/state/indexer/mocks/eventsink.go similarity index 100% rename from internal/state/indexer/mocks/event_sink.go rename to internal/state/indexer/mocks/eventsink.go diff --git a/internal/state/mocks/block_store.go b/internal/state/mocks/blockstore.go similarity index 100% rename from internal/state/mocks/block_store.go rename to internal/state/mocks/blockstore.go diff --git a/internal/state/mocks/event_sink.go b/internal/state/mocks/event_sink.go deleted file mode 100644 index 6d2d679432..0000000000 --- a/internal/state/mocks/event_sink.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by mockery 2.7.5. DO NOT EDIT. - -package mocks - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" - - indexer "github.com/dashpay/tenderdash/internal/state/indexer" - - query "github.com/dashpay/tenderdash/internal/pubsub/query" - - tenderminttypes "github.com/dashpay/tenderdash/types" - - types "github.com/dashpay/tenderdash/abci/types" -) - -// EventSink is an autogenerated mock type for the EventSink type -type EventSink struct { - mock.Mock -} - -// GetTxByHash provides a mock function with given fields: _a0 -func (_m *EventSink) GetTxByHash(_a0 []byte) (*types.TxResult, error) { - ret := _m.Called(_a0) - - var r0 *types.TxResult - if rf, ok := ret.Get(0).(func([]byte) *types.TxResult); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.TxResult) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func([]byte) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// HasBlock provides a mock function with given fields: _a0 -func (_m *EventSink) HasBlock(_a0 int64) (bool, error) { - ret := _m.Called(_a0) - - var r0 bool - if rf, ok := ret.Get(0).(func(int64) bool); ok { - r0 = rf(_a0) - } else { - r0 = ret.Get(0).(bool) - } - - var r1 error - if rf, ok := ret.Get(1).(func(int64) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// IndexBlockEvents provides a mock function with given fields: _a0 -func (_m *EventSink) IndexBlockEvents(_a0 tenderminttypes.EventDataNewBlockHeader) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func(tenderminttypes.EventDataNewBlockHeader) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// IndexTxEvents provides a mock function with given fields: _a0 -func (_m *EventSink) IndexTxEvents(_a0 []*types.TxResult) error { - ret := _m.Called(_a0) - - var r0 error - if rf, ok := ret.Get(0).(func([]*types.TxResult) error); ok { - r0 = rf(_a0) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// 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) - - var r0 []int64 - if rf, ok := ret.Get(0).(func(context.Context, *query.Query) []int64); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]int64) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, *query.Query) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// 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) - - var r0 []*types.TxResult - if rf, ok := ret.Get(0).(func(context.Context, *query.Query) []*types.TxResult); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*types.TxResult) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, *query.Query) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Stop provides a mock function with given fields: -func (_m *EventSink) Stop() error { - ret := _m.Called() - - var r0 error - if rf, ok := ret.Get(0).(func() error); ok { - r0 = rf() - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Type provides a mock function with given fields: -func (_m *EventSink) Type() indexer.EventSinkType { - ret := _m.Called() - - var r0 indexer.EventSinkType - if rf, ok := ret.Get(0).(func() indexer.EventSinkType); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(indexer.EventSinkType) - } - - return r0 -} diff --git a/internal/state/mocks/evidence_pool.go b/internal/state/mocks/evidencepool.go similarity index 100% rename from internal/state/mocks/evidence_pool.go rename to internal/state/mocks/evidencepool.go diff --git a/internal/statesync/mocks/Metricer.go b/internal/statesync/mocks/Metricer.go deleted file mode 100644 index c4721b304e..0000000000 --- a/internal/statesync/mocks/Metricer.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by mockery 2.9.4. DO NOT EDIT. - -package mocks - -import ( - mock "github.com/stretchr/testify/mock" - - time "time" -) - -// Metricer is an autogenerated mock type for the Metricer type -type Metricer struct { - mock.Mock -} - -// BackFillBlocksTotal provides a mock function with given fields: -func (_m *Metricer) BackFillBlocksTotal() int64 { - ret := _m.Called() - - var r0 int64 - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int64) - } - - return r0 -} - -// BackFilledBlocks provides a mock function with given fields: -func (_m *Metricer) BackFilledBlocks() int64 { - ret := _m.Called() - - var r0 int64 - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int64) - } - - return r0 -} - -// ChunkProcessAvgTime provides a mock function with given fields: -func (_m *Metricer) ChunkProcessAvgTime() time.Duration { - ret := _m.Called() - - var r0 time.Duration - if rf, ok := ret.Get(0).(func() time.Duration); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(time.Duration) - } - - return r0 -} - -// SnapshotChunksCount provides a mock function with given fields: -func (_m *Metricer) SnapshotChunksCount() int64 { - ret := _m.Called() - - var r0 int64 - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int64) - } - - return r0 -} - -// SnapshotChunksTotal provides a mock function with given fields: -func (_m *Metricer) SnapshotChunksTotal() int64 { - ret := _m.Called() - - var r0 int64 - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int64) - } - - return r0 -} - -// SnapshotHeight provides a mock function with given fields: -func (_m *Metricer) SnapshotHeight() int64 { - ret := _m.Called() - - var r0 int64 - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int64) - } - - return r0 -} - -// TotalSnapshots provides a mock function with given fields: -func (_m *Metricer) TotalSnapshots() int64 { - ret := _m.Called() - - var r0 int64 - if rf, ok := ret.Get(0).(func() int64); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(int64) - } - - return r0 -} diff --git a/internal/statesync/mocks/state_provider.go b/internal/statesync/mocks/stateprovider.go similarity index 100% rename from internal/statesync/mocks/state_provider.go rename to internal/statesync/mocks/stateprovider.go diff --git a/light/rpc/mocks/light_client.go b/light/rpc/mocks/lightclient.go similarity index 100% rename from light/rpc/mocks/light_client.go rename to light/rpc/mocks/lightclient.go diff --git a/rpc/client/mocks/abci_client.go b/rpc/client/mocks/abci_client.go deleted file mode 100644 index 3d0cc35ca5..0000000000 --- a/rpc/client/mocks/abci_client.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package mocks - -import ( - bytes "github.com/dashpay/tenderdash/libs/bytes" - client "github.com/dashpay/tenderdash/rpc/client" - - context "context" - - coretypes "github.com/dashpay/tenderdash/rpc/coretypes" - - mock "github.com/stretchr/testify/mock" - - types "github.com/dashpay/tenderdash/types" -) - -// ABCIClient is an autogenerated mock type for the ABCIClient type -type ABCIClient struct { - mock.Mock -} - -// ABCIInfo provides a mock function with given fields: _a0 -func (_m *ABCIClient) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ABCIInfo") - } - - var r0 *coretypes.ResultABCIInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultABCIInfo, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultABCIInfo); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultABCIInfo) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ABCIQuery provides a mock function with given fields: ctx, path, data -func (_m *ABCIClient) ABCIQuery(ctx context.Context, path string, data bytes.HexBytes) (*coretypes.ResultABCIQuery, error) { - ret := _m.Called(ctx, path, data) - - if len(ret) == 0 { - panic("no return value specified for ABCIQuery") - } - - var r0 *coretypes.ResultABCIQuery - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) (*coretypes.ResultABCIQuery, error)); ok { - return rf(ctx, path, data) - } - if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) *coretypes.ResultABCIQuery); ok { - r0 = rf(ctx, path, data) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultABCIQuery) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes) error); ok { - r1 = rf(ctx, path, data) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ABCIQueryWithOptions provides a mock function with given fields: ctx, path, data, opts -func (_m *ABCIClient) ABCIQueryWithOptions(ctx context.Context, path string, data bytes.HexBytes, opts client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error) { - ret := _m.Called(ctx, path, data, opts) - - if len(ret) == 0 { - panic("no return value specified for ABCIQueryWithOptions") - } - - var r0 *coretypes.ResultABCIQuery - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)); ok { - return rf(ctx, path, data, opts) - } - if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) *coretypes.ResultABCIQuery); ok { - r0 = rf(ctx, path, data, opts) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultABCIQuery) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) error); ok { - r1 = rf(ctx, path, data, opts) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BroadcastTx provides a mock function with given fields: _a0, _a1 -func (_m *ABCIClient) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultBroadcastTx, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for BroadcastTx") - } - - var r0 *coretypes.ResultBroadcastTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultBroadcastTx) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BroadcastTxAsync provides a mock function with given fields: _a0, _a1 -func (_m *ABCIClient) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultBroadcastTx, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for BroadcastTxAsync") - } - - var r0 *coretypes.ResultBroadcastTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultBroadcastTx) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BroadcastTxCommit provides a mock function with given fields: _a0, _a1 -func (_m *ABCIClient) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultBroadcastTxCommit, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for BroadcastTxCommit") - } - - var r0 *coretypes.ResultBroadcastTxCommit - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTxCommit, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTxCommit); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultBroadcastTxCommit) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BroadcastTxSync provides a mock function with given fields: _a0, _a1 -func (_m *ABCIClient) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultBroadcastTx, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for BroadcastTxSync") - } - - var r0 *coretypes.ResultBroadcastTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultBroadcastTx) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewABCIClient creates a new instance of ABCIClient. 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 NewABCIClient(t interface { - mock.TestingT - Cleanup(func()) -}) *ABCIClient { - mock := &ABCIClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/rpc/client/mocks/events_client.go b/rpc/client/mocks/events_client.go deleted file mode 100644 index 469ce79ada..0000000000 --- a/rpc/client/mocks/events_client.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package mocks - -import ( - context "context" - - coretypes "github.com/dashpay/tenderdash/rpc/coretypes" - mock "github.com/stretchr/testify/mock" -) - -// EventsClient is an autogenerated mock type for the EventsClient type -type EventsClient struct { - mock.Mock -} - -// Events provides a mock function with given fields: ctx, req -func (_m *EventsClient) Events(ctx context.Context, req *coretypes.RequestEvents) (*coretypes.ResultEvents, error) { - ret := _m.Called(ctx, req) - - if len(ret) == 0 { - panic("no return value specified for Events") - } - - var r0 *coretypes.ResultEvents - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) (*coretypes.ResultEvents, error)); ok { - return rf(ctx, req) - } - if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) *coretypes.ResultEvents); ok { - r0 = rf(ctx, req) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultEvents) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *coretypes.RequestEvents) error); ok { - r1 = rf(ctx, req) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewEventsClient creates a new instance of EventsClient. 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 NewEventsClient(t interface { - mock.TestingT - Cleanup(func()) -}) *EventsClient { - mock := &EventsClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/rpc/client/mocks/evidence_client.go b/rpc/client/mocks/evidence_client.go deleted file mode 100644 index fbd8316844..0000000000 --- a/rpc/client/mocks/evidence_client.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package mocks - -import ( - context "context" - - coretypes "github.com/dashpay/tenderdash/rpc/coretypes" - mock "github.com/stretchr/testify/mock" - - types "github.com/dashpay/tenderdash/types" -) - -// EvidenceClient is an autogenerated mock type for the EvidenceClient type -type EvidenceClient struct { - mock.Mock -} - -// BroadcastEvidence provides a mock function with given fields: _a0, _a1 -func (_m *EvidenceClient) BroadcastEvidence(_a0 context.Context, _a1 types.Evidence) (*coretypes.ResultBroadcastEvidence, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for BroadcastEvidence") - } - - var r0 *coretypes.ResultBroadcastEvidence - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) (*coretypes.ResultBroadcastEvidence, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) *coretypes.ResultBroadcastEvidence); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultBroadcastEvidence) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, types.Evidence) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewEvidenceClient creates a new instance of EvidenceClient. 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 NewEvidenceClient(t interface { - mock.TestingT - Cleanup(func()) -}) *EvidenceClient { - mock := &EvidenceClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/rpc/client/mocks/history_client.go b/rpc/client/mocks/history_client.go deleted file mode 100644 index f4ae961c72..0000000000 --- a/rpc/client/mocks/history_client.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package mocks - -import ( - context "context" - - coretypes "github.com/dashpay/tenderdash/rpc/coretypes" - mock "github.com/stretchr/testify/mock" -) - -// HistoryClient is an autogenerated mock type for the HistoryClient type -type HistoryClient struct { - mock.Mock -} - -// BlockchainInfo provides a mock function with given fields: ctx, minHeight, maxHeight -func (_m *HistoryClient) BlockchainInfo(ctx context.Context, minHeight int64, maxHeight int64) (*coretypes.ResultBlockchainInfo, error) { - ret := _m.Called(ctx, minHeight, maxHeight) - - if len(ret) == 0 { - panic("no return value specified for BlockchainInfo") - } - - var r0 *coretypes.ResultBlockchainInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, int64, int64) (*coretypes.ResultBlockchainInfo, error)); ok { - return rf(ctx, minHeight, maxHeight) - } - if rf, ok := ret.Get(0).(func(context.Context, int64, int64) *coretypes.ResultBlockchainInfo); ok { - r0 = rf(ctx, minHeight, maxHeight) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultBlockchainInfo) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, int64, int64) error); ok { - r1 = rf(ctx, minHeight, maxHeight) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Genesis provides a mock function with given fields: _a0 -func (_m *HistoryClient) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for Genesis") - } - - var r0 *coretypes.ResultGenesis - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultGenesis, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultGenesis); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultGenesis) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GenesisChunked provides a mock function with given fields: _a0, _a1 -func (_m *HistoryClient) GenesisChunked(_a0 context.Context, _a1 uint) (*coretypes.ResultGenesisChunk, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for GenesisChunked") - } - - var r0 *coretypes.ResultGenesisChunk - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, uint) (*coretypes.ResultGenesisChunk, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, uint) *coretypes.ResultGenesisChunk); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultGenesisChunk) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, uint) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewHistoryClient creates a new instance of HistoryClient. 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 NewHistoryClient(t interface { - mock.TestingT - Cleanup(func()) -}) *HistoryClient { - mock := &HistoryClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/rpc/client/mocks/mempool_client.go b/rpc/client/mocks/mempool_client.go deleted file mode 100644 index f294b23de2..0000000000 --- a/rpc/client/mocks/mempool_client.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package mocks - -import ( - context "context" - - coretypes "github.com/dashpay/tenderdash/rpc/coretypes" - mock "github.com/stretchr/testify/mock" - - types "github.com/dashpay/tenderdash/types" -) - -// MempoolClient is an autogenerated mock type for the MempoolClient type -type MempoolClient struct { - mock.Mock -} - -// CheckTx provides a mock function with given fields: _a0, _a1 -func (_m *MempoolClient) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultCheckTx, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for CheckTx") - } - - var r0 *coretypes.ResultCheckTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultCheckTx, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultCheckTx); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultCheckTx) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NumUnconfirmedTxs provides a mock function with given fields: _a0 -func (_m *MempoolClient) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.ResultUnconfirmedTxs, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for NumUnconfirmedTxs") - } - - var r0 *coretypes.ResultUnconfirmedTxs - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultUnconfirmedTxs, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultUnconfirmedTxs); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultUnconfirmedTxs) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// RemoveTx provides a mock function with given fields: _a0, _a1 -func (_m *MempoolClient) RemoveTx(_a0 context.Context, _a1 types.TxKey) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for RemoveTx") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, types.TxKey) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// UnconfirmedTxs provides a mock function with given fields: ctx, page, perPage -func (_m *MempoolClient) UnconfirmedTxs(ctx context.Context, page *int, perPage *int) (*coretypes.ResultUnconfirmedTxs, error) { - ret := _m.Called(ctx, page, perPage) - - if len(ret) == 0 { - panic("no return value specified for UnconfirmedTxs") - } - - var r0 *coretypes.ResultUnconfirmedTxs - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int, *int) (*coretypes.ResultUnconfirmedTxs, error)); ok { - return rf(ctx, page, perPage) - } - if rf, ok := ret.Get(0).(func(context.Context, *int, *int) *coretypes.ResultUnconfirmedTxs); ok { - r0 = rf(ctx, page, perPage) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultUnconfirmedTxs) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *int, *int) error); ok { - r1 = rf(ctx, page, perPage) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewMempoolClient creates a new instance of MempoolClient. 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 NewMempoolClient(t interface { - mock.TestingT - Cleanup(func()) -}) *MempoolClient { - mock := &MempoolClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/rpc/client/mocks/network_client.go b/rpc/client/mocks/network_client.go deleted file mode 100644 index f9ae2ea916..0000000000 --- a/rpc/client/mocks/network_client.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package mocks - -import ( - context "context" - - coretypes "github.com/dashpay/tenderdash/rpc/coretypes" - mock "github.com/stretchr/testify/mock" -) - -// NetworkClient is an autogenerated mock type for the NetworkClient type -type NetworkClient struct { - mock.Mock -} - -// ConsensusParams provides a mock function with given fields: ctx, height -func (_m *NetworkClient) ConsensusParams(ctx context.Context, height *int64) (*coretypes.ResultConsensusParams, error) { - ret := _m.Called(ctx, height) - - if len(ret) == 0 { - panic("no return value specified for ConsensusParams") - } - - var r0 *coretypes.ResultConsensusParams - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultConsensusParams, error)); ok { - return rf(ctx, height) - } - if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultConsensusParams); ok { - r0 = rf(ctx, height) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultConsensusParams) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { - r1 = rf(ctx, height) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ConsensusState provides a mock function with given fields: _a0 -func (_m *NetworkClient) ConsensusState(_a0 context.Context) (*coretypes.ResultConsensusState, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for ConsensusState") - } - - var r0 *coretypes.ResultConsensusState - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultConsensusState, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultConsensusState); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultConsensusState) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// DumpConsensusState provides a mock function with given fields: _a0 -func (_m *NetworkClient) DumpConsensusState(_a0 context.Context) (*coretypes.ResultDumpConsensusState, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for DumpConsensusState") - } - - var r0 *coretypes.ResultDumpConsensusState - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultDumpConsensusState, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultDumpConsensusState); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultDumpConsensusState) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Health provides a mock function with given fields: _a0 -func (_m *NetworkClient) Health(_a0 context.Context) (*coretypes.ResultHealth, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for Health") - } - - var r0 *coretypes.ResultHealth - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultHealth, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultHealth); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultHealth) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NetInfo provides a mock function with given fields: _a0 -func (_m *NetworkClient) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for NetInfo") - } - - var r0 *coretypes.ResultNetInfo - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultNetInfo, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultNetInfo); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultNetInfo) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewNetworkClient creates a new instance of NetworkClient. 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 NewNetworkClient(t interface { - mock.TestingT - Cleanup(func()) -}) *NetworkClient { - mock := &NetworkClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/rpc/client/mocks/remote_client.go b/rpc/client/mocks/remoteclient.go similarity index 100% rename from rpc/client/mocks/remote_client.go rename to rpc/client/mocks/remoteclient.go diff --git a/rpc/client/mocks/sign_client.go b/rpc/client/mocks/sign_client.go deleted file mode 100644 index dea02efa1d..0000000000 --- a/rpc/client/mocks/sign_client.go +++ /dev/null @@ -1,332 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package mocks - -import ( - bytes "github.com/dashpay/tenderdash/libs/bytes" - - context "context" - - coretypes "github.com/dashpay/tenderdash/rpc/coretypes" - - mock "github.com/stretchr/testify/mock" -) - -// SignClient is an autogenerated mock type for the SignClient type -type SignClient struct { - mock.Mock -} - -// Block provides a mock function with given fields: ctx, height -func (_m *SignClient) Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error) { - ret := _m.Called(ctx, height) - - if len(ret) == 0 { - panic("no return value specified for Block") - } - - var r0 *coretypes.ResultBlock - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlock, error)); ok { - return rf(ctx, height) - } - if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlock); ok { - r0 = rf(ctx, height) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultBlock) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { - r1 = rf(ctx, height) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BlockByHash provides a mock function with given fields: ctx, hash -func (_m *SignClient) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*coretypes.ResultBlock, error) { - ret := _m.Called(ctx, hash) - - if len(ret) == 0 { - panic("no return value specified for BlockByHash") - } - - var r0 *coretypes.ResultBlock - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultBlock, error)); ok { - return rf(ctx, hash) - } - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultBlock); ok { - r0 = rf(ctx, hash) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultBlock) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { - r1 = rf(ctx, hash) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BlockResults provides a mock function with given fields: ctx, height -func (_m *SignClient) BlockResults(ctx context.Context, height *int64) (*coretypes.ResultBlockResults, error) { - ret := _m.Called(ctx, height) - - if len(ret) == 0 { - panic("no return value specified for BlockResults") - } - - var r0 *coretypes.ResultBlockResults - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlockResults, error)); ok { - return rf(ctx, height) - } - if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlockResults); ok { - r0 = rf(ctx, height) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultBlockResults) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { - r1 = rf(ctx, height) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BlockSearch provides a mock function with given fields: ctx, query, page, perPage, orderBy -func (_m *SignClient) BlockSearch(ctx context.Context, query string, page *int, perPage *int, orderBy string) (*coretypes.ResultBlockSearch, error) { - ret := _m.Called(ctx, query, page, perPage, orderBy) - - if len(ret) == 0 { - panic("no return value specified for BlockSearch") - } - - var r0 *coretypes.ResultBlockSearch - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) (*coretypes.ResultBlockSearch, error)); ok { - return rf(ctx, query, page, perPage, orderBy) - } - if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) *coretypes.ResultBlockSearch); ok { - r0 = rf(ctx, query, page, perPage, orderBy) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultBlockSearch) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, *int, *int, string) error); ok { - r1 = rf(ctx, query, page, perPage, orderBy) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Commit provides a mock function with given fields: ctx, height -func (_m *SignClient) Commit(ctx context.Context, height *int64) (*coretypes.ResultCommit, error) { - ret := _m.Called(ctx, height) - - if len(ret) == 0 { - panic("no return value specified for Commit") - } - - var r0 *coretypes.ResultCommit - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultCommit, error)); ok { - return rf(ctx, height) - } - if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultCommit); ok { - r0 = rf(ctx, height) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultCommit) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { - r1 = rf(ctx, height) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Header provides a mock function with given fields: ctx, height -func (_m *SignClient) Header(ctx context.Context, height *int64) (*coretypes.ResultHeader, error) { - ret := _m.Called(ctx, height) - - if len(ret) == 0 { - panic("no return value specified for Header") - } - - var r0 *coretypes.ResultHeader - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultHeader, error)); ok { - return rf(ctx, height) - } - if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultHeader); ok { - r0 = rf(ctx, height) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultHeader) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { - r1 = rf(ctx, height) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// HeaderByHash provides a mock function with given fields: ctx, hash -func (_m *SignClient) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*coretypes.ResultHeader, error) { - ret := _m.Called(ctx, hash) - - if len(ret) == 0 { - panic("no return value specified for HeaderByHash") - } - - var r0 *coretypes.ResultHeader - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultHeader, error)); ok { - return rf(ctx, hash) - } - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultHeader); ok { - r0 = rf(ctx, hash) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultHeader) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { - r1 = rf(ctx, hash) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Tx provides a mock function with given fields: ctx, hash, prove -func (_m *SignClient) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) (*coretypes.ResultTx, error) { - ret := _m.Called(ctx, hash, prove) - - if len(ret) == 0 { - panic("no return value specified for Tx") - } - - var r0 *coretypes.ResultTx - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) (*coretypes.ResultTx, error)); ok { - return rf(ctx, hash, prove) - } - if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) *coretypes.ResultTx); ok { - r0 = rf(ctx, hash, prove) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultTx) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes, bool) error); ok { - r1 = rf(ctx, hash, prove) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// TxSearch provides a mock function with given fields: ctx, query, prove, page, perPage, orderBy -func (_m *SignClient) 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) - - if len(ret) == 0 { - panic("no return value specified for TxSearch") - } - - var r0 *coretypes.ResultTxSearch - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) (*coretypes.ResultTxSearch, error)); ok { - return rf(ctx, query, prove, page, perPage, orderBy) - } - if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) *coretypes.ResultTxSearch); ok { - r0 = rf(ctx, query, prove, page, perPage, orderBy) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultTxSearch) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, bool, *int, *int, string) error); ok { - r1 = rf(ctx, query, prove, page, perPage, orderBy) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Validators provides a mock function with given fields: ctx, height, page, perPage, requestQuorumInfo -func (_m *SignClient) Validators(ctx context.Context, height *int64, page *int, perPage *int, requestQuorumInfo *bool) (*coretypes.ResultValidators, error) { - ret := _m.Called(ctx, height, page, perPage, requestQuorumInfo) - - if len(ret) == 0 { - panic("no return value specified for Validators") - } - - var r0 *coretypes.ResultValidators - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) (*coretypes.ResultValidators, error)); ok { - return rf(ctx, height, page, perPage, requestQuorumInfo) - } - if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) *coretypes.ResultValidators); ok { - r0 = rf(ctx, height, page, perPage, requestQuorumInfo) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultValidators) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *int64, *int, *int, *bool) error); ok { - r1 = rf(ctx, height, page, perPage, requestQuorumInfo) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewSignClient creates a new instance of SignClient. 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 NewSignClient(t interface { - mock.TestingT - Cleanup(func()) -}) *SignClient { - mock := &SignClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/rpc/client/mocks/status_client.go b/rpc/client/mocks/status_client.go deleted file mode 100644 index 71f5a6f6a5..0000000000 --- a/rpc/client/mocks/status_client.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package mocks - -import ( - context "context" - - coretypes "github.com/dashpay/tenderdash/rpc/coretypes" - mock "github.com/stretchr/testify/mock" -) - -// StatusClient is an autogenerated mock type for the StatusClient type -type StatusClient struct { - mock.Mock -} - -// Status provides a mock function with given fields: _a0 -func (_m *StatusClient) Status(_a0 context.Context) (*coretypes.ResultStatus, error) { - ret := _m.Called(_a0) - - if len(ret) == 0 { - panic("no return value specified for Status") - } - - var r0 *coretypes.ResultStatus - var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultStatus, error)); ok { - return rf(_a0) - } - if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultStatus); ok { - r0 = rf(_a0) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*coretypes.ResultStatus) - } - } - - if rf, ok := ret.Get(1).(func(context.Context) error); ok { - r1 = rf(_a0) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// NewStatusClient creates a new instance of StatusClient. 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 NewStatusClient(t interface { - mock.TestingT - Cleanup(func()) -}) *StatusClient { - mock := &StatusClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/rpc/client/mocks/subscription_client.go b/rpc/client/mocks/subscription_client.go deleted file mode 100644 index 84095a2b03..0000000000 --- a/rpc/client/mocks/subscription_client.go +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package mocks - -import ( - context "context" - - coretypes "github.com/dashpay/tenderdash/rpc/coretypes" - mock "github.com/stretchr/testify/mock" -) - -// SubscriptionClient is an autogenerated mock type for the SubscriptionClient type -type SubscriptionClient struct { - mock.Mock -} - -// Subscribe provides a mock function with given fields: ctx, subscriber, query, outCapacity -func (_m *SubscriptionClient) Subscribe(ctx context.Context, subscriber string, query string, outCapacity ...int) (<-chan coretypes.ResultEvent, error) { - _va := make([]interface{}, len(outCapacity)) - for _i := range outCapacity { - _va[_i] = outCapacity[_i] - } - var _ca []interface{} - _ca = append(_ca, ctx, subscriber, query) - _ca = append(_ca, _va...) - ret := _m.Called(_ca...) - - if len(ret) == 0 { - panic("no return value specified for Subscribe") - } - - var r0 <-chan coretypes.ResultEvent - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) (<-chan coretypes.ResultEvent, error)); ok { - return rf(ctx, subscriber, query, outCapacity...) - } - if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) <-chan coretypes.ResultEvent); ok { - r0 = rf(ctx, subscriber, query, outCapacity...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(<-chan coretypes.ResultEvent) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, string, string, ...int) error); ok { - r1 = rf(ctx, subscriber, query, outCapacity...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Unsubscribe provides a mock function with given fields: ctx, subscriber, query -func (_m *SubscriptionClient) Unsubscribe(ctx context.Context, subscriber string, query string) error { - ret := _m.Called(ctx, subscriber, query) - - if len(ret) == 0 { - panic("no return value specified for Unsubscribe") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, string) error); ok { - r0 = rf(ctx, subscriber, query) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// UnsubscribeAll provides a mock function with given fields: ctx, subscriber -func (_m *SubscriptionClient) UnsubscribeAll(ctx context.Context, subscriber string) error { - ret := _m.Called(ctx, subscriber) - - if len(ret) == 0 { - panic("no return value specified for UnsubscribeAll") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, subscriber) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// NewSubscriptionClient creates a new instance of SubscriptionClient. 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 NewSubscriptionClient(t interface { - mock.TestingT - Cleanup(func()) -}) *SubscriptionClient { - mock := &SubscriptionClient{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/scripts/mockery_generate.sh b/scripts/mockery_generate.sh index 022f8c1367..66d1fbbd19 100755 --- a/scripts/mockery_generate.sh +++ b/scripts/mockery_generate.sh @@ -6,11 +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.2 +VERSION=v2.46.3 if ! mockery --version 2>/dev/null | grep $VERSION; then echo "Please install mockery $VERSION" exit 1 fi -mockery --disable-version-string --case underscore --name "$@" +mockery diff --git a/types/mocks/block_event_publisher.go b/types/mocks/blockeventpublisher.go similarity index 100% rename from types/mocks/block_event_publisher.go rename to types/mocks/blockeventpublisher.go diff --git a/types/mocks/priv_validator.go b/types/mocks/privvalidator.go similarity index 100% rename from types/mocks/priv_validator.go rename to types/mocks/privvalidator.go