@@ -130,6 +130,14 @@ var versionedTests = []versionedTest{
130130 name : "node crud" ,
131131 test : testNodeInsertionAndDeletion ,
132132 },
133+ {
134+ name : "source node" ,
135+ test : testSourceNode ,
136+ },
137+ {
138+ name : "alias lookup" ,
139+ test : testAliasLookup ,
140+ },
133141}
134142
135143// TestVersionedDBs runs various tests against both v1 and v2 versioned
@@ -414,16 +422,15 @@ func TestPartialNode(t *testing.T) {
414422 require .ErrorIs (t , err , ErrGraphNodeNotFound )
415423}
416424
417- // TestAliasLookup tests the alias lookup functionality of the graph store.
418- func TestAliasLookup (t * testing.T ) {
419- t .Parallel ()
425+ // testAliasLookup tests the alias lookup functionality of the graph store.
426+ func testAliasLookup (t * testing.T , v lnwire.GossipVersion ) {
420427 ctx := t .Context ()
421428
422- graph := MakeTestGraph (t )
429+ graph := NewVersionedGraph ( MakeTestGraph (t ), v )
423430
424431 // We'd like to test the alias index within the database, so first
425432 // create a new test node.
426- testNode := createTestVertex (t , lnwire . GossipVersion1 )
433+ testNode := createTestVertex (t , v )
427434
428435 // Add the node to the graph's database, this should also insert an
429436 // entry into the alias index for this node.
@@ -438,23 +445,23 @@ func TestAliasLookup(t *testing.T) {
438445 require .Equal (t , testNode .Alias .UnwrapOr ("" ), dbAlias )
439446
440447 // Ensure that looking up a non-existent alias results in an error.
441- node := createTestVertex (t , lnwire . GossipVersion1 )
448+ node := createTestVertex (t , v )
442449 nodePub , err = node .PubKey ()
443450 require .NoError (t , err , "unable to generate pubkey" )
444451 _ , err = graph .LookupAlias (ctx , nodePub )
445452 require .ErrorIs (t , err , ErrNodeAliasNotFound )
446453}
447454
448- // TestSourceNode tests the source node functionality of the graph store.
449- func TestSourceNode (t * testing.T ) {
455+ // testSourceNode tests the source node functionality of the graph store.
456+ func testSourceNode (t * testing.T , v lnwire. GossipVersion ) {
450457 t .Parallel ()
451458 ctx := t .Context ()
452459
453- graph := MakeTestGraph (t )
460+ graph := NewVersionedGraph ( MakeTestGraph (t ), v )
454461
455462 // We'd like to test the setting/getting of the source node, so we
456463 // first create a fake node to use within the test.
457- testNode := createTestVertex (t , lnwire . GossipVersion1 )
464+ testNode := createTestVertex (t , v )
458465
459466 // Attempt to fetch the source node, this should return an error as the
460467 // source node hasn't yet been set.
0 commit comments