graph/db: split HasNode into two methods
HasNode currently is very v1 specific since it returns a time.Time timestamp which is specific to V1 node announcements. However, it is mostly only used for the "exists" return value. So here we split it up into HasNode which just checks existence and HasV1Node which retains the same behavaiour as before.
This commit is contained in:
8 files changed
+100
-25
No files matched your search
@@ -2717,11 +2717,11 @@ func TestAddEdgeUnknownVertexes(t *testing.T) {
|
||||
copy(pub2[:], priv2.PubKey().SerializeCompressed())
|
||||
|
||||
// The two nodes we are about to add should not exist yet.
|
||||
_, exists1, err := ctx.graph.HasNode(ctxb, pub1)
|
||||
exists1, err := ctx.graph.HasNode(ctxb, pub1)
|
||||
require.NoError(t, err, "unable to query graph")
|
||||
require.False(t, exists1)
|
||||
|
||||
_, exists2, err := ctx.graph.HasNode(ctxb, pub2)
|
||||
exists2, err := ctx.graph.HasNode(ctxb, pub2)
|
||||
require.NoError(t, err, "unable to query graph")
|
||||
require.False(t, exists2)
|
||||
|
||||
@@ -2778,11 +2778,11 @@ func TestAddEdgeUnknownVertexes(t *testing.T) {
|
||||
|
||||
// After adding the edge between the two previously unknown nodes, they
|
||||
// should have been added to the graph.
|
||||
_, exists1, err = ctx.graph.HasNode(ctxb, pub1)
|
||||
exists1, err = ctx.graph.HasNode(ctxb, pub1)
|
||||
require.NoError(t, err, "unable to query graph")
|
||||
require.True(t, exists1)
|
||||
|
||||
_, exists2, err = ctx.graph.HasNode(ctxb, pub2)
|
||||
exists2, err = ctx.graph.HasNode(ctxb, pub2)
|
||||
require.NoError(t, err, "unable to query graph")
|
||||
require.True(t, exists2)
|
||||
|
||||
|
||||
Reference in new issue
Block a user