graph: rename HasLightningNode

to HasNode
This commit is contained in:
Elle Mouton committed 2025-09-03 10:14:35 +02:00
1 parent 7a1b548e07
commit 330f697937
8 files changed
+16 -18

No files matched your search

+3 -3
View File
@@ -130,7 +130,7 @@ func TestNodeInsertionAndDeletion(t *testing.T) {
dbNode, err := graph.FetchNode(ctx, testPub)
require.NoError(t, err, "unable to locate node")
_, exists, err := graph.HasLightningNode(ctx, dbNode.PubKeyBytes)
_, exists, err := graph.HasNode(ctx, dbNode.PubKeyBytes)
require.NoError(t, err)
require.True(t, exists)
@@ -301,7 +301,7 @@ func TestPartialNode(t *testing.T) {
dbNode2, err := graph.FetchNode(ctx, pubKey2)
require.NoError(t, err)
_, exists, err := graph.HasLightningNode(ctx, dbNode1.PubKeyBytes)
_, exists, err := graph.HasNode(ctx, dbNode1.PubKeyBytes)
require.NoError(t, err)
require.True(t, exists)
@@ -315,7 +315,7 @@ func TestPartialNode(t *testing.T) {
}
compareNodes(t, expectedNode1, dbNode1)
_, exists, err = graph.HasLightningNode(ctx, dbNode2.PubKeyBytes)
_, exists, err = graph.HasNode(ctx, dbNode2.PubKeyBytes)
require.NoError(t, err)
require.True(t, exists)
+2 -3
View File
@@ -118,13 +118,12 @@ type V1Store interface { //nolint:interfacebloat
FetchNode(ctx context.Context, nodePub route.Vertex) (*models.Node,
error)
// HasLightningNode determines if the graph has a vertex identified by
// HasNode determines if the graph has a vertex identified by
// the target node identity public key. If the node exists in the
// database, a timestamp of when the data for the node was lasted
// updated is returned along with a true boolean. Otherwise, an empty
// time.Time is returned with a false boolean.
HasLightningNode(ctx context.Context, nodePub [33]byte) (time.Time,
bool, error)
HasNode(ctx context.Context, nodePub [33]byte) (time.Time, bool, error)
// IsPublicNode is a helper method that determines whether the node with
// the given public key is seen as a public node in the graph from the
+1 -1
View File
@@ -3124,7 +3124,7 @@ func (c *KVStore) fetchLightningNode(tx kvdb.RTx,
// timestamp of when the data for the node was lasted updated is returned along
// with a true boolean. Otherwise, an empty time.Time is returned with a false
// boolean.
func (c *KVStore) HasLightningNode(_ context.Context,
func (c *KVStore) HasNode(_ context.Context,
nodePub [33]byte) (time.Time, bool, error) {
var (
+2 -2
View File
@@ -283,14 +283,14 @@ func (s *SQLStore) FetchNode(ctx context.Context,
return node, nil
}
// HasLightningNode determines if the graph has a vertex identified by the
// HasNode determines if the graph has a vertex identified by the
// target node identity public key. If the node exists in the database, a
// timestamp of when the data for the node was lasted updated is returned along
// with a true boolean. Otherwise, an empty time.Time is returned with a false
// boolean.
//
// NOTE: part of the V1Store interface.
func (s *SQLStore) HasLightningNode(ctx context.Context,
func (s *SQLStore) HasNode(ctx context.Context,
pubKey [33]byte) (time.Time, bool, error) {
var (