mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 23:21:12 +02:00
channeldb: add k/v implementation for InvoiceDB.FetchPendingInvoices
This commit is contained in:
@@ -56,6 +56,11 @@ type InvoiceDB interface {
|
||||
ScanInvoices(ctx context.Context, scanFunc InvScanFunc,
|
||||
reset func()) error
|
||||
|
||||
// FetchPendingInvoices returns all invoices that have not yet been
|
||||
// settled or canceled.
|
||||
FetchPendingInvoices(ctx context.Context) (map[lntypes.Hash]Invoice,
|
||||
error)
|
||||
|
||||
// QueryInvoices allows a caller to query the invoice database for
|
||||
// invoices within the specified add index range.
|
||||
QueryInvoices(ctx context.Context, q InvoiceQuery) (InvoiceSlice, error)
|
||||
|
@@ -1,6 +1,8 @@
|
||||
package invoices
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/lightningnetwork/lnd/lntypes"
|
||||
"github.com/stretchr/testify/mock"
|
||||
)
|
||||
@@ -55,6 +57,13 @@ func (m *MockInvoiceDB) ScanInvoices(scanFunc InvScanFunc,
|
||||
return args.Error(0)
|
||||
}
|
||||
|
||||
func (m *MockInvoiceDB) FetchPendingInvoices(ctx context.Context) (
|
||||
map[lntypes.Hash]Invoice, error) {
|
||||
|
||||
args := m.Called(ctx)
|
||||
return args.Get(0).(map[lntypes.Hash]Invoice), args.Error(1)
|
||||
}
|
||||
|
||||
func (m *MockInvoiceDB) QueryInvoices(q InvoiceQuery) (InvoiceSlice, error) {
|
||||
args := m.Called(q)
|
||||
invoiceSlice, _ := args.Get(0).(InvoiceSlice)
|
||||
|
Reference in New Issue
Block a user