multi: thread context through to AddrsForNode

This commit is contained in:
Elle Mouton committed 2025-06-17 19:20:59 +02:00
1 parent d1fa5701eb
commit e724e1c3e4
15 files changed
+88 -64

No files matched your search

+4 -2
View File
@@ -1,6 +1,7 @@
package channeldb
import (
"context"
"image/color"
"math"
"math/rand"
@@ -180,6 +181,7 @@ func TestFetchClosedChannelForID(t *testing.T) {
// channel db and graph db.
func TestMultiSourceAddrsForNode(t *testing.T) {
t.Parallel()
ctx := context.Background()
fullDB, err := MakeTestDB(t)
require.NoError(t, err, "unable to make test database")
@@ -194,7 +196,7 @@ func TestMultiSourceAddrsForNode(t *testing.T) {
testNode := createTestVertex(t)
nodePub, err := testNode.PubKey()
require.NoError(t, err)
graph.On("AddrsForNode", nodePub).Return(
graph.On("AddrsForNode", ctx, nodePub).Return(
true, []net.Addr{testAddr}, nil,
).Once()
@@ -212,7 +214,7 @@ func TestMultiSourceAddrsForNode(t *testing.T) {
// Now that we've created a link node, as well as a vertex for the
// node, we'll query for all its addresses.
known, nodeAddrs, err := addrSource.AddrsForNode(nodePub)
known, nodeAddrs, err := addrSource.AddrsForNode(ctx, nodePub)
require.NoError(t, err, "unable to obtain node addrs")
require.True(t, known)