diff --git a/Makefile b/Makefile index d0adc970..40bbc938 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ test: deps lint coverage.html: $(VGO) tool cover -html=coverage.txt coverage: test coverage.html -lint: +lint: $(VGO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2 GOGC=20 $(LINT) run -v --timeout 5m diff --git a/mocks/confirmationsmocks/manager.go b/mocks/confirmationsmocks/manager.go index 25a5e21e..f66ee78a 100644 --- a/mocks/confirmationsmocks/manager.go +++ b/mocks/confirmationsmocks/manager.go @@ -3,7 +3,10 @@ package confirmationsmocks import ( + context "context" + confirmations "github.com/hyperledger/firefly-transaction-manager/internal/confirmations" + ffcapi "github.com/hyperledger/firefly-transaction-manager/pkg/ffcapi" fftypes "github.com/hyperledger/firefly-common/pkg/fftypes" @@ -77,11 +80,47 @@ func (_m *Manager) Start() { _m.Called() } +// StartConfirmedBlockListener provides a mock function with given fields: ctx, id, fromBlock, checkpoint, eventStream +func (_m *Manager) StartConfirmedBlockListener(ctx context.Context, id *fftypes.UUID, fromBlock string, checkpoint *ffcapi.BlockListenerCheckpoint, eventStream chan<- *ffcapi.ListenerEvent) error { + ret := _m.Called(ctx, id, fromBlock, checkpoint, eventStream) + + if len(ret) == 0 { + panic("no return value specified for StartConfirmedBlockListener") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *fftypes.UUID, string, *ffcapi.BlockListenerCheckpoint, chan<- *ffcapi.ListenerEvent) error); ok { + r0 = rf(ctx, id, fromBlock, checkpoint, eventStream) + } else { + r0 = ret.Error(0) + } + + return r0 +} + // Stop provides a mock function with given fields: func (_m *Manager) Stop() { _m.Called() } +// StopConfirmedBlockListener provides a mock function with given fields: ctx, id +func (_m *Manager) StopConfirmedBlockListener(ctx context.Context, id *fftypes.UUID) error { + ret := _m.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for StopConfirmedBlockListener") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *fftypes.UUID) error); ok { + r0 = rf(ctx, id) + } else { + r0 = ret.Error(0) + } + + return r0 +} + // NewManager creates a new instance of Manager. 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 NewManager(t interface { diff --git a/mocks/metricsmocks/event_metrics_emitter.go b/mocks/metricsmocks/event_metrics_emitter.go index 443b9e58..45ac88e1 100644 --- a/mocks/metricsmocks/event_metrics_emitter.go +++ b/mocks/metricsmocks/event_metrics_emitter.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.40.2. DO NOT EDIT. +// Code generated by mockery v2.43.1. DO NOT EDIT. package metricsmocks diff --git a/mocks/persistencemocks/persistence.go b/mocks/persistencemocks/persistence.go index bfc37775..42e68796 100644 --- a/mocks/persistencemocks/persistence.go +++ b/mocks/persistencemocks/persistence.go @@ -23,17 +23,17 @@ type Persistence struct { mock.Mock } -// AddSubStatusAction provides a mock function with given fields: ctx, txID, subStatus, action, info, err -func (_m *Persistence) AddSubStatusAction(ctx context.Context, txID string, subStatus apitypes.TxSubStatus, action apitypes.TxAction, info *fftypes.JSONAny, err *fftypes.JSONAny) error { - ret := _m.Called(ctx, txID, subStatus, action, info, err) +// AddSubStatusAction provides a mock function with given fields: ctx, txID, subStatus, action, info, err, actionOccurred +func (_m *Persistence) AddSubStatusAction(ctx context.Context, txID string, subStatus apitypes.TxSubStatus, action apitypes.TxAction, info *fftypes.JSONAny, err *fftypes.JSONAny, actionOccurred *fftypes.FFTime) error { + ret := _m.Called(ctx, txID, subStatus, action, info, err, actionOccurred) if len(ret) == 0 { panic("no return value specified for AddSubStatusAction") } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, apitypes.TxSubStatus, apitypes.TxAction, *fftypes.JSONAny, *fftypes.JSONAny) error); ok { - r0 = rf(ctx, txID, subStatus, action, info, err) + if rf, ok := ret.Get(0).(func(context.Context, string, apitypes.TxSubStatus, apitypes.TxAction, *fftypes.JSONAny, *fftypes.JSONAny, *fftypes.FFTime) error); ok { + r0 = rf(ctx, txID, subStatus, action, info, err, actionOccurred) } else { r0 = ret.Error(0) }