mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-11 04:00:05 +00:00
c44a30672e
* Add interface and move slashing types to /types package * WIP restructure to match beacon chain DB * Fix build * Fix comment * Fix comments * fix comments for sure * Use wrapper function for evict * Remove unused * Update slasher/db/kv/kv.go * Update slasher/db/testing/BUILD.bazel * Update slasher/db/types/BUILD.bazel * Update slasher/db/types/types.go Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
25 lines
462 B
Go
25 lines
462 B
Go
package testing
|
|
|
|
import (
|
|
"flag"
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/urfave/cli"
|
|
)
|
|
|
|
func TestClearDB(t *testing.T) {
|
|
app := cli.NewApp()
|
|
set := flag.NewFlagSet("test", 0)
|
|
ctx := cli.NewContext(app, set, nil)
|
|
slasherDB := SetupSlasherDB(t, ctx)
|
|
defer TeardownSlasherDB(t, slasherDB)
|
|
if err := slasherDB.ClearDB(); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
if _, err := os.Stat(slasherDB.DatabasePath()); !os.IsNotExist(err) {
|
|
t.Fatalf("db wasnt cleared %v", err)
|
|
}
|
|
}
|