graph/db: thread context through to FetchLightingNode

This commit is contained in:
Elle Mouton
2025-06-17 11:44:33 +02:00
parent d1cfb47428
commit 66c5a97202
12 changed files with 47 additions and 39 deletions

View File

@@ -395,6 +395,8 @@ func TestPrefAttachmentSelectSkipNodes(t *testing.T) {
func (d *testDBGraph) addRandChannel(node1, node2 *btcec.PublicKey,
capacity btcutil.Amount) (*ChannelEdge, *ChannelEdge, error) {
ctx := context.Background()
fetchNode := func(pub *btcec.PublicKey) (*models.LightningNode, error) {
if pub != nil {
vertex, err := route.NewVertexFromBytes(
@@ -404,7 +406,7 @@ func (d *testDBGraph) addRandChannel(node1, node2 *btcec.PublicKey,
return nil, err
}
dbNode, err := d.db.FetchLightningNode(vertex)
dbNode, err := d.db.FetchLightningNode(ctx, vertex)
switch {
case errors.Is(err, graphdb.ErrGraphNodeNotFound):
fallthrough
@@ -737,7 +739,7 @@ func (t *testNodeTx) ForEachChannel(f func(*models.ChannelEdgeInfo,
}
func (t *testNodeTx) FetchNode(pub route.Vertex) (graphdb.NodeRTx, error) {
node, err := t.db.db.FetchLightningNode(pub)
node, err := t.db.db.FetchLightningNode(context.Background(), pub)
if err != nil {
return nil, err
}