neoneo-go/pkg/core/storage/boltdb_store_test.go
Roman Khimov 9987afea4c storage: move DB configuration into a package on its own
Lightweight thing to import anywhere, pkg/config should not be dependent on
Level/Bolt/anything else.
2022-07-08 23:30:30 +03:00

17 lines
403 B
Go

package storage
import (
"path/filepath"
"testing"
"github.com/nspcc-dev/neo-go/pkg/core/storage/dbconfig"
"github.com/stretchr/testify/require"
)
func newBoltStoreForTesting(t testing.TB) Store {
d := t.TempDir()
testFileName := filepath.Join(d, "test_bolt_db")
boltDBStore, err := NewBoltDBStore(dbconfig.BoltDBOptions{FilePath: testFileName})
require.NoError(t, err)
return boltDBStore
}