core: refactor Level store creation for tests

We don't need to create the whole DB configuration structure.
This commit is contained in:
Anna Shaleva 2022-02-25 12:14:17 +03:00
parent 339bec1632
commit 21515e1835

View file

@ -69,13 +69,10 @@ func newTestChainWithCustomCfgAndStore(t testing.TB, st storage.Store, f func(*c
func newLevelDBForTesting(t testing.TB) storage.Store { func newLevelDBForTesting(t testing.TB) storage.Store {
ldbDir := t.TempDir() ldbDir := t.TempDir()
dbConfig := storage.DBConfiguration{ dbOptions := storage.LevelDBOptions{
Type: "leveldb",
LevelDBOptions: storage.LevelDBOptions{
DataDirectoryPath: ldbDir, DataDirectoryPath: ldbDir,
},
} }
newLevelStore, err := storage.NewLevelDBStore(dbConfig.LevelDBOptions) newLevelStore, err := storage.NewLevelDBStore(dbOptions)
require.Nil(t, err, "NewLevelDBStore error") require.Nil(t, err, "NewLevelDBStore error")
return newLevelStore return newLevelStore
} }