graph: add ReadOnlyGraph interface to GraphSource interface

In this commit, we take the existing graphsession.ReadyOnlyGraph
interface and remove its usage of a kvdb.RTx and replace it with a more
abstract `RTx` interface type.

The new GraphSource interface is expanded to include the
graphsession.ReadOnlyGraph interface and the implementation of it,
DBSource, is expanded to include the new methods. It converts the
given RTx to the underlying kvdb read transaction where needed.
This commit is contained in:
Elle Mouton
2024-11-11 16:24:46 +02:00
parent 6c008ff8fb
commit aa2480464b
6 changed files with 135 additions and 15 deletions

View File

@@ -1,6 +1,9 @@
package sources
import "github.com/lightningnetwork/lnd/graph/session"
// GraphSource defines the read-only graph interface required by LND for graph
// related queries.
type GraphSource interface {
session.ReadOnlyGraph
}