mirror of
https://github.com/getAlby/hub.git
synced 2026-08-13 12:33:39 +02:00
* fix: fetch currencies through alby backend api * fix: pass currency to bitcoin rate handler
293 lines
8.7 KiB
Go
293 lines
8.7 KiB
Go
// Code generated by mockery; DO NOT EDIT.
|
|
// github.com/vektra/mockery
|
|
// template: testify
|
|
|
|
package mocks
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/getAlby/hub/alby"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// NewMockAlbyService creates a new instance of MockAlbyService. 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 NewMockAlbyService(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *MockAlbyService {
|
|
mock := &MockAlbyService{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|
|
|
|
// MockAlbyService is an autogenerated mock type for the AlbyService type
|
|
type MockAlbyService struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type MockAlbyService_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *MockAlbyService) EXPECT() *MockAlbyService_Expecter {
|
|
return &MockAlbyService_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// GetBitcoinRate provides a mock function for the type MockAlbyService
|
|
func (_mock *MockAlbyService) GetBitcoinRate(ctx context.Context, currency string) (*alby.BitcoinRate, error) {
|
|
ret := _mock.Called(ctx, currency)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetBitcoinRate")
|
|
}
|
|
|
|
var r0 *alby.BitcoinRate
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*alby.BitcoinRate, error)); ok {
|
|
return returnFunc(ctx, currency)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context, string) *alby.BitcoinRate); ok {
|
|
r0 = returnFunc(ctx, currency)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*alby.BitcoinRate)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = returnFunc(ctx, currency)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// MockAlbyService_GetBitcoinRate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBitcoinRate'
|
|
type MockAlbyService_GetBitcoinRate_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetBitcoinRate is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
// - currency string
|
|
func (_e *MockAlbyService_Expecter) GetBitcoinRate(ctx interface{}, currency interface{}) *MockAlbyService_GetBitcoinRate_Call {
|
|
return &MockAlbyService_GetBitcoinRate_Call{Call: _e.mock.On("GetBitcoinRate", ctx, currency)}
|
|
}
|
|
|
|
func (_c *MockAlbyService_GetBitcoinRate_Call) Run(run func(ctx context.Context, currency string)) *MockAlbyService_GetBitcoinRate_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
var arg1 string
|
|
if args[1] != nil {
|
|
arg1 = args[1].(string)
|
|
}
|
|
run(
|
|
arg0,
|
|
arg1,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockAlbyService_GetBitcoinRate_Call) Return(bitcoinRate *alby.BitcoinRate, err error) *MockAlbyService_GetBitcoinRate_Call {
|
|
_c.Call.Return(bitcoinRate, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockAlbyService_GetBitcoinRate_Call) RunAndReturn(run func(ctx context.Context, currency string) (*alby.BitcoinRate, error)) *MockAlbyService_GetBitcoinRate_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// GetChannelPeerSuggestions provides a mock function for the type MockAlbyService
|
|
func (_mock *MockAlbyService) GetChannelPeerSuggestions(ctx context.Context) ([]alby.ChannelPeerSuggestion, error) {
|
|
ret := _mock.Called(ctx)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetChannelPeerSuggestions")
|
|
}
|
|
|
|
var r0 []alby.ChannelPeerSuggestion
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context) ([]alby.ChannelPeerSuggestion, error)); ok {
|
|
return returnFunc(ctx)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context) []alby.ChannelPeerSuggestion); ok {
|
|
r0 = returnFunc(ctx)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]alby.ChannelPeerSuggestion)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
|
|
r1 = returnFunc(ctx)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// MockAlbyService_GetChannelPeerSuggestions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetChannelPeerSuggestions'
|
|
type MockAlbyService_GetChannelPeerSuggestions_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetChannelPeerSuggestions is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
func (_e *MockAlbyService_Expecter) GetChannelPeerSuggestions(ctx interface{}) *MockAlbyService_GetChannelPeerSuggestions_Call {
|
|
return &MockAlbyService_GetChannelPeerSuggestions_Call{Call: _e.mock.On("GetChannelPeerSuggestions", ctx)}
|
|
}
|
|
|
|
func (_c *MockAlbyService_GetChannelPeerSuggestions_Call) Run(run func(ctx context.Context)) *MockAlbyService_GetChannelPeerSuggestions_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
run(
|
|
arg0,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockAlbyService_GetChannelPeerSuggestions_Call) Return(channelPeerSuggestions []alby.ChannelPeerSuggestion, err error) *MockAlbyService_GetChannelPeerSuggestions_Call {
|
|
_c.Call.Return(channelPeerSuggestions, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockAlbyService_GetChannelPeerSuggestions_Call) RunAndReturn(run func(ctx context.Context) ([]alby.ChannelPeerSuggestion, error)) *MockAlbyService_GetChannelPeerSuggestions_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// GetCurrencies provides a mock function for the type MockAlbyService
|
|
func (_mock *MockAlbyService) GetCurrencies(ctx context.Context) ([]alby.Currency, error) {
|
|
ret := _mock.Called(ctx)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetCurrencies")
|
|
}
|
|
|
|
var r0 []alby.Currency
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context) ([]alby.Currency, error)); ok {
|
|
return returnFunc(ctx)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context) []alby.Currency); ok {
|
|
r0 = returnFunc(ctx)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).([]alby.Currency)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
|
|
r1 = returnFunc(ctx)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// MockAlbyService_GetCurrencies_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCurrencies'
|
|
type MockAlbyService_GetCurrencies_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetCurrencies is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
func (_e *MockAlbyService_Expecter) GetCurrencies(ctx interface{}) *MockAlbyService_GetCurrencies_Call {
|
|
return &MockAlbyService_GetCurrencies_Call{Call: _e.mock.On("GetCurrencies", ctx)}
|
|
}
|
|
|
|
func (_c *MockAlbyService_GetCurrencies_Call) Run(run func(ctx context.Context)) *MockAlbyService_GetCurrencies_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
run(
|
|
arg0,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockAlbyService_GetCurrencies_Call) Return(currencys []alby.Currency, err error) *MockAlbyService_GetCurrencies_Call {
|
|
_c.Call.Return(currencys, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockAlbyService_GetCurrencies_Call) RunAndReturn(run func(ctx context.Context) ([]alby.Currency, error)) *MockAlbyService_GetCurrencies_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|
|
|
|
// GetInfo provides a mock function for the type MockAlbyService
|
|
func (_mock *MockAlbyService) GetInfo(ctx context.Context) (*alby.AlbyInfo, error) {
|
|
ret := _mock.Called(ctx)
|
|
|
|
if len(ret) == 0 {
|
|
panic("no return value specified for GetInfo")
|
|
}
|
|
|
|
var r0 *alby.AlbyInfo
|
|
var r1 error
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context) (*alby.AlbyInfo, error)); ok {
|
|
return returnFunc(ctx)
|
|
}
|
|
if returnFunc, ok := ret.Get(0).(func(context.Context) *alby.AlbyInfo); ok {
|
|
r0 = returnFunc(ctx)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*alby.AlbyInfo)
|
|
}
|
|
}
|
|
if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
|
|
r1 = returnFunc(ctx)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
return r0, r1
|
|
}
|
|
|
|
// MockAlbyService_GetInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetInfo'
|
|
type MockAlbyService_GetInfo_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// GetInfo is a helper method to define mock.On call
|
|
// - ctx context.Context
|
|
func (_e *MockAlbyService_Expecter) GetInfo(ctx interface{}) *MockAlbyService_GetInfo_Call {
|
|
return &MockAlbyService_GetInfo_Call{Call: _e.mock.On("GetInfo", ctx)}
|
|
}
|
|
|
|
func (_c *MockAlbyService_GetInfo_Call) Run(run func(ctx context.Context)) *MockAlbyService_GetInfo_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
var arg0 context.Context
|
|
if args[0] != nil {
|
|
arg0 = args[0].(context.Context)
|
|
}
|
|
run(
|
|
arg0,
|
|
)
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockAlbyService_GetInfo_Call) Return(albyInfo *alby.AlbyInfo, err error) *MockAlbyService_GetInfo_Call {
|
|
_c.Call.Return(albyInfo, err)
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockAlbyService_GetInfo_Call) RunAndReturn(run func(ctx context.Context) (*alby.AlbyInfo, error)) *MockAlbyService_GetInfo_Call {
|
|
_c.Call.Return(run)
|
|
return _c
|
|
}
|