graph/db: rename DeleteLightningNode
to DeleteNode
This commit is contained in:
5 files changed
+13
-13
No files matched your search
+3
-3
@@ -295,12 +295,12 @@ func (c *ChannelGraph) AddNode(ctx context.Context,
|
|||||||
return nil
|
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.
|
// 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 {
|
nodePub route.Vertex) error {
|
||||||
|
|
||||||
err := c.V1Store.DeleteLightningNode(ctx, nodePub)
|
err := c.V1Store.DeleteNode(ctx, nodePub)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,13 +151,13 @@ func TestNodeInsertionAndDeletion(t *testing.T) {
|
|||||||
|
|
||||||
// Next, delete the node from the graph, this should purge all data
|
// Next, delete the node from the graph, this should purge all data
|
||||||
// related to the node.
|
// related to the node.
|
||||||
require.NoError(t, graph.DeleteLightningNode(ctx, testPub))
|
require.NoError(t, graph.DeleteNode(ctx, testPub))
|
||||||
assertNodeNotInCache(t, graph, testPub)
|
assertNodeNotInCache(t, graph, testPub)
|
||||||
|
|
||||||
// Attempting to delete the node again should return an error since
|
// Attempting to delete the node again should return an error since
|
||||||
// the node is no longer known.
|
// the node is no longer known.
|
||||||
require.ErrorIs(
|
require.ErrorIs(
|
||||||
t, graph.DeleteLightningNode(ctx, testPub),
|
t, graph.DeleteNode(ctx, testPub),
|
||||||
ErrGraphNodeNotFound,
|
ErrGraphNodeNotFound,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -331,7 +331,7 @@ func TestPartialNode(t *testing.T) {
|
|||||||
|
|
||||||
// Next, delete the node from the graph, this should purge all data
|
// Next, delete the node from the graph, this should purge all data
|
||||||
// related to the node.
|
// related to the node.
|
||||||
require.NoError(t, graph.DeleteLightningNode(ctx, pubKey1))
|
require.NoError(t, graph.DeleteNode(ctx, pubKey1))
|
||||||
assertNodeNotInCache(t, graph, testPub)
|
assertNodeNotInCache(t, graph, testPub)
|
||||||
|
|
||||||
// Finally, attempt to fetch the node again. This should fail as the
|
// 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
|
// We'll now delete the node from the graph, this should result in it
|
||||||
// being removed from the update index as well.
|
// being removed from the update index as well.
|
||||||
err = graph.DeleteLightningNode(ctx, node1.PubKeyBytes)
|
err = graph.DeleteNode(ctx, node1.PubKeyBytes)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
// Now that the node has been deleted, we'll again query the nodes in
|
// Now that the node has been deleted, we'll again query the nodes in
|
||||||
|
|||||||
@@ -101,9 +101,9 @@ type V1Store interface { //nolint:interfacebloat
|
|||||||
// node.
|
// node.
|
||||||
LookupAlias(ctx context.Context, pub *btcec.PublicKey) (string, error)
|
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.
|
// 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
|
// NodeUpdatesInHorizon returns all the known lightning node which have
|
||||||
// an update timestamp within the passed range. This method can be used
|
// an update timestamp within the passed range. This method can be used
|
||||||
|
|||||||
@@ -1061,9 +1061,9 @@ func (c *KVStore) LookupAlias(_ context.Context,
|
|||||||
return alias, nil
|
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.
|
// 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 {
|
nodePub route.Vertex) error {
|
||||||
|
|
||||||
// TODO(roasbeef): ensure dangling edges are removed...
|
// TODO(roasbeef): ensure dangling edges are removed...
|
||||||
|
|||||||
@@ -369,11 +369,11 @@ func (s *SQLStore) AddrsForNode(ctx context.Context,
|
|||||||
return known, addresses, nil
|
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.
|
// from the database according to the node's public key.
|
||||||
//
|
//
|
||||||
// NOTE: part of the V1Store interface.
|
// NOTE: part of the V1Store interface.
|
||||||
func (s *SQLStore) DeleteLightningNode(ctx context.Context,
|
func (s *SQLStore) DeleteNode(ctx context.Context,
|
||||||
pubKey route.Vertex) error {
|
pubKey route.Vertex) error {
|
||||||
|
|
||||||
err := s.db.ExecTx(ctx, sqldb.WriteTxOpt(), func(db SQLQueries) error {
|
err := s.db.ExecTx(ctx, sqldb.WriteTxOpt(), func(db SQLQueries) error {
|
||||||
|
|||||||
Reference in new issue
Block a user