faraday/chanevents/test_sql.go
bitromortac 85f0a261a4 chanevents+db: widen test fixtures to testing.TB
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.
2026-06-03 17:55:30 +02:00

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
}