graph/db: rename DeleteLightningNode

to DeleteNode
This commit is contained in:
Elle Mouton committed 2025-09-03 10:14:35 +02:00
1 parent cd3bd05810
commit 7a1b548e07
5 files changed
+13 -13

No files matched your search

+3 -3
View File
@@ -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
}
+4 -4
View File
@@ -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
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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...
+2 -2
View File
@@ -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 {