diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 2c8d88f..82ba0ab 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -25,8 +25,6 @@ jobs: uses: actions/setup-go@v2 - run: | go version - go install -mod=mod github.com/golang/mock/mockgen - go generate ./... go clean -modcache go mod tidy diff --git a/.gitignore b/.gitignore index 31e787e..247dbfd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ .env .idea -mocks coverage.out local/ \ No newline at end of file diff --git a/mocks/events/mockEvents.go b/mocks/events/mockEvents.go new file mode 100644 index 0000000..452f4e8 --- /dev/null +++ b/mocks/events/mockEvents.go @@ -0,0 +1,50 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: events/events.go + +// Package mock_events is a generated GoMock package. +package mock_events + +import ( + reflect "reflect" + + events "github.com/gateway-fm/perpsv3-Go/events" + gomock "github.com/golang/mock/gomock" +) + +// MockIEvents is a mock of IEvents interface. +type MockIEvents struct { + ctrl *gomock.Controller + recorder *MockIEventsMockRecorder +} + +// MockIEventsMockRecorder is the mock recorder for MockIEvents. +type MockIEventsMockRecorder struct { + mock *MockIEvents +} + +// NewMockIEvents creates a new mock instance. +func NewMockIEvents(ctrl *gomock.Controller) *MockIEvents { + mock := &MockIEvents{ctrl: ctrl} + mock.recorder = &MockIEventsMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockIEvents) EXPECT() *MockIEventsMockRecorder { + return m.recorder +} + +// ListenTrades mocks base method. +func (m *MockIEvents) ListenTrades() (*events.TradeSubscription, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListenTrades") + ret0, _ := ret[0].(*events.TradeSubscription) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListenTrades indicates an expected call of ListenTrades. +func (mr *MockIEventsMockRecorder) ListenTrades() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListenTrades", reflect.TypeOf((*MockIEvents)(nil).ListenTrades)) +} diff --git a/mocks/service/mockService.go b/mocks/service/mockService.go new file mode 100644 index 0000000..603c8a3 --- /dev/null +++ b/mocks/service/mockService.go @@ -0,0 +1,50 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: services/service.go + +// Package mock_services is a generated GoMock package. +package mock_services + +import ( + reflect "reflect" + + models "github.com/gateway-fm/perpsv3-Go/models" + gomock "github.com/golang/mock/gomock" +) + +// MockIService is a mock of IService interface. +type MockIService struct { + ctrl *gomock.Controller + recorder *MockIServiceMockRecorder +} + +// MockIServiceMockRecorder is the mock recorder for MockIService. +type MockIServiceMockRecorder struct { + mock *MockIService +} + +// NewMockIService creates a new mock instance. +func NewMockIService(ctrl *gomock.Controller) *MockIService { + mock := &MockIService{ctrl: ctrl} + mock.recorder = &MockIServiceMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockIService) EXPECT() *MockIServiceMockRecorder { + return m.recorder +} + +// RetrieveTrades mocks base method. +func (m *MockIService) RetrieveTrades(fromBlock uint64, toBLock *uint64) ([]*models.Trade, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RetrieveTrades", fromBlock, toBLock) + ret0, _ := ret[0].([]*models.Trade) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// RetrieveTrades indicates an expected call of RetrieveTrades. +func (mr *MockIServiceMockRecorder) RetrieveTrades(fromBlock, toBLock interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RetrieveTrades", reflect.TypeOf((*MockIService)(nil).RetrieveTrades), fromBlock, toBLock) +}