storage: close function
add close function to storage interface add common defer function call which will close db connection remove context as soon as it's not needed anymore updated unit tests
This commit is contained in:
parent
b21a220712
commit
264dfef370
11 changed files with 42 additions and 27 deletions
|
@ -246,8 +246,7 @@ func TestHandler(t *testing.T) {
|
|||
cfg, err := config.Load(configPath, net)
|
||||
require.NoError(t, err, "could not load config")
|
||||
|
||||
store, err := storage.NewLevelDBStore(context.Background(),
|
||||
cfg.ApplicationConfiguration.DBConfiguration.LevelDBOptions)
|
||||
store, err := storage.NewLevelDBStore(cfg.ApplicationConfiguration.DBConfiguration.LevelDBOptions)
|
||||
assert.Nil(t, err)
|
||||
chain, err := core.NewBlockchain(context.Background(), store, cfg.ProtocolConfiguration)
|
||||
require.NoError(t, err, "could not create levelDB chain")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue