prysm-pulse/beacon-chain/db/slasherkv/kv_test.go
Raul Jordan 8cda50f179
Optimized Slasher Database Methods (#8805)
* slasher kv additions

* gaz

* pass tests
2021-04-23 12:06:13 -05:00

19 lines
422 B
Go

package slasherkv
import (
"context"
"testing"
"github.com/prysmaticlabs/prysm/shared/testutil/require"
)
// setupDB instantiates and returns a Store instance.
func setupDB(t testing.TB) *Store {
db, err := NewKVStore(context.Background(), t.TempDir(), &Config{})
require.NoError(t, err, "Failed to instantiate DB")
t.Cleanup(func() {
require.NoError(t, db.Close(), "Failed to close database")
})
return db
}