mirror of
https://github.com/getAlby/hub.git
synced 2026-08-13 12:33:39 +02:00
fix: prevent LN client access during shutdown (#2096)
* fix: prevent LN client access during shutdown * chore: run mockery * chore: push lnClientShuttingDown inside stopLNClient * fix: use atomic bool for synced access
This commit is contained in:
parent
3392e75a0c
commit
4efe735acf
19 changed files with 1039 additions and 295 deletions
|
|
@ -93,7 +93,7 @@ func (svc *albyOAuthService) RemoveOAuthAccessToken() error {
|
|||
return err
|
||||
}
|
||||
|
||||
func (svc *albyOAuthService) CallbackHandler(ctx context.Context, code string, lnClient lnclient.LNClient) error {
|
||||
func (svc *albyOAuthService) CallbackHandler(ctx context.Context, code string) error {
|
||||
token, err := svc.oauthConf.Exchange(ctx, code)
|
||||
if err != nil {
|
||||
logger.Logger.WithError(err).Error("Failed to exchange token")
|
||||
|
|
@ -526,6 +526,10 @@ func (svc *albyOAuthService) UnlinkAccount(ctx context.Context) error {
|
|||
}
|
||||
|
||||
func (svc *albyOAuthService) LinkAccount(ctx context.Context, lnClient lnclient.LNClient, budget uint64, renewal string) error {
|
||||
if lnClient == nil {
|
||||
return errors.New("LNClient not available")
|
||||
}
|
||||
|
||||
svc.deleteAlbyAccountApps()
|
||||
|
||||
connectionPubkey, err := svc.createAlbyAccountNWCNode(ctx)
|
||||
|
|
@ -1183,6 +1187,10 @@ func (svc *albyOAuthService) CreateLSPOrder(ctx context.Context, lsp, network st
|
|||
}
|
||||
|
||||
func (svc *albyOAuthService) RequestAutoChannel(ctx context.Context, lnClient lnclient.LNClient, isPublic bool) (*AutoChannelResponse, error) {
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not available")
|
||||
}
|
||||
|
||||
nodeInfo, err := lnClient.GetInfo(ctx)
|
||||
if err != nil {
|
||||
logger.Logger.WithError(err).Error("Failed to request own node info", err)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ type AlbyOAuthService interface {
|
|||
GetLightningAddress() (string, error)
|
||||
IsConnected(ctx context.Context) bool
|
||||
LinkAccount(ctx context.Context, lnClient lnclient.LNClient, budget uint64, renewal string) error
|
||||
CallbackHandler(ctx context.Context, code string, lnClient lnclient.LNClient) error
|
||||
CallbackHandler(ctx context.Context, code string) error
|
||||
GetMe(ctx context.Context) (*AlbyMe, error)
|
||||
UnlinkAccount(ctx context.Context) error
|
||||
RequestAutoChannel(ctx context.Context, lnClient lnclient.LNClient, isPublic bool) (*AutoChannelResponse, error)
|
||||
|
|
|
|||
119
api/api.go
119
api/api.go
|
|
@ -620,10 +620,11 @@ func (api *api) ListApps(limit uint64, offset uint64, filters ListAppsFilters, o
|
|||
}
|
||||
|
||||
func (api *api) ListChannels(ctx context.Context) ([]Channel, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
channels, err := api.svc.GetLNClient().ListChannels(ctx)
|
||||
channels, err := lnClient.ListChannels(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -689,10 +690,11 @@ func (api *api) GetLSPChannelOffer(ctx context.Context) (*alby.LSPChannelOffer,
|
|||
}
|
||||
|
||||
func (api *api) ResetRouter(key string) error {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return errors.New("LNClient not started")
|
||||
}
|
||||
err := api.svc.GetLNClient().ResetRouter(key)
|
||||
err := lnClient.ResetRouter(key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -762,10 +764,11 @@ func (api *api) Stop() error {
|
|||
}
|
||||
|
||||
func (api *api) GetNodeConnectionInfo(ctx context.Context) (*lnclient.NodeConnectionInfo, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
return api.svc.GetLNClient().GetNodeConnectionInfo(ctx)
|
||||
return lnClient.GetNodeConnectionInfo(ctx)
|
||||
}
|
||||
|
||||
func (api *api) RefundSwap(refundSwapRequest *RefundSwapRequest) error {
|
||||
|
|
@ -995,45 +998,51 @@ func (api *api) GetSwapMnemonic() string {
|
|||
}
|
||||
|
||||
func (api *api) GetNodeStatus(ctx context.Context) (*lnclient.NodeStatus, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
return api.svc.GetLNClient().GetNodeStatus(ctx)
|
||||
return lnClient.GetNodeStatus(ctx)
|
||||
}
|
||||
|
||||
func (api *api) ListPeers(ctx context.Context) ([]lnclient.PeerDetails, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
return api.svc.GetLNClient().ListPeers(ctx)
|
||||
return lnClient.ListPeers(ctx)
|
||||
}
|
||||
|
||||
func (api *api) ConnectPeer(ctx context.Context, connectPeerRequest *ConnectPeerRequest) error {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return errors.New("LNClient not started")
|
||||
}
|
||||
return api.svc.GetLNClient().ConnectPeer(ctx, connectPeerRequest)
|
||||
return lnClient.ConnectPeer(ctx, connectPeerRequest)
|
||||
}
|
||||
|
||||
func (api *api) OpenChannel(ctx context.Context, openChannelRequest *OpenChannelRequest) (*OpenChannelResponse, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
return api.svc.GetLNClient().OpenChannel(ctx, openChannelRequest)
|
||||
return lnClient.OpenChannel(ctx, openChannelRequest)
|
||||
}
|
||||
|
||||
func (api *api) DisconnectPeer(ctx context.Context, peerId string) error {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return errors.New("LNClient not started")
|
||||
}
|
||||
logger.Logger.WithFields(logrus.Fields{
|
||||
"peer_id": peerId,
|
||||
}).Info("Disconnecting peer")
|
||||
return api.svc.GetLNClient().DisconnectPeer(ctx, peerId)
|
||||
return lnClient.DisconnectPeer(ctx, peerId)
|
||||
}
|
||||
|
||||
func (api *api) CloseChannel(ctx context.Context, peerId, channelId string, force bool) (*CloseChannelResponse, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
logger.Logger.WithFields(logrus.Fields{
|
||||
|
|
@ -1041,7 +1050,7 @@ func (api *api) CloseChannel(ctx context.Context, peerId, channelId string, forc
|
|||
"channel_id": channelId,
|
||||
"force": force,
|
||||
}).Info("Closing channel")
|
||||
return api.svc.GetLNClient().CloseChannel(ctx, &lnclient.CloseChannelRequest{
|
||||
return lnClient.CloseChannel(ctx, &lnclient.CloseChannelRequest{
|
||||
NodeId: peerId,
|
||||
ChannelId: channelId,
|
||||
Force: force,
|
||||
|
|
@ -1049,20 +1058,22 @@ func (api *api) CloseChannel(ctx context.Context, peerId, channelId string, forc
|
|||
}
|
||||
|
||||
func (api *api) UpdateChannel(ctx context.Context, updateChannelRequest *UpdateChannelRequest) error {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return errors.New("LNClient not started")
|
||||
}
|
||||
logger.Logger.WithFields(logrus.Fields{
|
||||
"request": updateChannelRequest,
|
||||
}).Info("updating channel")
|
||||
return api.svc.GetLNClient().UpdateChannel(ctx, updateChannelRequest)
|
||||
return lnClient.UpdateChannel(ctx, updateChannelRequest)
|
||||
}
|
||||
|
||||
func (api *api) MakeOffer(ctx context.Context, description string) (string, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return "", errors.New("LNClient not started")
|
||||
}
|
||||
offer, err := api.svc.GetLNClient().MakeOffer(ctx, description)
|
||||
offer, err := lnClient.MakeOffer(ctx, description)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
@ -1071,10 +1082,11 @@ func (api *api) MakeOffer(ctx context.Context, description string) (string, erro
|
|||
}
|
||||
|
||||
func (api *api) GetNewOnchainAddress(ctx context.Context) (string, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return "", errors.New("LNClient not started")
|
||||
}
|
||||
address, err := api.svc.GetLNClient().GetNewOnchainAddress(ctx)
|
||||
address, err := lnClient.GetNewOnchainAddress(ctx)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
@ -1127,10 +1139,11 @@ func (api *api) GetUnusedOnchainAddress(ctx context.Context) (string, error) {
|
|||
}
|
||||
|
||||
func (api *api) SignMessage(ctx context.Context, message string) (*SignMessageResponse, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
signature, err := api.svc.GetLNClient().SignMessage(ctx, message)
|
||||
signature, err := lnClient.SignMessage(ctx, message)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -1141,10 +1154,11 @@ func (api *api) SignMessage(ctx context.Context, message string) (*SignMessageRe
|
|||
}
|
||||
|
||||
func (api *api) RedeemOnchainFunds(ctx context.Context, toAddress string, amount uint64, feeRate *uint64, sendAll bool) (*RedeemOnchainFundsResponse, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
txId, err := api.svc.GetLNClient().RedeemOnchainFunds(ctx, toAddress, amount, feeRate, sendAll)
|
||||
txId, err := lnClient.RedeemOnchainFunds(ctx, toAddress, amount, feeRate, sendAll)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -1154,10 +1168,11 @@ func (api *api) RedeemOnchainFunds(ctx context.Context, toAddress string, amount
|
|||
}
|
||||
|
||||
func (api *api) GetBalances(ctx context.Context) (*BalancesResponse, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
balances, err := api.svc.GetLNClient().GetBalances(ctx, false)
|
||||
balances, err := lnClient.GetBalances(ctx, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -1227,7 +1242,8 @@ func (api *api) GetInfo(ctx context.Context) (*InfoResponse, error) {
|
|||
info.StartupError = api.startupError.Error()
|
||||
info.StartupErrorTime = api.startupErrorTime
|
||||
}
|
||||
info.Running = api.svc.GetLNClient() != nil
|
||||
lnClient := api.svc.GetLNClient()
|
||||
info.Running = lnClient != nil
|
||||
info.BackendType = backendType
|
||||
info.AlbyAuthUrl = api.albyOAuthSvc.GetAuthUrl()
|
||||
info.OAuthRedirect = !api.cfg.GetEnv().IsDefaultClientId()
|
||||
|
|
@ -1256,8 +1272,8 @@ func (api *api) GetInfo(ctx context.Context) (*InfoResponse, error) {
|
|||
}
|
||||
info.AlbyUserIdentifier = albyUserIdentifier
|
||||
|
||||
if api.svc.GetLNClient() != nil {
|
||||
nodeInfo, err := api.svc.GetLNClient().GetInfo(ctx)
|
||||
if lnClient != nil {
|
||||
nodeInfo, err := lnClient.GetInfo(ctx)
|
||||
if err != nil {
|
||||
logger.Logger.WithError(err).Error("Failed to get nodeInfo")
|
||||
return nil, err
|
||||
|
|
@ -1470,12 +1486,13 @@ func (api *api) Setup(ctx context.Context, setupRequest *SetupRequest) error {
|
|||
}
|
||||
|
||||
func (api *api) GetWalletCapabilities(ctx context.Context) (*WalletCapabilitiesResponse, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
|
||||
methods := api.svc.GetLNClient().GetSupportedNIP47Methods()
|
||||
notificationTypes := api.svc.GetLNClient().GetSupportedNIP47NotificationTypes()
|
||||
methods := lnClient.GetSupportedNIP47Methods()
|
||||
notificationTypes := lnClient.GetSupportedNIP47NotificationTypes()
|
||||
|
||||
scopes, err := permissions.RequestMethodsToScopes(methods)
|
||||
if err != nil {
|
||||
|
|
@ -1493,12 +1510,13 @@ func (api *api) GetWalletCapabilities(ctx context.Context) (*WalletCapabilitiesR
|
|||
}
|
||||
|
||||
func (api *api) SendPaymentProbes(ctx context.Context, sendPaymentProbesRequest *SendPaymentProbesRequest) (*SendPaymentProbesResponse, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
|
||||
var errMessage string
|
||||
err := api.svc.GetLNClient().SendPaymentProbes(ctx, sendPaymentProbesRequest.Invoice)
|
||||
err := lnClient.SendPaymentProbes(ctx, sendPaymentProbesRequest.Invoice)
|
||||
if err != nil {
|
||||
errMessage = err.Error()
|
||||
}
|
||||
|
|
@ -1533,12 +1551,13 @@ func (api *api) MigrateNodeStorage(ctx context.Context, to string) error {
|
|||
}
|
||||
|
||||
func (api *api) SendSpontaneousPaymentProbes(ctx context.Context, sendSpontaneousPaymentProbesRequest *SendSpontaneousPaymentProbesRequest) (*SendSpontaneousPaymentProbesResponse, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
|
||||
var errMessage string
|
||||
err := api.svc.GetLNClient().SendSpontaneousPaymentProbes(ctx, sendSpontaneousPaymentProbesRequest.Amount, sendSpontaneousPaymentProbesRequest.NodeId)
|
||||
err := lnClient.SendSpontaneousPaymentProbes(ctx, sendSpontaneousPaymentProbesRequest.Amount, sendSpontaneousPaymentProbesRequest.NodeId)
|
||||
if err != nil {
|
||||
errMessage = err.Error()
|
||||
}
|
||||
|
|
@ -1547,24 +1566,27 @@ func (api *api) SendSpontaneousPaymentProbes(ctx context.Context, sendSpontaneou
|
|||
}
|
||||
|
||||
func (api *api) GetNetworkGraph(ctx context.Context, nodeIds []string) (NetworkGraphResponse, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
return api.svc.GetLNClient().GetNetworkGraph(ctx, nodeIds)
|
||||
return lnClient.GetNetworkGraph(ctx, nodeIds)
|
||||
}
|
||||
|
||||
func (api *api) SyncWallet() error {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return errors.New("LNClient not started")
|
||||
}
|
||||
api.svc.GetLNClient().UpdateLastWalletSyncRequest()
|
||||
lnClient.UpdateLastWalletSyncRequest()
|
||||
return nil
|
||||
}
|
||||
func (api *api) ListOnchainTransactions(ctx context.Context) ([]lnclient.OnchainTransaction, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
return api.svc.GetLNClient().ListOnchainTransactions(ctx)
|
||||
return lnClient.ListOnchainTransactions(ctx)
|
||||
}
|
||||
|
||||
func (api *api) GetLogOutput(ctx context.Context, logType string, getLogRequest *GetLogOutputRequest) (*GetLogOutputResponse, error) {
|
||||
|
|
@ -1572,11 +1594,12 @@ func (api *api) GetLogOutput(ctx context.Context, logType string, getLogRequest
|
|||
var logData []byte
|
||||
|
||||
if logType == LogTypeNode {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
|
||||
logData, err = api.svc.GetLNClient().GetLogOutput(ctx, getLogRequest.MaxLen)
|
||||
logData, err = lnClient.GetLogOutput(ctx, getLogRequest.MaxLen)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,17 +49,18 @@ func (api *api) CreateBackup(unlockPassword string, w io.Writer) error {
|
|||
|
||||
lnStorageDir := ""
|
||||
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return fmt.Errorf("node not running")
|
||||
}
|
||||
lnStorageDir, err = api.svc.GetLNClient().GetStorageDir()
|
||||
lnStorageDir, err = lnClient.GetStorageDir()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get storage dir: %w", err)
|
||||
}
|
||||
logger.Logger.WithField("path", lnStorageDir).Info("Found node storage dir")
|
||||
|
||||
// Reset the routing data to decrease the LDK DB size
|
||||
err = api.svc.GetLNClient().ResetRouter("ALL")
|
||||
err = lnClient.ResetRouter("ALL")
|
||||
if err != nil {
|
||||
logger.Logger.WithError(err).Error("Failed to reset router")
|
||||
return fmt.Errorf("failed to reset router: %w", err)
|
||||
|
|
|
|||
14
api/lsp.go
14
api/lsp.go
|
|
@ -17,8 +17,8 @@ import (
|
|||
)
|
||||
|
||||
func (api *api) RequestLSPOrder(ctx context.Context, request *LSPOrderRequest) (*LSPOrderResponse, error) {
|
||||
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ func (api *api) RequestLSPOrder(ctx context.Context, request *LSPOrderRequest) (
|
|||
|
||||
logger.Logger.Info("Requesting own node info")
|
||||
|
||||
nodeInfo, err := api.svc.GetLNClient().GetInfo(ctx)
|
||||
nodeInfo, err := lnClient.GetInfo(ctx)
|
||||
if err != nil {
|
||||
logger.Logger.WithError(err).WithFields(logrus.Fields{
|
||||
"lspIdentifier": request.LSPIdentifier,
|
||||
|
|
@ -46,7 +46,7 @@ func (api *api) RequestLSPOrder(ctx context.Context, request *LSPOrderRequest) (
|
|||
|
||||
logger.Logger.WithField("lspInfo", lspInfo).Info("Connecting to LSP node as a peer")
|
||||
|
||||
err = api.svc.GetLNClient().ConnectPeer(ctx, &lnclient.ConnectPeerRequest{
|
||||
err = lnClient.ConnectPeer(ctx, &lnclient.ConnectPeerRequest{
|
||||
Pubkey: lspInfo.Pubkey,
|
||||
Address: lspInfo.Address,
|
||||
Port: lspInfo.Port,
|
||||
|
|
@ -57,7 +57,7 @@ func (api *api) RequestLSPOrder(ctx context.Context, request *LSPOrderRequest) (
|
|||
return nil, err
|
||||
}
|
||||
|
||||
invoice, fee, err := api.requestLSPS1Invoice(ctx, request, nodeInfo.Network, nodeInfo.Pubkey, lspInfo.MaxChannelExpiryBlocks, lspInfo.MinRequiredChannelConfirmations, lspInfo.MinFundingConfirmsWithinBlocks)
|
||||
invoice, fee, err := api.requestLSPS1Invoice(ctx, lnClient, request, nodeInfo.Network, nodeInfo.Pubkey, lspInfo.MaxChannelExpiryBlocks, lspInfo.MinRequiredChannelConfirmations, lspInfo.MinFundingConfirmsWithinBlocks)
|
||||
invoiceAmount := uint64(0)
|
||||
incomingLiquidity := request.Amount
|
||||
|
||||
|
|
@ -91,8 +91,8 @@ func (api *api) RequestLSPOrder(ctx context.Context, request *LSPOrderRequest) (
|
|||
return newChannelResponse, nil
|
||||
}
|
||||
|
||||
func (api *api) requestLSPS1Invoice(ctx context.Context, request *LSPOrderRequest, network, pubkey string, channelExpiryBlocks uint64, minRequiredChannelConfirmations uint64, minFundingConfirmsWithinBlocks uint64) (invoice string, fee uint64, err error) {
|
||||
refundAddress, err := api.svc.GetLNClient().GetNewOnchainAddress(ctx)
|
||||
func (api *api) requestLSPS1Invoice(ctx context.Context, lnClient lnclient.LNClient, request *LSPOrderRequest, network, pubkey string, channelExpiryBlocks uint64, minRequiredChannelConfirmations uint64, minFundingConfirmsWithinBlocks uint64) (invoice string, fee uint64, err error) {
|
||||
refundAddress, err := lnClient.GetNewOnchainAddress(ctx)
|
||||
if err != nil {
|
||||
logger.Logger.WithError(err).Error("Failed to request onchain address")
|
||||
return "", 0, err
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@ import (
|
|||
)
|
||||
|
||||
func (api *api) RebalanceChannel(ctx context.Context, rebalanceChannelRequest *RebalanceChannelRequest) (*RebalanceChannelResponse, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
|
||||
|
|
@ -26,7 +27,7 @@ func (api *api) RebalanceChannel(ctx context.Context, rebalanceChannelRequest *R
|
|||
"receive_through": rebalanceChannelRequest.ReceiveThroughNodePubkey,
|
||||
}
|
||||
|
||||
receiveInvoice, err := api.svc.GetTransactionsService().MakeInvoice(ctx, rebalanceChannelRequest.AmountSat*1000, "Alby Hub Rebalance through "+rebalanceChannelRequest.ReceiveThroughNodePubkey, "", 0, receiveMetadata, api.svc.GetLNClient(), nil, nil, &rebalanceChannelRequest.ReceiveThroughNodePubkey)
|
||||
receiveInvoice, err := api.svc.GetTransactionsService().MakeInvoice(ctx, rebalanceChannelRequest.AmountSat*1000, "Alby Hub Rebalance through "+rebalanceChannelRequest.ReceiveThroughNodePubkey, "", 0, receiveMetadata, lnClient, nil, nil, &rebalanceChannelRequest.ReceiveThroughNodePubkey)
|
||||
if err != nil {
|
||||
logger.Logger.WithError(err).Error("failed to generate rebalance receive invoice")
|
||||
return nil, err
|
||||
|
|
@ -125,7 +126,7 @@ func (api *api) RebalanceChannel(ctx context.Context, rebalanceChannelRequest *R
|
|||
"order_id": rebalanceCreateOrderResponse.OrderId,
|
||||
}
|
||||
|
||||
payRebalanceInvoiceResponse, err := api.svc.GetTransactionsService().SendPaymentSync(rebalanceCreateOrderResponse.PayRequest, nil, payMetadata, api.svc.GetLNClient(), nil, nil)
|
||||
payRebalanceInvoiceResponse, err := api.svc.GetTransactionsService().SendPaymentSync(rebalanceCreateOrderResponse.PayRequest, nil, payMetadata, lnClient, nil, nil)
|
||||
|
||||
if err != nil {
|
||||
logger.Logger.WithError(err).Error("failed to pay rebalance invoice")
|
||||
|
|
|
|||
|
|
@ -13,10 +13,11 @@ import (
|
|||
)
|
||||
|
||||
func (api *api) CreateInvoice(ctx context.Context, amount uint64, description string) (*MakeInvoiceResponse, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
transaction, err := api.svc.GetTransactionsService().MakeInvoice(ctx, amount, description, "", 0, nil, api.svc.GetLNClient(), nil, nil, nil)
|
||||
transaction, err := api.svc.GetTransactionsService().MakeInvoice(ctx, amount, description, "", 0, nil, lnClient, nil, nil, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -24,10 +25,11 @@ func (api *api) CreateInvoice(ctx context.Context, amount uint64, description st
|
|||
}
|
||||
|
||||
func (api *api) LookupInvoice(ctx context.Context, paymentHash string) (*LookupInvoiceResponse, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
transaction, err := api.svc.GetTransactionsService().LookupTransaction(ctx, paymentHash, nil, api.svc.GetLNClient(), nil)
|
||||
transaction, err := api.svc.GetTransactionsService().LookupTransaction(ctx, paymentHash, nil, lnClient, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -35,7 +37,8 @@ func (api *api) LookupInvoice(ctx context.Context, paymentHash string) (*LookupI
|
|||
}
|
||||
|
||||
func (api *api) ListTransactions(ctx context.Context, appId *uint, limit uint64, offset uint64) (*ListTransactionsResponse, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
|
||||
|
|
@ -44,7 +47,7 @@ func (api *api) ListTransactions(ctx context.Context, appId *uint, limit uint64,
|
|||
forceFilterByAppId = true
|
||||
}
|
||||
|
||||
transactions, totalCount, err := api.svc.GetTransactionsService().ListTransactions(ctx, 0, 0, limit, offset, true, false, nil, api.svc.GetLNClient(), appId, forceFilterByAppId)
|
||||
transactions, totalCount, err := api.svc.GetTransactionsService().ListTransactions(ctx, 0, 0, limit, offset, true, false, nil, lnClient, appId, forceFilterByAppId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -61,10 +64,12 @@ func (api *api) ListTransactions(ctx context.Context, appId *uint, limit uint64,
|
|||
}
|
||||
|
||||
func (api *api) SendPayment(ctx context.Context, invoice string, amountMsat *uint64, metadata map[string]interface{}) (*SendPaymentResponse, error) {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return nil, errors.New("LNClient not started")
|
||||
}
|
||||
transaction, err := api.svc.GetTransactionsService().SendPaymentSync(invoice, amountMsat, metadata, api.svc.GetLNClient(), nil, nil)
|
||||
|
||||
transaction, err := api.svc.GetTransactionsService().SendPaymentSync(invoice, amountMsat, metadata, lnClient, nil, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -128,7 +133,8 @@ func toApiTransaction(transaction *transactions.Transaction) *Transaction {
|
|||
}
|
||||
|
||||
func (api *api) Transfer(ctx context.Context, fromAppId *uint, toAppId *uint, amountMsat uint64) error {
|
||||
if api.svc.GetLNClient() == nil {
|
||||
lnClient := api.svc.GetLNClient()
|
||||
if lnClient == nil {
|
||||
return errors.New("LNClient not started")
|
||||
}
|
||||
|
||||
|
|
@ -144,13 +150,13 @@ func (api *api) Transfer(ctx context.Context, fromAppId *uint, toAppId *uint, am
|
|||
}
|
||||
}
|
||||
|
||||
transaction, err := api.svc.GetTransactionsService().MakeInvoice(ctx, amountMsat, "transfer", "", 0, nil, api.svc.GetLNClient(), toAppId, nil, nil)
|
||||
transaction, err := api.svc.GetTransactionsService().MakeInvoice(ctx, amountMsat, "transfer", "", 0, nil, lnClient, toAppId, nil, nil)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = api.svc.GetTransactionsService().SendPaymentSync(transaction.PaymentRequest, nil, nil, api.svc.GetLNClient(), fromAppId, nil)
|
||||
_, err = api.svc.GetTransactionsService().SendPaymentSync(transaction.PaymentRequest, nil, nil, lnClient, fromAppId, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ func (albyHttpSvc *AlbyHttpService) albyBitcoinRateHandler(c echo.Context) error
|
|||
func (albyHttpSvc *AlbyHttpService) albyCallbackHandler(c echo.Context) error {
|
||||
code := c.QueryParam("code")
|
||||
|
||||
err := albyHttpSvc.albyOAuthSvc.CallbackHandler(c.Request().Context(), code, albyHttpSvc.svc.GetLNClient())
|
||||
err := albyHttpSvc.albyOAuthSvc.CallbackHandler(c.Request().Context(), code)
|
||||
if err != nil {
|
||||
logger.Logger.WithError(err).Error("Failed to handle Alby OAuth callback")
|
||||
return c.JSON(http.StatusInternalServerError, ErrorResponse{
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import (
|
|||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/adrg/xdg"
|
||||
|
|
@ -32,20 +33,21 @@ import (
|
|||
type service struct {
|
||||
cfg config.Config
|
||||
|
||||
db *gorm.DB
|
||||
lnClient lnclient.LNClient
|
||||
transactionsService transactions.TransactionsService
|
||||
swapsService swaps.SwapsService
|
||||
albySvc alby.AlbyService
|
||||
albyOAuthSvc alby.AlbyOAuthService
|
||||
eventPublisher events.EventPublisher
|
||||
ctx context.Context
|
||||
wg *sync.WaitGroup
|
||||
nip47Service nip47.Nip47Service
|
||||
appCancelFn context.CancelFunc
|
||||
keys keys.Keys
|
||||
relayStatuses []RelayStatus
|
||||
startupState string
|
||||
db *gorm.DB
|
||||
lnClient lnclient.LNClient
|
||||
lnClientShuttingDown atomic.Bool
|
||||
transactionsService transactions.TransactionsService
|
||||
swapsService swaps.SwapsService
|
||||
albySvc alby.AlbyService
|
||||
albyOAuthSvc alby.AlbyOAuthService
|
||||
eventPublisher events.EventPublisher
|
||||
ctx context.Context
|
||||
wg *sync.WaitGroup
|
||||
nip47Service nip47.Nip47Service
|
||||
appCancelFn context.CancelFunc
|
||||
keys keys.Keys
|
||||
relayStatuses []RelayStatus
|
||||
startupState string
|
||||
}
|
||||
|
||||
func NewService(ctx context.Context) (*service, error) {
|
||||
|
|
@ -256,6 +258,9 @@ func (svc *service) GetEventPublisher() events.EventPublisher {
|
|||
}
|
||||
|
||||
func (svc *service) GetLNClient() lnclient.LNClient {
|
||||
if svc.lnClientShuttingDown.Load() {
|
||||
return nil
|
||||
}
|
||||
return svc.lnClient
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ func (svc *service) startNostr(ctx context.Context) error {
|
|||
}()
|
||||
|
||||
svc.nip47Service.StartNotifier(ctx, pool)
|
||||
svc.nip47Service.StartNip47InfoPublisher(ctx, pool, svc.lnClient)
|
||||
svc.nip47Service.StartNip47InfoPublisher(ctx, pool, svc.GetLNClient())
|
||||
|
||||
// register a subscriber for events of "nwc_app_created" which handles creation of nostr subscription for new app
|
||||
createAppEventListener := &createAppConsumer{svc: svc, pool: pool}
|
||||
|
|
@ -235,7 +235,7 @@ func (svc *service) watchSubscription(ctx context.Context, pool *nostr.SimplePoo
|
|||
case <-ctx.Done():
|
||||
return
|
||||
default:
|
||||
go svc.nip47Service.HandleEvent(ctx, pool, event.Event, svc.lnClient)
|
||||
go svc.nip47Service.HandleEvent(ctx, pool, event.Event, svc.GetLNClient())
|
||||
}
|
||||
}
|
||||
logger.Logger.Debug("Relay subscription events channel ended")
|
||||
|
|
@ -301,7 +301,7 @@ func (svc *service) StartApp(encryptionKey string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
svc.swapsService = swaps.NewSwapsService(ctx, svc.db, svc.cfg, svc.keys, svc.eventPublisher, svc.lnClient, svc.transactionsService)
|
||||
svc.swapsService = swaps.NewSwapsService(ctx, svc.db, svc.cfg, svc.keys, svc.eventPublisher, svc.GetLNClient(), svc.transactionsService)
|
||||
|
||||
svc.publishAllAppInfoEvents()
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,12 @@ func (svc *service) StopApp() {
|
|||
}
|
||||
|
||||
func (svc *service) stopLNClient() {
|
||||
defer svc.wg.Done()
|
||||
svc.lnClientShuttingDown.Store(true)
|
||||
defer func() {
|
||||
svc.lnClientShuttingDown.Store(false)
|
||||
svc.wg.Done()
|
||||
}()
|
||||
|
||||
if svc.lnClient == nil {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,16 +41,16 @@ func (_m *MockAlbyOAuthService) EXPECT() *MockAlbyOAuthService_Expecter {
|
|||
}
|
||||
|
||||
// CallbackHandler provides a mock function for the type MockAlbyOAuthService
|
||||
func (_mock *MockAlbyOAuthService) CallbackHandler(ctx context.Context, code string, lnClient lnclient.LNClient) error {
|
||||
ret := _mock.Called(ctx, code, lnClient)
|
||||
func (_mock *MockAlbyOAuthService) CallbackHandler(ctx context.Context, code string) error {
|
||||
ret := _mock.Called(ctx, code)
|
||||
|
||||
if len(ret) == 0 {
|
||||
panic("no return value specified for CallbackHandler")
|
||||
}
|
||||
|
||||
var r0 error
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string, lnclient.LNClient) error); ok {
|
||||
r0 = returnFunc(ctx, code, lnClient)
|
||||
if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
|
||||
r0 = returnFunc(ctx, code)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
|
@ -63,16 +63,26 @@ type MockAlbyOAuthService_CallbackHandler_Call struct {
|
|||
}
|
||||
|
||||
// CallbackHandler is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - code
|
||||
// - lnClient
|
||||
func (_e *MockAlbyOAuthService_Expecter) CallbackHandler(ctx interface{}, code interface{}, lnClient interface{}) *MockAlbyOAuthService_CallbackHandler_Call {
|
||||
return &MockAlbyOAuthService_CallbackHandler_Call{Call: _e.mock.On("CallbackHandler", ctx, code, lnClient)}
|
||||
// - ctx context.Context
|
||||
// - code string
|
||||
func (_e *MockAlbyOAuthService_Expecter) CallbackHandler(ctx interface{}, code interface{}) *MockAlbyOAuthService_CallbackHandler_Call {
|
||||
return &MockAlbyOAuthService_CallbackHandler_Call{Call: _e.mock.On("CallbackHandler", ctx, code)}
|
||||
}
|
||||
|
||||
func (_c *MockAlbyOAuthService_CallbackHandler_Call) Run(run func(ctx context.Context, code string, lnClient lnclient.LNClient)) *MockAlbyOAuthService_CallbackHandler_Call {
|
||||
func (_c *MockAlbyOAuthService_CallbackHandler_Call) Run(run func(ctx context.Context, code string)) *MockAlbyOAuthService_CallbackHandler_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string), args[2].(lnclient.LNClient))
|
||||
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
|
||||
}
|
||||
|
|
@ -82,7 +92,7 @@ func (_c *MockAlbyOAuthService_CallbackHandler_Call) Return(err error) *MockAlby
|
|||
return _c
|
||||
}
|
||||
|
||||
func (_c *MockAlbyOAuthService_CallbackHandler_Call) RunAndReturn(run func(ctx context.Context, code string, lnClient lnclient.LNClient) error) *MockAlbyOAuthService_CallbackHandler_Call {
|
||||
func (_c *MockAlbyOAuthService_CallbackHandler_Call) RunAndReturn(run func(ctx context.Context, code string) error) *MockAlbyOAuthService_CallbackHandler_Call {
|
||||
_c.Call.Return(run)
|
||||
return _c
|
||||
}
|
||||
|
|
@ -99,16 +109,32 @@ type MockAlbyOAuthService_ConsumeEvent_Call struct {
|
|||
}
|
||||
|
||||
// ConsumeEvent is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - event
|
||||
// - globalProperties
|
||||
// - ctx context.Context
|
||||
// - event *events.Event
|
||||
// - globalProperties map[string]interface{}
|
||||
func (_e *MockAlbyOAuthService_Expecter) ConsumeEvent(ctx interface{}, event interface{}, globalProperties interface{}) *MockAlbyOAuthService_ConsumeEvent_Call {
|
||||
return &MockAlbyOAuthService_ConsumeEvent_Call{Call: _e.mock.On("ConsumeEvent", ctx, event, globalProperties)}
|
||||
}
|
||||
|
||||
func (_c *MockAlbyOAuthService_ConsumeEvent_Call) Run(run func(ctx context.Context, event *events.Event, globalProperties map[string]interface{})) *MockAlbyOAuthService_ConsumeEvent_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*events.Event), args[2].(map[string]interface{}))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *events.Event
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*events.Event)
|
||||
}
|
||||
var arg2 map[string]interface{}
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(map[string]interface{})
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -157,17 +183,38 @@ type MockAlbyOAuthService_CreateLSPOrder_Call struct {
|
|||
}
|
||||
|
||||
// CreateLSPOrder is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - lsp
|
||||
// - network
|
||||
// - lspChannelRequest
|
||||
// - ctx context.Context
|
||||
// - lsp string
|
||||
// - network string
|
||||
// - lspChannelRequest *alby.LSPChannelRequest
|
||||
func (_e *MockAlbyOAuthService_Expecter) CreateLSPOrder(ctx interface{}, lsp interface{}, network interface{}, lspChannelRequest interface{}) *MockAlbyOAuthService_CreateLSPOrder_Call {
|
||||
return &MockAlbyOAuthService_CreateLSPOrder_Call{Call: _e.mock.On("CreateLSPOrder", ctx, lsp, network, lspChannelRequest)}
|
||||
}
|
||||
|
||||
func (_c *MockAlbyOAuthService_CreateLSPOrder_Call) Run(run func(ctx context.Context, lsp string, network string, lspChannelRequest *alby.LSPChannelRequest)) *MockAlbyOAuthService_CreateLSPOrder_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(*alby.LSPChannelRequest))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
var arg3 *alby.LSPChannelRequest
|
||||
if args[3] != nil {
|
||||
arg3 = args[3].(*alby.LSPChannelRequest)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
arg3,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -216,16 +263,32 @@ type MockAlbyOAuthService_CreateLightningAddress_Call struct {
|
|||
}
|
||||
|
||||
// CreateLightningAddress is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - address
|
||||
// - appId
|
||||
// - ctx context.Context
|
||||
// - address string
|
||||
// - appId uint
|
||||
func (_e *MockAlbyOAuthService_Expecter) CreateLightningAddress(ctx interface{}, address interface{}, appId interface{}) *MockAlbyOAuthService_CreateLightningAddress_Call {
|
||||
return &MockAlbyOAuthService_CreateLightningAddress_Call{Call: _e.mock.On("CreateLightningAddress", ctx, address, appId)}
|
||||
}
|
||||
|
||||
func (_c *MockAlbyOAuthService_CreateLightningAddress_Call) Run(run func(ctx context.Context, address string, appId uint)) *MockAlbyOAuthService_CreateLightningAddress_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string), args[2].(uint))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
var arg2 uint
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(uint)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -263,15 +326,26 @@ type MockAlbyOAuthService_DeleteLightningAddress_Call struct {
|
|||
}
|
||||
|
||||
// DeleteLightningAddress is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - address
|
||||
// - ctx context.Context
|
||||
// - address string
|
||||
func (_e *MockAlbyOAuthService_Expecter) DeleteLightningAddress(ctx interface{}, address interface{}) *MockAlbyOAuthService_DeleteLightningAddress_Call {
|
||||
return &MockAlbyOAuthService_DeleteLightningAddress_Call{Call: _e.mock.On("DeleteLightningAddress", ctx, address)}
|
||||
}
|
||||
|
||||
func (_c *MockAlbyOAuthService_DeleteLightningAddress_Call) Run(run func(ctx context.Context, address string)) *MockAlbyOAuthService_DeleteLightningAddress_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
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
|
||||
}
|
||||
|
|
@ -364,14 +438,20 @@ type MockAlbyOAuthService_GetLSPChannelOffer_Call struct {
|
|||
}
|
||||
|
||||
// GetLSPChannelOffer is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - ctx context.Context
|
||||
func (_e *MockAlbyOAuthService_Expecter) GetLSPChannelOffer(ctx interface{}) *MockAlbyOAuthService_GetLSPChannelOffer_Call {
|
||||
return &MockAlbyOAuthService_GetLSPChannelOffer_Call{Call: _e.mock.On("GetLSPChannelOffer", ctx)}
|
||||
}
|
||||
|
||||
func (_c *MockAlbyOAuthService_GetLSPChannelOffer_Call) Run(run func(ctx context.Context)) *MockAlbyOAuthService_GetLSPChannelOffer_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -420,16 +500,32 @@ type MockAlbyOAuthService_GetLSPInfo_Call struct {
|
|||
}
|
||||
|
||||
// GetLSPInfo is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - lsp
|
||||
// - network
|
||||
// - ctx context.Context
|
||||
// - lsp string
|
||||
// - network string
|
||||
func (_e *MockAlbyOAuthService_Expecter) GetLSPInfo(ctx interface{}, lsp interface{}, network interface{}) *MockAlbyOAuthService_GetLSPInfo_Call {
|
||||
return &MockAlbyOAuthService_GetLSPInfo_Call{Call: _e.mock.On("GetLSPInfo", ctx, lsp, network)}
|
||||
}
|
||||
|
||||
func (_c *MockAlbyOAuthService_GetLSPInfo_Call) Run(run func(ctx context.Context, lsp string, network string)) *MockAlbyOAuthService_GetLSPInfo_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string), args[2].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -531,14 +627,20 @@ type MockAlbyOAuthService_GetMe_Call struct {
|
|||
}
|
||||
|
||||
// GetMe is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - ctx context.Context
|
||||
func (_e *MockAlbyOAuthService_Expecter) GetMe(ctx interface{}) *MockAlbyOAuthService_GetMe_Call {
|
||||
return &MockAlbyOAuthService_GetMe_Call{Call: _e.mock.On("GetMe", ctx)}
|
||||
}
|
||||
|
||||
func (_c *MockAlbyOAuthService_GetMe_Call) Run(run func(ctx context.Context)) *MockAlbyOAuthService_GetMe_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -638,15 +740,26 @@ type MockAlbyOAuthService_GetVssAuthToken_Call struct {
|
|||
}
|
||||
|
||||
// GetVssAuthToken is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - nodeIdentifier
|
||||
// - ctx context.Context
|
||||
// - nodeIdentifier string
|
||||
func (_e *MockAlbyOAuthService_Expecter) GetVssAuthToken(ctx interface{}, nodeIdentifier interface{}) *MockAlbyOAuthService_GetVssAuthToken_Call {
|
||||
return &MockAlbyOAuthService_GetVssAuthToken_Call{Call: _e.mock.On("GetVssAuthToken", ctx, nodeIdentifier)}
|
||||
}
|
||||
|
||||
func (_c *MockAlbyOAuthService_GetVssAuthToken_Call) Run(run func(ctx context.Context, nodeIdentifier string)) *MockAlbyOAuthService_GetVssAuthToken_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
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
|
||||
}
|
||||
|
|
@ -684,14 +797,20 @@ type MockAlbyOAuthService_IsConnected_Call struct {
|
|||
}
|
||||
|
||||
// IsConnected is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - ctx context.Context
|
||||
func (_e *MockAlbyOAuthService_Expecter) IsConnected(ctx interface{}) *MockAlbyOAuthService_IsConnected_Call {
|
||||
return &MockAlbyOAuthService_IsConnected_Call{Call: _e.mock.On("IsConnected", ctx)}
|
||||
}
|
||||
|
||||
func (_c *MockAlbyOAuthService_IsConnected_Call) Run(run func(ctx context.Context)) *MockAlbyOAuthService_IsConnected_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -729,17 +848,38 @@ type MockAlbyOAuthService_LinkAccount_Call struct {
|
|||
}
|
||||
|
||||
// LinkAccount is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - lnClient
|
||||
// - budget
|
||||
// - renewal
|
||||
// - ctx context.Context
|
||||
// - lnClient lnclient.LNClient
|
||||
// - budget uint64
|
||||
// - renewal string
|
||||
func (_e *MockAlbyOAuthService_Expecter) LinkAccount(ctx interface{}, lnClient interface{}, budget interface{}, renewal interface{}) *MockAlbyOAuthService_LinkAccount_Call {
|
||||
return &MockAlbyOAuthService_LinkAccount_Call{Call: _e.mock.On("LinkAccount", ctx, lnClient, budget, renewal)}
|
||||
}
|
||||
|
||||
func (_c *MockAlbyOAuthService_LinkAccount_Call) Run(run func(ctx context.Context, lnClient lnclient.LNClient, budget uint64, renewal string)) *MockAlbyOAuthService_LinkAccount_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(lnclient.LNClient), args[2].(uint64), args[3].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 lnclient.LNClient
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(lnclient.LNClient)
|
||||
}
|
||||
var arg2 uint64
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(uint64)
|
||||
}
|
||||
var arg3 string
|
||||
if args[3] != nil {
|
||||
arg3 = args[3].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
arg3,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -832,16 +972,32 @@ type MockAlbyOAuthService_RequestAutoChannel_Call struct {
|
|||
}
|
||||
|
||||
// RequestAutoChannel is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - lnClient
|
||||
// - isPublic
|
||||
// - ctx context.Context
|
||||
// - lnClient lnclient.LNClient
|
||||
// - isPublic bool
|
||||
func (_e *MockAlbyOAuthService_Expecter) RequestAutoChannel(ctx interface{}, lnClient interface{}, isPublic interface{}) *MockAlbyOAuthService_RequestAutoChannel_Call {
|
||||
return &MockAlbyOAuthService_RequestAutoChannel_Call{Call: _e.mock.On("RequestAutoChannel", ctx, lnClient, isPublic)}
|
||||
}
|
||||
|
||||
func (_c *MockAlbyOAuthService_RequestAutoChannel_Call) Run(run func(ctx context.Context, lnClient lnclient.LNClient, isPublic bool)) *MockAlbyOAuthService_RequestAutoChannel_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(lnclient.LNClient), args[2].(bool))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 lnclient.LNClient
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(lnclient.LNClient)
|
||||
}
|
||||
var arg2 bool
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(bool)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -879,14 +1035,20 @@ type MockAlbyOAuthService_UnlinkAccount_Call struct {
|
|||
}
|
||||
|
||||
// UnlinkAccount is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - ctx context.Context
|
||||
func (_e *MockAlbyOAuthService_Expecter) UnlinkAccount(ctx interface{}) *MockAlbyOAuthService_UnlinkAccount_Call {
|
||||
return &MockAlbyOAuthService_UnlinkAccount_Call{Call: _e.mock.On("UnlinkAccount", ctx)}
|
||||
}
|
||||
|
||||
func (_c *MockAlbyOAuthService_UnlinkAccount_Call) Run(run func(ctx context.Context)) *MockAlbyOAuthService_UnlinkAccount_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,14 +72,20 @@ type MockAlbyService_GetBitcoinRate_Call struct {
|
|||
}
|
||||
|
||||
// GetBitcoinRate is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - ctx context.Context
|
||||
func (_e *MockAlbyService_Expecter) GetBitcoinRate(ctx interface{}) *MockAlbyService_GetBitcoinRate_Call {
|
||||
return &MockAlbyService_GetBitcoinRate_Call{Call: _e.mock.On("GetBitcoinRate", ctx)}
|
||||
}
|
||||
|
||||
func (_c *MockAlbyService_GetBitcoinRate_Call) Run(run func(ctx context.Context)) *MockAlbyService_GetBitcoinRate_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -128,14 +134,20 @@ type MockAlbyService_GetChannelPeerSuggestions_Call struct {
|
|||
}
|
||||
|
||||
// GetChannelPeerSuggestions is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - 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) {
|
||||
run(args[0].(context.Context))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -184,14 +196,20 @@ type MockAlbyService_GetInfo_Call struct {
|
|||
}
|
||||
|
||||
// GetInfo is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - 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) {
|
||||
run(args[0].(context.Context))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,15 +59,26 @@ type MockConfig_ChangeUnlockPassword_Call struct {
|
|||
}
|
||||
|
||||
// ChangeUnlockPassword is a helper method to define mock.On call
|
||||
// - currentUnlockPassword
|
||||
// - newUnlockPassword
|
||||
// - currentUnlockPassword string
|
||||
// - newUnlockPassword string
|
||||
func (_e *MockConfig_Expecter) ChangeUnlockPassword(currentUnlockPassword interface{}, newUnlockPassword interface{}) *MockConfig_ChangeUnlockPassword_Call {
|
||||
return &MockConfig_ChangeUnlockPassword_Call{Call: _e.mock.On("ChangeUnlockPassword", currentUnlockPassword, newUnlockPassword)}
|
||||
}
|
||||
|
||||
func (_c *MockConfig_ChangeUnlockPassword_Call) Run(run func(currentUnlockPassword string, newUnlockPassword string)) *MockConfig_ChangeUnlockPassword_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string), args[1].(string))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -105,14 +116,20 @@ type MockConfig_CheckUnlockPassword_Call struct {
|
|||
}
|
||||
|
||||
// CheckUnlockPassword is a helper method to define mock.On call
|
||||
// - password
|
||||
// - password string
|
||||
func (_e *MockConfig_Expecter) CheckUnlockPassword(password interface{}) *MockConfig_CheckUnlockPassword_Call {
|
||||
return &MockConfig_CheckUnlockPassword_Call{Call: _e.mock.On("CheckUnlockPassword", password)}
|
||||
}
|
||||
|
||||
func (_c *MockConfig_CheckUnlockPassword_Call) Run(run func(password string)) *MockConfig_CheckUnlockPassword_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -159,15 +176,26 @@ type MockConfig_Get_Call struct {
|
|||
}
|
||||
|
||||
// Get is a helper method to define mock.On call
|
||||
// - key
|
||||
// - encryptionKey
|
||||
// - key string
|
||||
// - encryptionKey string
|
||||
func (_e *MockConfig_Expecter) Get(key interface{}, encryptionKey interface{}) *MockConfig_Get_Call {
|
||||
return &MockConfig_Get_Call{Call: _e.mock.On("Get", key, encryptionKey)}
|
||||
}
|
||||
|
||||
func (_c *MockConfig_Get_Call) Run(run func(key string, encryptionKey string)) *MockConfig_Get_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string), args[1].(string))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -526,14 +554,20 @@ type MockConfig_SaveUnlockPasswordCheck_Call struct {
|
|||
}
|
||||
|
||||
// SaveUnlockPasswordCheck is a helper method to define mock.On call
|
||||
// - encryptionKey
|
||||
// - encryptionKey string
|
||||
func (_e *MockConfig_Expecter) SaveUnlockPasswordCheck(encryptionKey interface{}) *MockConfig_SaveUnlockPasswordCheck_Call {
|
||||
return &MockConfig_SaveUnlockPasswordCheck_Call{Call: _e.mock.On("SaveUnlockPasswordCheck", encryptionKey)}
|
||||
}
|
||||
|
||||
func (_c *MockConfig_SaveUnlockPasswordCheck_Call) Run(run func(encryptionKey string)) *MockConfig_SaveUnlockPasswordCheck_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -571,14 +605,20 @@ type MockConfig_SetAutoUnlockPassword_Call struct {
|
|||
}
|
||||
|
||||
// SetAutoUnlockPassword is a helper method to define mock.On call
|
||||
// - unlockPassword
|
||||
// - unlockPassword string
|
||||
func (_e *MockConfig_Expecter) SetAutoUnlockPassword(unlockPassword interface{}) *MockConfig_SetAutoUnlockPassword_Call {
|
||||
return &MockConfig_SetAutoUnlockPassword_Call{Call: _e.mock.On("SetAutoUnlockPassword", unlockPassword)}
|
||||
}
|
||||
|
||||
func (_c *MockConfig_SetAutoUnlockPassword_Call) Run(run func(unlockPassword string)) *MockConfig_SetAutoUnlockPassword_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -616,14 +656,20 @@ type MockConfig_SetBitcoinDisplayFormat_Call struct {
|
|||
}
|
||||
|
||||
// SetBitcoinDisplayFormat is a helper method to define mock.On call
|
||||
// - value
|
||||
// - value string
|
||||
func (_e *MockConfig_Expecter) SetBitcoinDisplayFormat(value interface{}) *MockConfig_SetBitcoinDisplayFormat_Call {
|
||||
return &MockConfig_SetBitcoinDisplayFormat_Call{Call: _e.mock.On("SetBitcoinDisplayFormat", value)}
|
||||
}
|
||||
|
||||
func (_c *MockConfig_SetBitcoinDisplayFormat_Call) Run(run func(value string)) *MockConfig_SetBitcoinDisplayFormat_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -661,14 +707,20 @@ type MockConfig_SetCurrency_Call struct {
|
|||
}
|
||||
|
||||
// SetCurrency is a helper method to define mock.On call
|
||||
// - value
|
||||
// - value string
|
||||
func (_e *MockConfig_Expecter) SetCurrency(value interface{}) *MockConfig_SetCurrency_Call {
|
||||
return &MockConfig_SetCurrency_Call{Call: _e.mock.On("SetCurrency", value)}
|
||||
}
|
||||
|
||||
func (_c *MockConfig_SetCurrency_Call) Run(run func(value string)) *MockConfig_SetCurrency_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -706,16 +758,32 @@ type MockConfig_SetIgnore_Call struct {
|
|||
}
|
||||
|
||||
// SetIgnore is a helper method to define mock.On call
|
||||
// - key
|
||||
// - value
|
||||
// - encryptionKey
|
||||
// - key string
|
||||
// - value string
|
||||
// - encryptionKey string
|
||||
func (_e *MockConfig_Expecter) SetIgnore(key interface{}, value interface{}, encryptionKey interface{}) *MockConfig_SetIgnore_Call {
|
||||
return &MockConfig_SetIgnore_Call{Call: _e.mock.On("SetIgnore", key, value, encryptionKey)}
|
||||
}
|
||||
|
||||
func (_c *MockConfig_SetIgnore_Call) Run(run func(key string, value string, encryptionKey string)) *MockConfig_SetIgnore_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string), args[1].(string), args[2].(string))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -753,16 +821,32 @@ type MockConfig_SetUpdate_Call struct {
|
|||
}
|
||||
|
||||
// SetUpdate is a helper method to define mock.On call
|
||||
// - key
|
||||
// - value
|
||||
// - encryptionKey
|
||||
// - key string
|
||||
// - value string
|
||||
// - encryptionKey string
|
||||
func (_e *MockConfig_Expecter) SetUpdate(key interface{}, value interface{}, encryptionKey interface{}) *MockConfig_SetUpdate_Call {
|
||||
return &MockConfig_SetUpdate_Call{Call: _e.mock.On("SetUpdate", key, value, encryptionKey)}
|
||||
}
|
||||
|
||||
func (_c *MockConfig_SetUpdate_Call) Run(run func(key string, value string, encryptionKey string)) *MockConfig_SetUpdate_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string), args[1].(string), args[2].(string))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -853,14 +937,20 @@ type MockConfig_Unlock_Call struct {
|
|||
}
|
||||
|
||||
// Unlock is a helper method to define mock.On call
|
||||
// - encryptionKey
|
||||
// - encryptionKey string
|
||||
func (_e *MockConfig_Expecter) Unlock(encryptionKey interface{}) *MockConfig_Unlock_Call {
|
||||
return &MockConfig_Unlock_Call{Call: _e.mock.On("Unlock", encryptionKey)}
|
||||
}
|
||||
|
||||
func (_c *MockConfig_Unlock_Call) Run(run func(encryptionKey string)) *MockConfig_Unlock_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,14 +48,20 @@ type MockEventPublisher_Publish_Call struct {
|
|||
}
|
||||
|
||||
// Publish is a helper method to define mock.On call
|
||||
// - event
|
||||
// - event *events.Event
|
||||
func (_e *MockEventPublisher_Expecter) Publish(event interface{}) *MockEventPublisher_Publish_Call {
|
||||
return &MockEventPublisher_Publish_Call{Call: _e.mock.On("Publish", event)}
|
||||
}
|
||||
|
||||
func (_c *MockEventPublisher_Publish_Call) Run(run func(event *events.Event)) *MockEventPublisher_Publish_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(*events.Event))
|
||||
var arg0 *events.Event
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(*events.Event)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -82,14 +88,20 @@ type MockEventPublisher_PublishSync_Call struct {
|
|||
}
|
||||
|
||||
// PublishSync is a helper method to define mock.On call
|
||||
// - event
|
||||
// - event *events.Event
|
||||
func (_e *MockEventPublisher_Expecter) PublishSync(event interface{}) *MockEventPublisher_PublishSync_Call {
|
||||
return &MockEventPublisher_PublishSync_Call{Call: _e.mock.On("PublishSync", event)}
|
||||
}
|
||||
|
||||
func (_c *MockEventPublisher_PublishSync_Call) Run(run func(event *events.Event)) *MockEventPublisher_PublishSync_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(*events.Event))
|
||||
var arg0 *events.Event
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(*events.Event)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -116,14 +128,20 @@ type MockEventPublisher_RegisterSubscriber_Call struct {
|
|||
}
|
||||
|
||||
// RegisterSubscriber is a helper method to define mock.On call
|
||||
// - eventListener
|
||||
// - eventListener events.EventSubscriber
|
||||
func (_e *MockEventPublisher_Expecter) RegisterSubscriber(eventListener interface{}) *MockEventPublisher_RegisterSubscriber_Call {
|
||||
return &MockEventPublisher_RegisterSubscriber_Call{Call: _e.mock.On("RegisterSubscriber", eventListener)}
|
||||
}
|
||||
|
||||
func (_c *MockEventPublisher_RegisterSubscriber_Call) Run(run func(eventListener events.EventSubscriber)) *MockEventPublisher_RegisterSubscriber_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(events.EventSubscriber))
|
||||
var arg0 events.EventSubscriber
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(events.EventSubscriber)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -150,14 +168,20 @@ type MockEventPublisher_RemoveSubscriber_Call struct {
|
|||
}
|
||||
|
||||
// RemoveSubscriber is a helper method to define mock.On call
|
||||
// - eventListener
|
||||
// - eventListener events.EventSubscriber
|
||||
func (_e *MockEventPublisher_Expecter) RemoveSubscriber(eventListener interface{}) *MockEventPublisher_RemoveSubscriber_Call {
|
||||
return &MockEventPublisher_RemoveSubscriber_Call{Call: _e.mock.On("RemoveSubscriber", eventListener)}
|
||||
}
|
||||
|
||||
func (_c *MockEventPublisher_RemoveSubscriber_Call) Run(run func(eventListener events.EventSubscriber)) *MockEventPublisher_RemoveSubscriber_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(events.EventSubscriber))
|
||||
var arg0 events.EventSubscriber
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(events.EventSubscriber)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -184,15 +208,26 @@ type MockEventPublisher_SetGlobalProperty_Call struct {
|
|||
}
|
||||
|
||||
// SetGlobalProperty is a helper method to define mock.On call
|
||||
// - key
|
||||
// - value
|
||||
// - key string
|
||||
// - value interface{}
|
||||
func (_e *MockEventPublisher_Expecter) SetGlobalProperty(key interface{}, value interface{}) *MockEventPublisher_SetGlobalProperty_Call {
|
||||
return &MockEventPublisher_SetGlobalProperty_Call{Call: _e.mock.On("SetGlobalProperty", key, value)}
|
||||
}
|
||||
|
||||
func (_c *MockEventPublisher_SetGlobalProperty_Call) Run(run func(key string, value interface{})) *MockEventPublisher_SetGlobalProperty_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string), args[1].(interface{}))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
var arg1 interface{}
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(interface{})
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,14 +72,20 @@ type MockKeys_DeriveKey_Call struct {
|
|||
}
|
||||
|
||||
// DeriveKey is a helper method to define mock.On call
|
||||
// - path
|
||||
// - path []uint32
|
||||
func (_e *MockKeys_Expecter) DeriveKey(path interface{}) *MockKeys_DeriveKey_Call {
|
||||
return &MockKeys_DeriveKey_Call{Call: _e.mock.On("DeriveKey", path)}
|
||||
}
|
||||
|
||||
func (_c *MockKeys_DeriveKey_Call) Run(run func(path []uint32)) *MockKeys_DeriveKey_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].([]uint32))
|
||||
var arg0 []uint32
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].([]uint32)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -126,14 +132,20 @@ type MockKeys_GetAppWalletKey_Call struct {
|
|||
}
|
||||
|
||||
// GetAppWalletKey is a helper method to define mock.On call
|
||||
// - childIndex
|
||||
// - childIndex uint
|
||||
func (_e *MockKeys_Expecter) GetAppWalletKey(childIndex interface{}) *MockKeys_GetAppWalletKey_Call {
|
||||
return &MockKeys_GetAppWalletKey_Call{Call: _e.mock.On("GetAppWalletKey", childIndex)}
|
||||
}
|
||||
|
||||
func (_c *MockKeys_GetAppWalletKey_Call) Run(run func(childIndex uint)) *MockKeys_GetAppWalletKey_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(uint))
|
||||
var arg0 uint
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(uint)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -270,14 +282,20 @@ type MockKeys_GetSwapKey_Call struct {
|
|||
}
|
||||
|
||||
// GetSwapKey is a helper method to define mock.On call
|
||||
// - childIndex
|
||||
// - childIndex uint
|
||||
func (_e *MockKeys_Expecter) GetSwapKey(childIndex interface{}) *MockKeys_GetSwapKey_Call {
|
||||
return &MockKeys_GetSwapKey_Call{Call: _e.mock.On("GetSwapKey", childIndex)}
|
||||
}
|
||||
|
||||
func (_c *MockKeys_GetSwapKey_Call) Run(run func(childIndex uint)) *MockKeys_GetSwapKey_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(uint))
|
||||
var arg0 uint
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(uint)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -359,15 +377,26 @@ type MockKeys_Init_Call struct {
|
|||
}
|
||||
|
||||
// Init is a helper method to define mock.On call
|
||||
// - cfg
|
||||
// - encryptionKey
|
||||
// - cfg config.Config
|
||||
// - encryptionKey string
|
||||
func (_e *MockKeys_Expecter) Init(cfg interface{}, encryptionKey interface{}) *MockKeys_Init_Call {
|
||||
return &MockKeys_Init_Call{Call: _e.mock.On("Init", cfg, encryptionKey)}
|
||||
}
|
||||
|
||||
func (_c *MockKeys_Init_Call) Run(run func(cfg config.Config, encryptionKey string)) *MockKeys_Init_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(config.Config), args[1].(string))
|
||||
var arg0 config.Config
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(config.Config)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,15 +61,26 @@ type MockLNClient_CancelHoldInvoice_Call struct {
|
|||
}
|
||||
|
||||
// CancelHoldInvoice is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - paymentHash
|
||||
// - ctx context.Context
|
||||
// - paymentHash string
|
||||
func (_e *MockLNClient_Expecter) CancelHoldInvoice(ctx interface{}, paymentHash interface{}) *MockLNClient_CancelHoldInvoice_Call {
|
||||
return &MockLNClient_CancelHoldInvoice_Call{Call: _e.mock.On("CancelHoldInvoice", ctx, paymentHash)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_CancelHoldInvoice_Call) Run(run func(ctx context.Context, paymentHash string)) *MockLNClient_CancelHoldInvoice_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
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
|
||||
}
|
||||
|
|
@ -118,15 +129,26 @@ type MockLNClient_CloseChannel_Call struct {
|
|||
}
|
||||
|
||||
// CloseChannel is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - closeChannelRequest
|
||||
// - ctx context.Context
|
||||
// - closeChannelRequest *lnclient.CloseChannelRequest
|
||||
func (_e *MockLNClient_Expecter) CloseChannel(ctx interface{}, closeChannelRequest interface{}) *MockLNClient_CloseChannel_Call {
|
||||
return &MockLNClient_CloseChannel_Call{Call: _e.mock.On("CloseChannel", ctx, closeChannelRequest)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_CloseChannel_Call) Run(run func(ctx context.Context, closeChannelRequest *lnclient.CloseChannelRequest)) *MockLNClient_CloseChannel_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*lnclient.CloseChannelRequest))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *lnclient.CloseChannelRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*lnclient.CloseChannelRequest)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -164,15 +186,26 @@ type MockLNClient_ConnectPeer_Call struct {
|
|||
}
|
||||
|
||||
// ConnectPeer is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - connectPeerRequest
|
||||
// - ctx context.Context
|
||||
// - connectPeerRequest *lnclient.ConnectPeerRequest
|
||||
func (_e *MockLNClient_Expecter) ConnectPeer(ctx interface{}, connectPeerRequest interface{}) *MockLNClient_ConnectPeer_Call {
|
||||
return &MockLNClient_ConnectPeer_Call{Call: _e.mock.On("ConnectPeer", ctx, connectPeerRequest)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_ConnectPeer_Call) Run(run func(ctx context.Context, connectPeerRequest *lnclient.ConnectPeerRequest)) *MockLNClient_ConnectPeer_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*lnclient.ConnectPeerRequest))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *lnclient.ConnectPeerRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*lnclient.ConnectPeerRequest)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -210,15 +243,26 @@ type MockLNClient_DisconnectPeer_Call struct {
|
|||
}
|
||||
|
||||
// DisconnectPeer is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - peerId
|
||||
// - ctx context.Context
|
||||
// - peerId string
|
||||
func (_e *MockLNClient_Expecter) DisconnectPeer(ctx interface{}, peerId interface{}) *MockLNClient_DisconnectPeer_Call {
|
||||
return &MockLNClient_DisconnectPeer_Call{Call: _e.mock.On("DisconnectPeer", ctx, peerId)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_DisconnectPeer_Call) Run(run func(ctx context.Context, peerId string)) *MockLNClient_DisconnectPeer_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
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
|
||||
}
|
||||
|
|
@ -267,15 +311,26 @@ type MockLNClient_ExecuteCustomNodeCommand_Call struct {
|
|||
}
|
||||
|
||||
// ExecuteCustomNodeCommand is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - command
|
||||
// - ctx context.Context
|
||||
// - command *lnclient.CustomNodeCommandRequest
|
||||
func (_e *MockLNClient_Expecter) ExecuteCustomNodeCommand(ctx interface{}, command interface{}) *MockLNClient_ExecuteCustomNodeCommand_Call {
|
||||
return &MockLNClient_ExecuteCustomNodeCommand_Call{Call: _e.mock.On("ExecuteCustomNodeCommand", ctx, command)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_ExecuteCustomNodeCommand_Call) Run(run func(ctx context.Context, command *lnclient.CustomNodeCommandRequest)) *MockLNClient_ExecuteCustomNodeCommand_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*lnclient.CustomNodeCommandRequest))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *lnclient.CustomNodeCommandRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*lnclient.CustomNodeCommandRequest)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -324,15 +379,26 @@ type MockLNClient_GetBalances_Call struct {
|
|||
}
|
||||
|
||||
// GetBalances is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - includeInactiveChannels
|
||||
// - ctx context.Context
|
||||
// - includeInactiveChannels bool
|
||||
func (_e *MockLNClient_Expecter) GetBalances(ctx interface{}, includeInactiveChannels interface{}) *MockLNClient_GetBalances_Call {
|
||||
return &MockLNClient_GetBalances_Call{Call: _e.mock.On("GetBalances", ctx, includeInactiveChannels)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_GetBalances_Call) Run(run func(ctx context.Context, includeInactiveChannels bool)) *MockLNClient_GetBalances_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(bool))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 bool
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(bool)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -427,14 +493,20 @@ type MockLNClient_GetInfo_Call struct {
|
|||
}
|
||||
|
||||
// GetInfo is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - ctx context.Context
|
||||
func (_e *MockLNClient_Expecter) GetInfo(ctx interface{}) *MockLNClient_GetInfo_Call {
|
||||
return &MockLNClient_GetInfo_Call{Call: _e.mock.On("GetInfo", ctx)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_GetInfo_Call) Run(run func(ctx context.Context)) *MockLNClient_GetInfo_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -483,15 +555,26 @@ type MockLNClient_GetLogOutput_Call struct {
|
|||
}
|
||||
|
||||
// GetLogOutput is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - maxLen
|
||||
// - ctx context.Context
|
||||
// - maxLen int
|
||||
func (_e *MockLNClient_Expecter) GetLogOutput(ctx interface{}, maxLen interface{}) *MockLNClient_GetLogOutput_Call {
|
||||
return &MockLNClient_GetLogOutput_Call{Call: _e.mock.On("GetLogOutput", ctx, maxLen)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_GetLogOutput_Call) Run(run func(ctx context.Context, maxLen int)) *MockLNClient_GetLogOutput_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(int))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 int
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(int)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -540,15 +623,26 @@ type MockLNClient_GetNetworkGraph_Call struct {
|
|||
}
|
||||
|
||||
// GetNetworkGraph is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - nodeIds
|
||||
// - ctx context.Context
|
||||
// - nodeIds []string
|
||||
func (_e *MockLNClient_Expecter) GetNetworkGraph(ctx interface{}, nodeIds interface{}) *MockLNClient_GetNetworkGraph_Call {
|
||||
return &MockLNClient_GetNetworkGraph_Call{Call: _e.mock.On("GetNetworkGraph", ctx, nodeIds)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_GetNetworkGraph_Call) Run(run func(ctx context.Context, nodeIds []string)) *MockLNClient_GetNetworkGraph_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].([]string))
|
||||
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
|
||||
}
|
||||
|
|
@ -595,14 +689,20 @@ type MockLNClient_GetNewOnchainAddress_Call struct {
|
|||
}
|
||||
|
||||
// GetNewOnchainAddress is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - ctx context.Context
|
||||
func (_e *MockLNClient_Expecter) GetNewOnchainAddress(ctx interface{}) *MockLNClient_GetNewOnchainAddress_Call {
|
||||
return &MockLNClient_GetNewOnchainAddress_Call{Call: _e.mock.On("GetNewOnchainAddress", ctx)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_GetNewOnchainAddress_Call) Run(run func(ctx context.Context)) *MockLNClient_GetNewOnchainAddress_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -651,14 +751,20 @@ type MockLNClient_GetNodeConnectionInfo_Call struct {
|
|||
}
|
||||
|
||||
// GetNodeConnectionInfo is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - ctx context.Context
|
||||
func (_e *MockLNClient_Expecter) GetNodeConnectionInfo(ctx interface{}) *MockLNClient_GetNodeConnectionInfo_Call {
|
||||
return &MockLNClient_GetNodeConnectionInfo_Call{Call: _e.mock.On("GetNodeConnectionInfo", ctx)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_GetNodeConnectionInfo_Call) Run(run func(ctx context.Context)) *MockLNClient_GetNodeConnectionInfo_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -707,14 +813,20 @@ type MockLNClient_GetNodeStatus_Call struct {
|
|||
}
|
||||
|
||||
// GetNodeStatus is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - ctx context.Context
|
||||
func (_e *MockLNClient_Expecter) GetNodeStatus(ctx interface{}) *MockLNClient_GetNodeStatus_Call {
|
||||
return &MockLNClient_GetNodeStatus_Call{Call: _e.mock.On("GetNodeStatus", ctx)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_GetNodeStatus_Call) Run(run func(ctx context.Context)) *MockLNClient_GetNodeStatus_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -763,14 +875,20 @@ type MockLNClient_GetOnchainBalance_Call struct {
|
|||
}
|
||||
|
||||
// GetOnchainBalance is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - ctx context.Context
|
||||
func (_e *MockLNClient_Expecter) GetOnchainBalance(ctx interface{}) *MockLNClient_GetOnchainBalance_Call {
|
||||
return &MockLNClient_GetOnchainBalance_Call{Call: _e.mock.On("GetOnchainBalance", ctx)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_GetOnchainBalance_Call) Run(run func(ctx context.Context)) *MockLNClient_GetOnchainBalance_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -1008,14 +1126,20 @@ type MockLNClient_ListChannels_Call struct {
|
|||
}
|
||||
|
||||
// ListChannels is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - ctx context.Context
|
||||
func (_e *MockLNClient_Expecter) ListChannels(ctx interface{}) *MockLNClient_ListChannels_Call {
|
||||
return &MockLNClient_ListChannels_Call{Call: _e.mock.On("ListChannels", ctx)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_ListChannels_Call) Run(run func(ctx context.Context)) *MockLNClient_ListChannels_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -1064,14 +1188,20 @@ type MockLNClient_ListOnchainTransactions_Call struct {
|
|||
}
|
||||
|
||||
// ListOnchainTransactions is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - ctx context.Context
|
||||
func (_e *MockLNClient_Expecter) ListOnchainTransactions(ctx interface{}) *MockLNClient_ListOnchainTransactions_Call {
|
||||
return &MockLNClient_ListOnchainTransactions_Call{Call: _e.mock.On("ListOnchainTransactions", ctx)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_ListOnchainTransactions_Call) Run(run func(ctx context.Context)) *MockLNClient_ListOnchainTransactions_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -1120,14 +1250,20 @@ type MockLNClient_ListPeers_Call struct {
|
|||
}
|
||||
|
||||
// ListPeers is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - ctx context.Context
|
||||
func (_e *MockLNClient_Expecter) ListPeers(ctx interface{}) *MockLNClient_ListPeers_Call {
|
||||
return &MockLNClient_ListPeers_Call{Call: _e.mock.On("ListPeers", ctx)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_ListPeers_Call) Run(run func(ctx context.Context)) *MockLNClient_ListPeers_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -1176,15 +1312,26 @@ type MockLNClient_LookupInvoice_Call struct {
|
|||
}
|
||||
|
||||
// LookupInvoice is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - paymentHash
|
||||
// - ctx context.Context
|
||||
// - paymentHash string
|
||||
func (_e *MockLNClient_Expecter) LookupInvoice(ctx interface{}, paymentHash interface{}) *MockLNClient_LookupInvoice_Call {
|
||||
return &MockLNClient_LookupInvoice_Call{Call: _e.mock.On("LookupInvoice", ctx, paymentHash)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_LookupInvoice_Call) Run(run func(ctx context.Context, paymentHash string)) *MockLNClient_LookupInvoice_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
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
|
||||
}
|
||||
|
|
@ -1233,19 +1380,50 @@ type MockLNClient_MakeHoldInvoice_Call struct {
|
|||
}
|
||||
|
||||
// MakeHoldInvoice is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - amount
|
||||
// - description
|
||||
// - descriptionHash
|
||||
// - expiry
|
||||
// - paymentHash
|
||||
// - ctx context.Context
|
||||
// - amount int64
|
||||
// - description string
|
||||
// - descriptionHash string
|
||||
// - expiry int64
|
||||
// - paymentHash string
|
||||
func (_e *MockLNClient_Expecter) MakeHoldInvoice(ctx interface{}, amount interface{}, description interface{}, descriptionHash interface{}, expiry interface{}, paymentHash interface{}) *MockLNClient_MakeHoldInvoice_Call {
|
||||
return &MockLNClient_MakeHoldInvoice_Call{Call: _e.mock.On("MakeHoldInvoice", ctx, amount, description, descriptionHash, expiry, paymentHash)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_MakeHoldInvoice_Call) Run(run func(ctx context.Context, amount int64, description string, descriptionHash string, expiry int64, paymentHash string)) *MockLNClient_MakeHoldInvoice_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(int64), args[2].(string), args[3].(string), args[4].(int64), args[5].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 int64
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(int64)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
var arg3 string
|
||||
if args[3] != nil {
|
||||
arg3 = args[3].(string)
|
||||
}
|
||||
var arg4 int64
|
||||
if args[4] != nil {
|
||||
arg4 = args[4].(int64)
|
||||
}
|
||||
var arg5 string
|
||||
if args[5] != nil {
|
||||
arg5 = args[5].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
arg3,
|
||||
arg4,
|
||||
arg5,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -1294,19 +1472,50 @@ type MockLNClient_MakeInvoice_Call struct {
|
|||
}
|
||||
|
||||
// MakeInvoice is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - amount
|
||||
// - description
|
||||
// - descriptionHash
|
||||
// - expiry
|
||||
// - throughNodePubkey
|
||||
// - ctx context.Context
|
||||
// - amount int64
|
||||
// - description string
|
||||
// - descriptionHash string
|
||||
// - expiry int64
|
||||
// - throughNodePubkey *string
|
||||
func (_e *MockLNClient_Expecter) MakeInvoice(ctx interface{}, amount interface{}, description interface{}, descriptionHash interface{}, expiry interface{}, throughNodePubkey interface{}) *MockLNClient_MakeInvoice_Call {
|
||||
return &MockLNClient_MakeInvoice_Call{Call: _e.mock.On("MakeInvoice", ctx, amount, description, descriptionHash, expiry, throughNodePubkey)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_MakeInvoice_Call) Run(run func(ctx context.Context, amount int64, description string, descriptionHash string, expiry int64, throughNodePubkey *string)) *MockLNClient_MakeInvoice_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(int64), args[2].(string), args[3].(string), args[4].(int64), args[5].(*string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 int64
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(int64)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
var arg3 string
|
||||
if args[3] != nil {
|
||||
arg3 = args[3].(string)
|
||||
}
|
||||
var arg4 int64
|
||||
if args[4] != nil {
|
||||
arg4 = args[4].(int64)
|
||||
}
|
||||
var arg5 *string
|
||||
if args[5] != nil {
|
||||
arg5 = args[5].(*string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
arg3,
|
||||
arg4,
|
||||
arg5,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -1353,15 +1562,26 @@ type MockLNClient_MakeOffer_Call struct {
|
|||
}
|
||||
|
||||
// MakeOffer is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - description
|
||||
// - ctx context.Context
|
||||
// - description string
|
||||
func (_e *MockLNClient_Expecter) MakeOffer(ctx interface{}, description interface{}) *MockLNClient_MakeOffer_Call {
|
||||
return &MockLNClient_MakeOffer_Call{Call: _e.mock.On("MakeOffer", ctx, description)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_MakeOffer_Call) Run(run func(ctx context.Context, description string)) *MockLNClient_MakeOffer_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
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
|
||||
}
|
||||
|
|
@ -1410,15 +1630,26 @@ type MockLNClient_OpenChannel_Call struct {
|
|||
}
|
||||
|
||||
// OpenChannel is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - openChannelRequest
|
||||
// - ctx context.Context
|
||||
// - openChannelRequest *lnclient.OpenChannelRequest
|
||||
func (_e *MockLNClient_Expecter) OpenChannel(ctx interface{}, openChannelRequest interface{}) *MockLNClient_OpenChannel_Call {
|
||||
return &MockLNClient_OpenChannel_Call{Call: _e.mock.On("OpenChannel", ctx, openChannelRequest)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_OpenChannel_Call) Run(run func(ctx context.Context, openChannelRequest *lnclient.OpenChannelRequest)) *MockLNClient_OpenChannel_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*lnclient.OpenChannelRequest))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *lnclient.OpenChannelRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*lnclient.OpenChannelRequest)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -1465,18 +1696,44 @@ type MockLNClient_RedeemOnchainFunds_Call struct {
|
|||
}
|
||||
|
||||
// RedeemOnchainFunds is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - toAddress
|
||||
// - amount
|
||||
// - feeRate
|
||||
// - sendAll
|
||||
// - ctx context.Context
|
||||
// - toAddress string
|
||||
// - amount uint64
|
||||
// - feeRate *uint64
|
||||
// - sendAll bool
|
||||
func (_e *MockLNClient_Expecter) RedeemOnchainFunds(ctx interface{}, toAddress interface{}, amount interface{}, feeRate interface{}, sendAll interface{}) *MockLNClient_RedeemOnchainFunds_Call {
|
||||
return &MockLNClient_RedeemOnchainFunds_Call{Call: _e.mock.On("RedeemOnchainFunds", ctx, toAddress, amount, feeRate, sendAll)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_RedeemOnchainFunds_Call) Run(run func(ctx context.Context, toAddress string, amount uint64, feeRate *uint64, sendAll bool)) *MockLNClient_RedeemOnchainFunds_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string), args[2].(uint64), args[3].(*uint64), args[4].(bool))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
var arg2 uint64
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(uint64)
|
||||
}
|
||||
var arg3 *uint64
|
||||
if args[3] != nil {
|
||||
arg3 = args[3].(*uint64)
|
||||
}
|
||||
var arg4 bool
|
||||
if args[4] != nil {
|
||||
arg4 = args[4].(bool)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
arg3,
|
||||
arg4,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -1514,14 +1771,20 @@ type MockLNClient_ResetRouter_Call struct {
|
|||
}
|
||||
|
||||
// ResetRouter is a helper method to define mock.On call
|
||||
// - key
|
||||
// - key string
|
||||
func (_e *MockLNClient_Expecter) ResetRouter(key interface{}) *MockLNClient_ResetRouter_Call {
|
||||
return &MockLNClient_ResetRouter_Call{Call: _e.mock.On("ResetRouter", key)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_ResetRouter_Call) Run(run func(key string)) *MockLNClient_ResetRouter_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -1570,17 +1833,38 @@ type MockLNClient_SendKeysend_Call struct {
|
|||
}
|
||||
|
||||
// SendKeysend is a helper method to define mock.On call
|
||||
// - amount
|
||||
// - destination
|
||||
// - customRecords
|
||||
// - preimage
|
||||
// - amount uint64
|
||||
// - destination string
|
||||
// - customRecords []lnclient.TLVRecord
|
||||
// - preimage string
|
||||
func (_e *MockLNClient_Expecter) SendKeysend(amount interface{}, destination interface{}, customRecords interface{}, preimage interface{}) *MockLNClient_SendKeysend_Call {
|
||||
return &MockLNClient_SendKeysend_Call{Call: _e.mock.On("SendKeysend", amount, destination, customRecords, preimage)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_SendKeysend_Call) Run(run func(amount uint64, destination string, customRecords []lnclient.TLVRecord, preimage string)) *MockLNClient_SendKeysend_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(uint64), args[1].(string), args[2].([]lnclient.TLVRecord), args[3].(string))
|
||||
var arg0 uint64
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(uint64)
|
||||
}
|
||||
var arg1 string
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(string)
|
||||
}
|
||||
var arg2 []lnclient.TLVRecord
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].([]lnclient.TLVRecord)
|
||||
}
|
||||
var arg3 string
|
||||
if args[3] != nil {
|
||||
arg3 = args[3].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
arg3,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -1618,15 +1902,26 @@ type MockLNClient_SendPaymentProbes_Call struct {
|
|||
}
|
||||
|
||||
// SendPaymentProbes is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - invoice
|
||||
// - ctx context.Context
|
||||
// - invoice string
|
||||
func (_e *MockLNClient_Expecter) SendPaymentProbes(ctx interface{}, invoice interface{}) *MockLNClient_SendPaymentProbes_Call {
|
||||
return &MockLNClient_SendPaymentProbes_Call{Call: _e.mock.On("SendPaymentProbes", ctx, invoice)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_SendPaymentProbes_Call) Run(run func(ctx context.Context, invoice string)) *MockLNClient_SendPaymentProbes_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
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
|
||||
}
|
||||
|
|
@ -1675,15 +1970,26 @@ type MockLNClient_SendPaymentSync_Call struct {
|
|||
}
|
||||
|
||||
// SendPaymentSync is a helper method to define mock.On call
|
||||
// - payReq
|
||||
// - amount
|
||||
// - payReq string
|
||||
// - amount *uint64
|
||||
func (_e *MockLNClient_Expecter) SendPaymentSync(payReq interface{}, amount interface{}) *MockLNClient_SendPaymentSync_Call {
|
||||
return &MockLNClient_SendPaymentSync_Call{Call: _e.mock.On("SendPaymentSync", payReq, amount)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_SendPaymentSync_Call) Run(run func(payReq string, amount *uint64)) *MockLNClient_SendPaymentSync_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(string), args[1].(*uint64))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
var arg1 *uint64
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*uint64)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -1721,16 +2027,32 @@ type MockLNClient_SendSpontaneousPaymentProbes_Call struct {
|
|||
}
|
||||
|
||||
// SendSpontaneousPaymentProbes is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - amountMsat
|
||||
// - nodeId
|
||||
// - ctx context.Context
|
||||
// - amountMsat uint64
|
||||
// - nodeId string
|
||||
func (_e *MockLNClient_Expecter) SendSpontaneousPaymentProbes(ctx interface{}, amountMsat interface{}, nodeId interface{}) *MockLNClient_SendSpontaneousPaymentProbes_Call {
|
||||
return &MockLNClient_SendSpontaneousPaymentProbes_Call{Call: _e.mock.On("SendSpontaneousPaymentProbes", ctx, amountMsat, nodeId)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_SendSpontaneousPaymentProbes_Call) Run(run func(ctx context.Context, amountMsat uint64, nodeId string)) *MockLNClient_SendSpontaneousPaymentProbes_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(uint64), args[2].(string))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 uint64
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(uint64)
|
||||
}
|
||||
var arg2 string
|
||||
if args[2] != nil {
|
||||
arg2 = args[2].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
arg2,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
@ -1768,15 +2090,26 @@ type MockLNClient_SettleHoldInvoice_Call struct {
|
|||
}
|
||||
|
||||
// SettleHoldInvoice is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - preimage
|
||||
// - ctx context.Context
|
||||
// - preimage string
|
||||
func (_e *MockLNClient_Expecter) SettleHoldInvoice(ctx interface{}, preimage interface{}) *MockLNClient_SettleHoldInvoice_Call {
|
||||
return &MockLNClient_SettleHoldInvoice_Call{Call: _e.mock.On("SettleHoldInvoice", ctx, preimage)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_SettleHoldInvoice_Call) Run(run func(ctx context.Context, preimage string)) *MockLNClient_SettleHoldInvoice_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
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
|
||||
}
|
||||
|
|
@ -1867,15 +2200,26 @@ type MockLNClient_SignMessage_Call struct {
|
|||
}
|
||||
|
||||
// SignMessage is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - message
|
||||
// - ctx context.Context
|
||||
// - message string
|
||||
func (_e *MockLNClient_Expecter) SignMessage(ctx interface{}, message interface{}) *MockLNClient_SignMessage_Call {
|
||||
return &MockLNClient_SignMessage_Call{Call: _e.mock.On("SignMessage", ctx, message)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_SignMessage_Call) Run(run func(ctx context.Context, message string)) *MockLNClient_SignMessage_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(string))
|
||||
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
|
||||
}
|
||||
|
|
@ -1913,15 +2257,26 @@ type MockLNClient_UpdateChannel_Call struct {
|
|||
}
|
||||
|
||||
// UpdateChannel is a helper method to define mock.On call
|
||||
// - ctx
|
||||
// - updateChannelRequest
|
||||
// - ctx context.Context
|
||||
// - updateChannelRequest *lnclient.UpdateChannelRequest
|
||||
func (_e *MockLNClient_Expecter) UpdateChannel(ctx interface{}, updateChannelRequest interface{}) *MockLNClient_UpdateChannel_Call {
|
||||
return &MockLNClient_UpdateChannel_Call{Call: _e.mock.On("UpdateChannel", ctx, updateChannelRequest)}
|
||||
}
|
||||
|
||||
func (_c *MockLNClient_UpdateChannel_Call) Run(run func(ctx context.Context, updateChannelRequest *lnclient.UpdateChannelRequest)) *MockLNClient_UpdateChannel_Call {
|
||||
_c.Call.Run(func(args mock.Arguments) {
|
||||
run(args[0].(context.Context), args[1].(*lnclient.UpdateChannelRequest))
|
||||
var arg0 context.Context
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(context.Context)
|
||||
}
|
||||
var arg1 *lnclient.UpdateChannelRequest
|
||||
if args[1] != nil {
|
||||
arg1 = args[1].(*lnclient.UpdateChannelRequest)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
arg1,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
|
|||
|
|
@ -604,14 +604,20 @@ type MockService_StartApp_Call struct {
|
|||
}
|
||||
|
||||
// StartApp is a helper method to define mock.On call
|
||||
// - encryptionKey
|
||||
// - 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) {
|
||||
run(args[0].(string))
|
||||
var arg0 string
|
||||
if args[0] != nil {
|
||||
arg0 = args[0].(string)
|
||||
}
|
||||
run(
|
||||
arg0,
|
||||
)
|
||||
})
|
||||
return _c
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ func (app *WailsApp) WailsRequestRouter(route string, method string, body string
|
|||
case len(authCodeMatch) > 1:
|
||||
code := authCodeMatch[1]
|
||||
|
||||
err := app.svc.GetAlbyOAuthSvc().CallbackHandler(ctx, code, app.svc.GetLNClient())
|
||||
err := app.svc.GetAlbyOAuthSvc().CallbackHandler(ctx, code)
|
||||
if err != nil {
|
||||
logger.Logger.WithFields(logrus.Fields{
|
||||
"route": route,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue