Skip to content

Commit

Permalink
Merge pull request #1113 from CosmWasm/close-test-dbs
Browse files Browse the repository at this point in the history
Testing: Close test dbs
  • Loading branch information
alpe committed Dec 5, 2022
2 parents bc00a6b + 52ecb85 commit c5a7e5e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ func setup(t testing.TB, withGenesis bool, invCheckPeriod uint, opts ...wasm.Opt
snapshotDir := filepath.Join(nodeHome, "data", "snapshots")
snapshotDB, err := sdk.NewLevelDB("metadata", snapshotDir)
require.NoError(t, err)
t.Cleanup(func() { snapshotDB.Close() })
snapshotStore, err := snapshots.NewStore(snapshotDB, snapshotDir)
require.NoError(t, err)
baseAppOpts := []func(*bam.BaseApp){bam.SetSnapshotStore(snapshotStore), bam.SetSnapshotKeepRecent(2)}
db := dbm.NewMemDB()
t.Cleanup(func() { db.Close() })
app := NewWasmApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, nodeHome, invCheckPeriod, MakeEncodingConfig(), wasm.EnableAllProposals, EmptyBaseAppOptions{}, opts, baseAppOpts...)
if withGenesis {
return app, NewDefaultGenesisState()
Expand Down

0 comments on commit c5a7e5e

Please sign in to comment.