prysm-pulse/validator/db/kv/db_test.go
Raul Jordan 10857223d0
Delete Dead Code in the Validator Client's Database Package (#7970)
* delete deprecated

* mod

* deep source

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2020-11-26 16:50:55 +00:00

21 lines
601 B
Go

package kv
import (
"testing"
"github.com/prysmaticlabs/prysm/shared/testutil/require"
)
// setupDB instantiates and returns a DB instance for the validator client.
func setupDB(t testing.TB, pubkeys [][48]byte) *Store {
db, err := NewKVStore(t.TempDir(), pubkeys)
require.NoError(t, err, "Failed to instantiate DB")
err = db.UpdatePublicKeysBuckets(pubkeys)
require.NoError(t, err, "Failed to create old buckets for public keys")
t.Cleanup(func() {
require.NoError(t, db.Close(), "Failed to close database")
require.NoError(t, db.ClearDB(), "Failed to clear database")
})
return db
}