forked from TrueCloudLab/neoneo-go
9987afea4c
Lightweight thing to import anywhere, pkg/config should not be dependent on Level/Bolt/anything else.
21 lines
481 B
Go
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
|
|
}
|