alby-hub/tests/mocks/Service.go
Adithya Vardhan 9b6e88f1cc
feat: add option to edit fee while withdrawing (#1044)
* feat: add option to edit fee while withdrawing

* chore: add alert if fee rate exceeds fastest fee

* fix: tests

* feat: add support for LDK

* chore: do not accept decimal fee rates in frontend

* chore: minor withdraw UI improvements

* chore: make fee rate optional and update mockery

* chore: remove unnecessary else

* chore: do not format lottie files

* feat: add lotties files to prettier ignore

---------

Co-authored-by: Roland Bewick <roland.bewick@gmail.com>
2025-05-29 23:38:46 +07:00

661 lines
18 KiB
Go

// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"github.com/getAlby/hub/alby"
"github.com/getAlby/hub/config"
"github.com/getAlby/hub/events"
"github.com/getAlby/hub/lnclient"
"github.com/getAlby/hub/service/keys"
"github.com/getAlby/hub/swaps"
"github.com/getAlby/hub/transactions"
mock "github.com/stretchr/testify/mock"
"gorm.io/gorm"
)
// NewMockService creates a new instance of MockService. 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 NewMockService(t interface {
mock.TestingT
Cleanup(func())
}) *MockService {
mock := &MockService{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockService is an autogenerated mock type for the Service type
type MockService struct {
mock.Mock
}
type MockService_Expecter struct {
mock *mock.Mock
}
func (_m *MockService) EXPECT() *MockService_Expecter {
return &MockService_Expecter{mock: &_m.Mock}
}
// GetAlbyOAuthSvc provides a mock function for the type MockService
func (_mock *MockService) GetAlbyOAuthSvc() alby.AlbyOAuthService {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetAlbyOAuthSvc")
}
var r0 alby.AlbyOAuthService
if returnFunc, ok := ret.Get(0).(func() alby.AlbyOAuthService); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(alby.AlbyOAuthService)
}
}
return r0
}
// MockService_GetAlbyOAuthSvc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAlbyOAuthSvc'
type MockService_GetAlbyOAuthSvc_Call struct {
*mock.Call
}
// GetAlbyOAuthSvc is a helper method to define mock.On call
func (_e *MockService_Expecter) GetAlbyOAuthSvc() *MockService_GetAlbyOAuthSvc_Call {
return &MockService_GetAlbyOAuthSvc_Call{Call: _e.mock.On("GetAlbyOAuthSvc")}
}
func (_c *MockService_GetAlbyOAuthSvc_Call) Run(run func()) *MockService_GetAlbyOAuthSvc_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockService_GetAlbyOAuthSvc_Call) Return(albyOAuthService alby.AlbyOAuthService) *MockService_GetAlbyOAuthSvc_Call {
_c.Call.Return(albyOAuthService)
return _c
}
func (_c *MockService_GetAlbyOAuthSvc_Call) RunAndReturn(run func() alby.AlbyOAuthService) *MockService_GetAlbyOAuthSvc_Call {
_c.Call.Return(run)
return _c
}
// GetConfig provides a mock function for the type MockService
func (_mock *MockService) GetConfig() config.Config {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetConfig")
}
var r0 config.Config
if returnFunc, ok := ret.Get(0).(func() config.Config); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(config.Config)
}
}
return r0
}
// MockService_GetConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConfig'
type MockService_GetConfig_Call struct {
*mock.Call
}
// GetConfig is a helper method to define mock.On call
func (_e *MockService_Expecter) GetConfig() *MockService_GetConfig_Call {
return &MockService_GetConfig_Call{Call: _e.mock.On("GetConfig")}
}
func (_c *MockService_GetConfig_Call) Run(run func()) *MockService_GetConfig_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockService_GetConfig_Call) Return(config1 config.Config) *MockService_GetConfig_Call {
_c.Call.Return(config1)
return _c
}
func (_c *MockService_GetConfig_Call) RunAndReturn(run func() config.Config) *MockService_GetConfig_Call {
_c.Call.Return(run)
return _c
}
// GetDB provides a mock function for the type MockService
func (_mock *MockService) GetDB() *gorm.DB {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetDB")
}
var r0 *gorm.DB
if returnFunc, ok := ret.Get(0).(func() *gorm.DB); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*gorm.DB)
}
}
return r0
}
// MockService_GetDB_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDB'
type MockService_GetDB_Call struct {
*mock.Call
}
// GetDB is a helper method to define mock.On call
func (_e *MockService_Expecter) GetDB() *MockService_GetDB_Call {
return &MockService_GetDB_Call{Call: _e.mock.On("GetDB")}
}
func (_c *MockService_GetDB_Call) Run(run func()) *MockService_GetDB_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockService_GetDB_Call) Return(dB *gorm.DB) *MockService_GetDB_Call {
_c.Call.Return(dB)
return _c
}
func (_c *MockService_GetDB_Call) RunAndReturn(run func() *gorm.DB) *MockService_GetDB_Call {
_c.Call.Return(run)
return _c
}
// GetEventPublisher provides a mock function for the type MockService
func (_mock *MockService) GetEventPublisher() events.EventPublisher {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetEventPublisher")
}
var r0 events.EventPublisher
if returnFunc, ok := ret.Get(0).(func() events.EventPublisher); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(events.EventPublisher)
}
}
return r0
}
// MockService_GetEventPublisher_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEventPublisher'
type MockService_GetEventPublisher_Call struct {
*mock.Call
}
// GetEventPublisher is a helper method to define mock.On call
func (_e *MockService_Expecter) GetEventPublisher() *MockService_GetEventPublisher_Call {
return &MockService_GetEventPublisher_Call{Call: _e.mock.On("GetEventPublisher")}
}
func (_c *MockService_GetEventPublisher_Call) Run(run func()) *MockService_GetEventPublisher_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockService_GetEventPublisher_Call) Return(eventPublisher events.EventPublisher) *MockService_GetEventPublisher_Call {
_c.Call.Return(eventPublisher)
return _c
}
func (_c *MockService_GetEventPublisher_Call) RunAndReturn(run func() events.EventPublisher) *MockService_GetEventPublisher_Call {
_c.Call.Return(run)
return _c
}
// GetKeys provides a mock function for the type MockService
func (_mock *MockService) GetKeys() keys.Keys {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetKeys")
}
var r0 keys.Keys
if returnFunc, ok := ret.Get(0).(func() keys.Keys); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(keys.Keys)
}
}
return r0
}
// MockService_GetKeys_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetKeys'
type MockService_GetKeys_Call struct {
*mock.Call
}
// GetKeys is a helper method to define mock.On call
func (_e *MockService_Expecter) GetKeys() *MockService_GetKeys_Call {
return &MockService_GetKeys_Call{Call: _e.mock.On("GetKeys")}
}
func (_c *MockService_GetKeys_Call) Run(run func()) *MockService_GetKeys_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockService_GetKeys_Call) Return(keys1 keys.Keys) *MockService_GetKeys_Call {
_c.Call.Return(keys1)
return _c
}
func (_c *MockService_GetKeys_Call) RunAndReturn(run func() keys.Keys) *MockService_GetKeys_Call {
_c.Call.Return(run)
return _c
}
// GetLNClient provides a mock function for the type MockService
func (_mock *MockService) GetLNClient() lnclient.LNClient {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetLNClient")
}
var r0 lnclient.LNClient
if returnFunc, ok := ret.Get(0).(func() lnclient.LNClient); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(lnclient.LNClient)
}
}
return r0
}
// MockService_GetLNClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLNClient'
type MockService_GetLNClient_Call struct {
*mock.Call
}
// GetLNClient is a helper method to define mock.On call
func (_e *MockService_Expecter) GetLNClient() *MockService_GetLNClient_Call {
return &MockService_GetLNClient_Call{Call: _e.mock.On("GetLNClient")}
}
func (_c *MockService_GetLNClient_Call) Run(run func()) *MockService_GetLNClient_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockService_GetLNClient_Call) Return(lNClient lnclient.LNClient) *MockService_GetLNClient_Call {
_c.Call.Return(lNClient)
return _c
}
func (_c *MockService_GetLNClient_Call) RunAndReturn(run func() lnclient.LNClient) *MockService_GetLNClient_Call {
_c.Call.Return(run)
return _c
}
// GetStartupState provides a mock function for the type MockService
func (_mock *MockService) GetStartupState() string {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetStartupState")
}
var r0 string
if returnFunc, ok := ret.Get(0).(func() string); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// MockService_GetStartupState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStartupState'
type MockService_GetStartupState_Call struct {
*mock.Call
}
// GetStartupState is a helper method to define mock.On call
func (_e *MockService_Expecter) GetStartupState() *MockService_GetStartupState_Call {
return &MockService_GetStartupState_Call{Call: _e.mock.On("GetStartupState")}
}
func (_c *MockService_GetStartupState_Call) Run(run func()) *MockService_GetStartupState_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockService_GetStartupState_Call) Return(s string) *MockService_GetStartupState_Call {
_c.Call.Return(s)
return _c
}
func (_c *MockService_GetStartupState_Call) RunAndReturn(run func() string) *MockService_GetStartupState_Call {
_c.Call.Return(run)
return _c
}
// GetSwapsService provides a mock function for the type MockService
func (_mock *MockService) GetSwapsService() swaps.SwapsService {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetSwapsService")
}
var r0 swaps.SwapsService
if returnFunc, ok := ret.Get(0).(func() swaps.SwapsService); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(swaps.SwapsService)
}
}
return r0
}
// MockService_GetSwapsService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSwapsService'
type MockService_GetSwapsService_Call struct {
*mock.Call
}
// GetSwapsService is a helper method to define mock.On call
func (_e *MockService_Expecter) GetSwapsService() *MockService_GetSwapsService_Call {
return &MockService_GetSwapsService_Call{Call: _e.mock.On("GetSwapsService")}
}
func (_c *MockService_GetSwapsService_Call) Run(run func()) *MockService_GetSwapsService_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockService_GetSwapsService_Call) Return(swapsService swaps.SwapsService) *MockService_GetSwapsService_Call {
_c.Call.Return(swapsService)
return _c
}
func (_c *MockService_GetSwapsService_Call) RunAndReturn(run func() swaps.SwapsService) *MockService_GetSwapsService_Call {
_c.Call.Return(run)
return _c
}
// GetTransactionsService provides a mock function for the type MockService
func (_mock *MockService) GetTransactionsService() transactions.TransactionsService {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetTransactionsService")
}
var r0 transactions.TransactionsService
if returnFunc, ok := ret.Get(0).(func() transactions.TransactionsService); ok {
r0 = returnFunc()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(transactions.TransactionsService)
}
}
return r0
}
// MockService_GetTransactionsService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTransactionsService'
type MockService_GetTransactionsService_Call struct {
*mock.Call
}
// GetTransactionsService is a helper method to define mock.On call
func (_e *MockService_Expecter) GetTransactionsService() *MockService_GetTransactionsService_Call {
return &MockService_GetTransactionsService_Call{Call: _e.mock.On("GetTransactionsService")}
}
func (_c *MockService_GetTransactionsService_Call) Run(run func()) *MockService_GetTransactionsService_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockService_GetTransactionsService_Call) Return(transactionsService transactions.TransactionsService) *MockService_GetTransactionsService_Call {
_c.Call.Return(transactionsService)
return _c
}
func (_c *MockService_GetTransactionsService_Call) RunAndReturn(run func() transactions.TransactionsService) *MockService_GetTransactionsService_Call {
_c.Call.Return(run)
return _c
}
// IsRelayReady provides a mock function for the type MockService
func (_mock *MockService) IsRelayReady() bool {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for IsRelayReady")
}
var r0 bool
if returnFunc, ok := ret.Get(0).(func() bool); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// MockService_IsRelayReady_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsRelayReady'
type MockService_IsRelayReady_Call struct {
*mock.Call
}
// IsRelayReady is a helper method to define mock.On call
func (_e *MockService_Expecter) IsRelayReady() *MockService_IsRelayReady_Call {
return &MockService_IsRelayReady_Call{Call: _e.mock.On("IsRelayReady")}
}
func (_c *MockService_IsRelayReady_Call) Run(run func()) *MockService_IsRelayReady_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockService_IsRelayReady_Call) Return(b bool) *MockService_IsRelayReady_Call {
_c.Call.Return(b)
return _c
}
func (_c *MockService_IsRelayReady_Call) RunAndReturn(run func() bool) *MockService_IsRelayReady_Call {
_c.Call.Return(run)
return _c
}
// Shutdown provides a mock function for the type MockService
func (_mock *MockService) Shutdown() {
_mock.Called()
return
}
// MockService_Shutdown_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Shutdown'
type MockService_Shutdown_Call struct {
*mock.Call
}
// Shutdown is a helper method to define mock.On call
func (_e *MockService_Expecter) Shutdown() *MockService_Shutdown_Call {
return &MockService_Shutdown_Call{Call: _e.mock.On("Shutdown")}
}
func (_c *MockService_Shutdown_Call) Run(run func()) *MockService_Shutdown_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockService_Shutdown_Call) Return() *MockService_Shutdown_Call {
_c.Call.Return()
return _c
}
func (_c *MockService_Shutdown_Call) RunAndReturn(run func()) *MockService_Shutdown_Call {
_c.Run(run)
return _c
}
// StartApp provides a mock function for the type MockService
func (_mock *MockService) StartApp(encryptionKey string) error {
ret := _mock.Called(encryptionKey)
if len(ret) == 0 {
panic("no return value specified for StartApp")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(string) error); ok {
r0 = returnFunc(encryptionKey)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockService_StartApp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartApp'
type MockService_StartApp_Call struct {
*mock.Call
}
// StartApp is a helper method to define mock.On call
// - encryptionKey string
func (_e *MockService_Expecter) StartApp(encryptionKey interface{}) *MockService_StartApp_Call {
return &MockService_StartApp_Call{Call: _e.mock.On("StartApp", encryptionKey)}
}
func (_c *MockService_StartApp_Call) Run(run func(encryptionKey string)) *MockService_StartApp_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 string
if args[0] != nil {
arg0 = args[0].(string)
}
run(
arg0,
)
})
return _c
}
func (_c *MockService_StartApp_Call) Return(err error) *MockService_StartApp_Call {
_c.Call.Return(err)
return _c
}
func (_c *MockService_StartApp_Call) RunAndReturn(run func(encryptionKey string) error) *MockService_StartApp_Call {
_c.Call.Return(run)
return _c
}
// StartAutoSwaps provides a mock function for the type MockService
func (_mock *MockService) StartAutoSwaps() error {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for StartAutoSwaps")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func() error); ok {
r0 = returnFunc()
} else {
r0 = ret.Error(0)
}
return r0
}
// MockService_StartAutoSwaps_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartAutoSwaps'
type MockService_StartAutoSwaps_Call struct {
*mock.Call
}
// StartAutoSwaps is a helper method to define mock.On call
func (_e *MockService_Expecter) StartAutoSwaps() *MockService_StartAutoSwaps_Call {
return &MockService_StartAutoSwaps_Call{Call: _e.mock.On("StartAutoSwaps")}
}
func (_c *MockService_StartAutoSwaps_Call) Run(run func()) *MockService_StartAutoSwaps_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockService_StartAutoSwaps_Call) Return(err error) *MockService_StartAutoSwaps_Call {
_c.Call.Return(err)
return _c
}
func (_c *MockService_StartAutoSwaps_Call) RunAndReturn(run func() error) *MockService_StartAutoSwaps_Call {
_c.Call.Return(run)
return _c
}
// StopApp provides a mock function for the type MockService
func (_mock *MockService) StopApp() {
_mock.Called()
return
}
// MockService_StopApp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StopApp'
type MockService_StopApp_Call struct {
*mock.Call
}
// StopApp is a helper method to define mock.On call
func (_e *MockService_Expecter) StopApp() *MockService_StopApp_Call {
return &MockService_StopApp_Call{Call: _e.mock.On("StopApp")}
}
func (_c *MockService_StopApp_Call) Run(run func()) *MockService_StopApp_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockService_StopApp_Call) Return() *MockService_StopApp_Call {
_c.Call.Return()
return _c
}
func (_c *MockService_StopApp_Call) RunAndReturn(run func()) *MockService_StopApp_Call {
_c.Run(run)
return _c
}