mirror of
https://github.com/lightninglabs/faraday.git
synced 2026-08-13 12:33:35 +02:00
Promote the existing test-store and test-DB constructors from *testing.T to testing.TB so the upcoming EffectiveUptime benchmark can share the same fixture path as the existing tests. testing.TB is the shared interface of *testing.T and *testing.B, so every current caller keeps type-checking unchanged.
18 lines
429 B
Go
18 lines
429 B
Go
package chanevents
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/lightninglabs/faraday/db/sqlc"
|
|
"github.com/lightningnetwork/lnd/clock"
|
|
"github.com/lightningnetwork/lnd/sqldb/v2"
|
|
)
|
|
|
|
// createStore is a helper function that creates a new Store.
|
|
func createStore(t testing.TB, sqlDB *sqldb.BaseDB, clock clock.Clock) *Store {
|
|
queries := sqlc.NewForType(sqlDB, sqlDB.BackendType)
|
|
|
|
store := NewStore(sqlDB, queries, clock)
|
|
|
|
return store
|
|
}
|