From 7a1b548e07cfb92562f35b3f9e4d04cd2ad6b3ad Mon Sep 17 00:00:00 2001 From: Elle Mouton Date: Mon, 1 Sep 2025 14:22:34 +0200 Subject: [PATCH] graph/db: rename DeleteLightningNode to DeleteNode --- graph/db/graph.go | 6 +++--- graph/db/graph_test.go | 8 ++++---- graph/db/interfaces.go | 4 ++-- graph/db/kv_store.go | 4 ++-- graph/db/sql_store.go | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/graph/db/graph.go b/graph/db/graph.go index 104c68b15..08e287238 100644 --- a/graph/db/graph.go +++ b/graph/db/graph.go @@ -295,12 +295,12 @@ func (c *ChannelGraph) AddNode(ctx context.Context, return nil } -// DeleteLightningNode starts a new database transaction to remove a vertex/node +// DeleteNode starts a new database transaction to remove a vertex/node // from the database according to the node's public key. -func (c *ChannelGraph) DeleteLightningNode(ctx context.Context, +func (c *ChannelGraph) DeleteNode(ctx context.Context, nodePub route.Vertex) error { - err := c.V1Store.DeleteLightningNode(ctx, nodePub) + err := c.V1Store.DeleteNode(ctx, nodePub) if err != nil { return err } diff --git a/graph/db/graph_test.go b/graph/db/graph_test.go index 1b4afeab1..e993c66bd 100644 --- a/graph/db/graph_test.go +++ b/graph/db/graph_test.go @@ -151,13 +151,13 @@ func TestNodeInsertionAndDeletion(t *testing.T) { // Next, delete the node from the graph, this should purge all data // related to the node. - require.NoError(t, graph.DeleteLightningNode(ctx, testPub)) + require.NoError(t, graph.DeleteNode(ctx, testPub)) assertNodeNotInCache(t, graph, testPub) // Attempting to delete the node again should return an error since // the node is no longer known. require.ErrorIs( - t, graph.DeleteLightningNode(ctx, testPub), + t, graph.DeleteNode(ctx, testPub), ErrGraphNodeNotFound, ) @@ -331,7 +331,7 @@ func TestPartialNode(t *testing.T) { // Next, delete the node from the graph, this should purge all data // related to the node. - require.NoError(t, graph.DeleteLightningNode(ctx, pubKey1)) + require.NoError(t, graph.DeleteNode(ctx, pubKey1)) assertNodeNotInCache(t, graph, testPub) // Finally, attempt to fetch the node again. This should fail as the @@ -3520,7 +3520,7 @@ func TestNodePruningUpdateIndexDeletion(t *testing.T) { // We'll now delete the node from the graph, this should result in it // being removed from the update index as well. - err = graph.DeleteLightningNode(ctx, node1.PubKeyBytes) + err = graph.DeleteNode(ctx, node1.PubKeyBytes) require.NoError(t, err) // Now that the node has been deleted, we'll again query the nodes in diff --git a/graph/db/interfaces.go b/graph/db/interfaces.go index 30fef2381..0a808ae55 100644 --- a/graph/db/interfaces.go +++ b/graph/db/interfaces.go @@ -101,9 +101,9 @@ type V1Store interface { //nolint:interfacebloat // node. LookupAlias(ctx context.Context, pub *btcec.PublicKey) (string, error) - // DeleteLightningNode starts a new database transaction to remove a + // DeleteNode starts a new database transaction to remove a // vertex/node from the database according to the node's public key. - DeleteLightningNode(ctx context.Context, nodePub route.Vertex) error + DeleteNode(ctx context.Context, nodePub route.Vertex) error // NodeUpdatesInHorizon returns all the known lightning node which have // an update timestamp within the passed range. This method can be used diff --git a/graph/db/kv_store.go b/graph/db/kv_store.go index f57553a10..26c616820 100644 --- a/graph/db/kv_store.go +++ b/graph/db/kv_store.go @@ -1061,9 +1061,9 @@ func (c *KVStore) LookupAlias(_ context.Context, return alias, nil } -// DeleteLightningNode starts a new database transaction to remove a vertex/node +// DeleteNode starts a new database transaction to remove a vertex/node // from the database according to the node's public key. -func (c *KVStore) DeleteLightningNode(_ context.Context, +func (c *KVStore) DeleteNode(_ context.Context, nodePub route.Vertex) error { // TODO(roasbeef): ensure dangling edges are removed... diff --git a/graph/db/sql_store.go b/graph/db/sql_store.go index 0bc19a3aa..43b5941b4 100644 --- a/graph/db/sql_store.go +++ b/graph/db/sql_store.go @@ -369,11 +369,11 @@ func (s *SQLStore) AddrsForNode(ctx context.Context, return known, addresses, nil } -// DeleteLightningNode starts a new database transaction to remove a vertex/node +// DeleteNode starts a new database transaction to remove a vertex/node // from the database according to the node's public key. // // NOTE: part of the V1Store interface. -func (s *SQLStore) DeleteLightningNode(ctx context.Context, +func (s *SQLStore) DeleteNode(ctx context.Context, pubKey route.Vertex) error { err := s.db.ExecTx(ctx, sqldb.WriteTxOpt(), func(db SQLQueries) error {