multi: extend InvoiceDB methods with a context argument (#8066)

* multi: extend InvoiceDB methods with a context argument

This commit adds a context to InvoiceDB's methods. Along this refactor
we also extend InvoiceRegistry methods with contexts where it makes
sense. This change is essential to be able to provide kvdb and sqldb
implementations for InvoiceDB.

* channeldb: restrict invoice tests to only use an InvoiceDB instance

* docs: update release notes for 0.18.0
This commit is contained in:
András Bánki-Horváth
2023-10-11 13:42:59 +02:00
committed by GitHub
parent 9478b85e59
commit ad5cd9c8bb
18 changed files with 458 additions and 328 deletions

View File

@@ -1,6 +1,7 @@
package contractcourt
import (
"context"
"io"
"github.com/btcsuite/btcd/wire"
@@ -19,7 +20,7 @@ import (
type Registry interface {
// LookupInvoice attempts to look up an invoice according to its 32
// byte payment hash.
LookupInvoice(lntypes.Hash) (invoices.Invoice, error)
LookupInvoice(context.Context, lntypes.Hash) (invoices.Invoice, error)
// NotifyExitHopHtlc attempts to mark an invoice as settled. If the
// invoice is a debug invoice, then this method is a noop as debug