@@ -72,19 +72,19 @@ var (
7272// and a function to open the connection.
7373type dbConnection struct {
7474 name string
75- open func (testing.TB ) V1Store
75+ open func (testing.TB ) Store
7676}
7777
7878// This var block defines the various database connections that we will use
7979// for testing. Each connection is defined as a dbConnection struct that
8080// contains a name and an open function. The open function is used to create
81- // a new V1Store instance for the given database type.
81+ // a new Store instance for the given database type.
8282var (
8383 // kvdbBBoltConn is a connection to a kvdb-bbolt database called
8484 // channel.db.
8585 kvdbBBoltConn = dbConnection {
8686 name : "kvdb-bbolt" ,
87- open : func (b testing.TB ) V1Store {
87+ open : func (b testing.TB ) Store {
8888 return connectBBoltDB (b , bboltDBPath , kvdbBBoltFile )
8989 },
9090 }
9393 // channel.sqlite.
9494 kvdbSqliteConn = dbConnection {
9595 name : "kvdb-sqlite" ,
96- open : func (b testing.TB ) V1Store {
96+ open : func (b testing.TB ) Store {
9797 return connectKVDBSqlite (
9898 b , kvdbSqlitePath , kvdbSqliteFile ,
9999 )
@@ -104,7 +104,7 @@ var (
104104 // called lnd.sqlite.
105105 nativeSQLSqliteConn = dbConnection {
106106 name : "native-sqlite" ,
107- open : func (b testing.TB ) V1Store {
107+ open : func (b testing.TB ) Store {
108108 return connectNativeSQLite (
109109 b , sqldb .DefaultSQLiteConfig (),
110110 nativeSQLSqlitePath , nativeSQLSqliteFile ,
@@ -116,7 +116,7 @@ var (
116116 // using a postgres connection string.
117117 kvdbPostgresConn = dbConnection {
118118 name : "kvdb-postgres" ,
119- open : func (b testing.TB ) V1Store {
119+ open : func (b testing.TB ) Store {
120120 return connectKVDBPostgres (b , kvdbPostgresDNS )
121121 },
122122 }
@@ -125,7 +125,7 @@ var (
125125 // database using a postgres connection string.
126126 nativeSQLPostgresConn = dbConnection {
127127 name : "native-postgres" ,
128- open : func (b testing.TB ) V1Store {
128+ open : func (b testing.TB ) Store {
129129 return connectNativePostgres (
130130 b , sqldb .DefaultPostgresConfig (),
131131 nativeSQLPostgresDNS ,
@@ -134,10 +134,10 @@ var (
134134 }
135135)
136136
137- // connectNativePostgres creates a V1Store instance backed by a native Postgres
137+ // connectNativePostgres creates a Store instance backed by a native Postgres
138138// database for testing purposes.
139139func connectNativePostgres (t testing.TB , cfg * sqldb.QueryConfig ,
140- dsn string ) V1Store {
140+ dsn string ) Store {
141141
142142 return newSQLStore (t , cfg , sqlPostgres (t , dsn ))
143143}
@@ -157,10 +157,10 @@ func sqlPostgres(t testing.TB, dsn string) BatchedSQLQueries {
157157 return newSQLExecutor (t , store )
158158}
159159
160- // connectNativeSQLite creates a V1Store instance backed by a native SQLite
160+ // connectNativeSQLite creates a Store instance backed by a native SQLite
161161// database for testing purposes.
162162func connectNativeSQLite (t testing.TB , cfg * sqldb.QueryConfig , dbPath ,
163- file string ) V1Store {
163+ file string ) Store {
164164
165165 return newSQLStore (t , cfg , sqlSQLite (t , dbPath , file ))
166166}
@@ -205,9 +205,9 @@ func kvdbPostgres(t testing.TB, dsn string) kvdb.Backend {
205205 return kvStore
206206}
207207
208- // connectKVDBPostgres creates a V1Store instance backed by a kvdb-postgres
208+ // connectKVDBPostgres creates a Store instance backed by a kvdb-postgres
209209// database for testing purposes.
210- func connectKVDBPostgres (t testing.TB , dsn string ) V1Store {
210+ func connectKVDBPostgres (t testing.TB , dsn string ) Store {
211211 return newKVStore (t , kvdbPostgres (t , dsn ))
212212}
213213
@@ -231,14 +231,14 @@ func kvdbSqlite(t testing.TB, dbPath, fileName string) kvdb.Backend {
231231 return kvStore
232232}
233233
234- // connectKVDBSqlite creates a V1Store instance backed by a kvdb-sqlite
234+ // connectKVDBSqlite creates a Store instance backed by a kvdb-sqlite
235235// database for testing purposes.
236- func connectKVDBSqlite (t testing.TB , dbPath , fileName string ) V1Store {
236+ func connectKVDBSqlite (t testing.TB , dbPath , fileName string ) Store {
237237 return newKVStore (t , kvdbSqlite (t , dbPath , fileName ))
238238}
239239
240240// connectBBoltDB creates a new BBolt database connection for testing.
241- func connectBBoltDB (t testing.TB , dbPath , fileName string ) V1Store {
241+ func connectBBoltDB (t testing.TB , dbPath , fileName string ) Store {
242242 return newKVStore (t , kvdbBBolt (t , dbPath , fileName ))
243243}
244244
@@ -261,7 +261,7 @@ func kvdbBBolt(t testing.TB, dbPath, fileName string) kvdb.Backend {
261261
262262// newKVStore creates a new KVStore instance for testing using a provided
263263// kvdb.Backend instance.
264- func newKVStore (t testing.TB , backend kvdb.Backend ) V1Store {
264+ func newKVStore (t testing.TB , backend kvdb.Backend ) Store {
265265 store , err := NewKVStore (backend , testStoreOptions ... )
266266 require .NoError (t , err )
267267
@@ -286,7 +286,7 @@ func newSQLExecutor(t testing.TB, db sqldb.DB) BatchedSQLQueries {
286286// newSQLStore creates a new SQLStore instance for testing using a provided
287287// sqldb.DB instance.
288288func newSQLStore (t testing.TB , cfg * sqldb.QueryConfig ,
289- db BatchedSQLQueries ) V1Store {
289+ db BatchedSQLQueries ) Store {
290290
291291 store , err := NewSQLStore (
292292 & SQLStoreConfig {
@@ -587,7 +587,7 @@ func BenchmarkCacheLoading(b *testing.B) {
587587 }
588588}
589589
590- // BenchmarkGraphReadMethods benchmarks various read calls of various V1Store
590+ // BenchmarkGraphReadMethods benchmarks various read calls of various Store
591591// implementations.
592592//
593593// NOTE: this is to be run against a local graph database. It can be run
@@ -614,11 +614,11 @@ func BenchmarkGraphReadMethods(b *testing.B) {
614614
615615 tests := []struct {
616616 name string
617- fn func (b testing.TB , store V1Store )
617+ fn func (b testing.TB , store Store )
618618 }{
619619 {
620620 name : "ForEachNode" ,
621- fn : func (b testing.TB , store V1Store ) {
621+ fn : func (b testing.TB , store Store ) {
622622 err := store .ForEachNode (
623623 ctx ,
624624 func (_ * models.Node ) error {
@@ -635,7 +635,7 @@ func BenchmarkGraphReadMethods(b *testing.B) {
635635 },
636636 {
637637 name : "ForEachChannel" ,
638- fn : func (b testing.TB , store V1Store ) {
638+ fn : func (b testing.TB , store Store ) {
639639 //nolint:ll
640640 err := store .ForEachChannel (
641641 ctx , func (_ * models.ChannelEdgeInfo ,
@@ -655,7 +655,7 @@ func BenchmarkGraphReadMethods(b *testing.B) {
655655 },
656656 {
657657 name : "NodeUpdatesInHorizon" ,
658- fn : func (b testing.TB , store V1Store ) {
658+ fn : func (b testing.TB , store Store ) {
659659 iter := store .NodeUpdatesInHorizon (
660660 time .Unix (0 , 0 ), time .Now (),
661661 )
@@ -665,7 +665,7 @@ func BenchmarkGraphReadMethods(b *testing.B) {
665665 },
666666 {
667667 name : "ForEachNodeCacheable" ,
668- fn : func (b testing.TB , store V1Store ) {
668+ fn : func (b testing.TB , store Store ) {
669669 err := store .ForEachNodeCacheable (
670670 ctx , func (_ route.Vertex ,
671671 _ * lnwire.FeatureVector ) error {
@@ -683,7 +683,7 @@ func BenchmarkGraphReadMethods(b *testing.B) {
683683 },
684684 {
685685 name : "ForEachNodeCached" ,
686- fn : func (b testing.TB , store V1Store ) {
686+ fn : func (b testing.TB , store Store ) {
687687 //nolint:ll
688688 err := store .ForEachNodeCached (
689689 ctx , false , func (context.Context ,
@@ -704,7 +704,7 @@ func BenchmarkGraphReadMethods(b *testing.B) {
704704 },
705705 {
706706 name : "ChanUpdatesInHorizon" ,
707- fn : func (b testing.TB , store V1Store ) {
707+ fn : func (b testing.TB , store Store ) {
708708 iter := store .ChanUpdatesInHorizon (
709709 time .Unix (0 , 0 ), time .Now (),
710710 )
0 commit comments