From 21515e1835d115c7e5ea99d68a352a58d531c40e Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Fri, 25 Feb 2022 12:14:17 +0300 Subject: [PATCH] core: refactor Level store creation for tests We don't need to create the whole DB configuration structure. --- pkg/core/helper_test.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/core/helper_test.go b/pkg/core/helper_test.go index 23ecede29..2b31e3391 100644 --- a/pkg/core/helper_test.go +++ b/pkg/core/helper_test.go @@ -69,13 +69,10 @@ func newTestChainWithCustomCfgAndStore(t testing.TB, st storage.Store, f func(*c func newLevelDBForTesting(t testing.TB) storage.Store { ldbDir := t.TempDir() - dbConfig := storage.DBConfiguration{ - Type: "leveldb", - LevelDBOptions: storage.LevelDBOptions{ - DataDirectoryPath: ldbDir, - }, + dbOptions := storage.LevelDBOptions{ + DataDirectoryPath: ldbDir, } - newLevelStore, err := storage.NewLevelDBStore(dbConfig.LevelDBOptions) + newLevelStore, err := storage.NewLevelDBStore(dbOptions) require.Nil(t, err, "NewLevelDBStore error") return newLevelStore }