neoneo-go/pkg/core/storage/leveldb_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

21 lines
481 B
Go

package storage
import (
"testing"
"github.com/nspcc-dev/neo-go/pkg/core/storage/dbconfig"
"github.com/stretchr/testify/require"
)
func newLevelDBForTesting(t testing.TB) Store {
ldbDir := t.TempDir()
dbConfig := dbconfig.DBConfiguration{
Type: "leveldb",
LevelDBOptions: dbconfig.LevelDBOptions{
DataDirectoryPath: ldbDir,
},
}
newLevelStore, err := NewLevelDBStore(dbConfig.LevelDBOptions)
require.Nil(t, err, "NewLevelDBStore error")
return newLevelStore
}