multi: rename FetchLightningNode
to FetchNode
This commit is contained in:
12 files changed
+41
-42
No files matched your search
+13
-13
@@ -127,7 +127,7 @@ func TestNodeInsertionAndDeletion(t *testing.T) {
|
||||
|
||||
// Next, fetch the node from the database to ensure everything was
|
||||
// serialized properly.
|
||||
dbNode, err := graph.FetchLightningNode(ctx, testPub)
|
||||
dbNode, err := graph.FetchNode(ctx, testPub)
|
||||
require.NoError(t, err, "unable to locate node")
|
||||
|
||||
_, exists, err := graph.HasLightningNode(ctx, dbNode.PubKeyBytes)
|
||||
@@ -163,7 +163,7 @@ func TestNodeInsertionAndDeletion(t *testing.T) {
|
||||
|
||||
// Finally, attempt to fetch the node again. This should fail as the
|
||||
// node should have been deleted from the database.
|
||||
_, err = graph.FetchLightningNode(ctx, testPub)
|
||||
_, err = graph.FetchNode(ctx, testPub)
|
||||
require.ErrorIs(t, err, ErrGraphNodeNotFound)
|
||||
|
||||
// Now, we'll specifically test the updating of addresses of a node
|
||||
@@ -185,7 +185,7 @@ func TestNodeInsertionAndDeletion(t *testing.T) {
|
||||
require.NoError(t, graph.AddNode(ctx, node))
|
||||
|
||||
// Fetch the node and assert the empty addresses.
|
||||
dbNode, err = graph.FetchLightningNode(ctx, testPub)
|
||||
dbNode, err = graph.FetchNode(ctx, testPub)
|
||||
require.NoError(t, err)
|
||||
compareNodes(t, node, dbNode)
|
||||
|
||||
@@ -214,7 +214,7 @@ func TestNodeInsertionAndDeletion(t *testing.T) {
|
||||
require.NoError(t, graph.AddNode(ctx, node))
|
||||
|
||||
// Fetch the node and assert the updated addresses.
|
||||
dbNode, err = graph.FetchLightningNode(ctx, testPub)
|
||||
dbNode, err = graph.FetchNode(ctx, testPub)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, expAddrs, dbNode.Addresses)
|
||||
|
||||
@@ -235,7 +235,7 @@ func TestNodeInsertionAndDeletion(t *testing.T) {
|
||||
require.NoError(t, graph.AddNode(ctx, node))
|
||||
|
||||
// Fetch the node and assert the updated addresses.
|
||||
dbNode, err = graph.FetchLightningNode(ctx, testPub)
|
||||
dbNode, err = graph.FetchNode(ctx, testPub)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, expAddrs, dbNode.Addresses)
|
||||
|
||||
@@ -248,7 +248,7 @@ func TestNodeInsertionAndDeletion(t *testing.T) {
|
||||
require.NoError(t, graph.AddNode(ctx, node))
|
||||
|
||||
// Fetch the node and assert the updated addresses.
|
||||
dbNode, err = graph.FetchLightningNode(ctx, testPub)
|
||||
dbNode, err = graph.FetchNode(ctx, testPub)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, expAddrs, dbNode.Addresses)
|
||||
|
||||
@@ -296,9 +296,9 @@ func TestPartialNode(t *testing.T) {
|
||||
|
||||
// Next, fetch the node2 from the database to ensure everything was
|
||||
// serialized properly.
|
||||
dbNode1, err := graph.FetchLightningNode(ctx, pubKey1)
|
||||
dbNode1, err := graph.FetchNode(ctx, pubKey1)
|
||||
require.NoError(t, err)
|
||||
dbNode2, err := graph.FetchLightningNode(ctx, pubKey2)
|
||||
dbNode2, err := graph.FetchNode(ctx, pubKey2)
|
||||
require.NoError(t, err)
|
||||
|
||||
_, exists, err := graph.HasLightningNode(ctx, dbNode1.PubKeyBytes)
|
||||
@@ -336,7 +336,7 @@ func TestPartialNode(t *testing.T) {
|
||||
|
||||
// Finally, attempt to fetch the node again. This should fail as the
|
||||
// node should have been deleted from the database.
|
||||
_, err = graph.FetchLightningNode(ctx, testPub)
|
||||
_, err = graph.FetchNode(ctx, testPub)
|
||||
require.ErrorIs(t, err, ErrGraphNodeNotFound)
|
||||
}
|
||||
|
||||
@@ -3443,7 +3443,7 @@ func TestPruneGraphNodes(t *testing.T) {
|
||||
|
||||
// Finally, we'll ensure that node3, the only fully unconnected node as
|
||||
// properly deleted from the graph and not another node in its place.
|
||||
_, err := graph.FetchLightningNode(ctx, node3.PubKeyBytes)
|
||||
_, err := graph.FetchNode(ctx, node3.PubKeyBytes)
|
||||
require.NotNil(t, err)
|
||||
}
|
||||
|
||||
@@ -3469,11 +3469,11 @@ func TestAddChannelEdgeShellNodes(t *testing.T) {
|
||||
|
||||
// Ensure that node1 was inserted as a full node, while node2 only has
|
||||
// a shell node present.
|
||||
node1, err := graph.FetchLightningNode(ctx, node1.PubKeyBytes)
|
||||
node1, err := graph.FetchNode(ctx, node1.PubKeyBytes)
|
||||
require.NoError(t, err, "unable to fetch node1")
|
||||
require.True(t, node1.HaveNodeAnnouncement)
|
||||
|
||||
node2, err = graph.FetchLightningNode(ctx, node2.PubKeyBytes)
|
||||
node2, err = graph.FetchNode(ctx, node2.PubKeyBytes)
|
||||
require.NoError(t, err, "unable to fetch node2")
|
||||
require.False(t, node2.HaveNodeAnnouncement)
|
||||
|
||||
@@ -4470,7 +4470,7 @@ func TestLightningNodePersistence(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
// Read the node from disk.
|
||||
diskNode, err := graph.FetchLightningNode(ctx, node.PubKeyBytes)
|
||||
diskNode, err := graph.FetchNode(ctx, node.PubKeyBytes)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Convert it back to a wire message.
|
||||
|
||||
Reference in new issue
Block a user