chainntnfs: use T.TempDir to create temporary test directory
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
5 files changed
+20
-30
No files matched your search
@@ -5,7 +5,6 @@ package btcdnotify
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"testing"
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
@@ -33,10 +32,12 @@ var (
|
||||
func initHintCache(t *testing.T) *chainntnfs.HeightHintCache {
|
||||
t.Helper()
|
||||
|
||||
tempDir, err := ioutil.TempDir("", "kek")
|
||||
require.NoError(t, err, "unable to create temp dir")
|
||||
db, err := channeldb.Open(tempDir)
|
||||
db, err := channeldb.Open(t.TempDir())
|
||||
require.NoError(t, err, "unable to create db")
|
||||
t.Cleanup(func() {
|
||||
require.NoError(t, db.Close())
|
||||
})
|
||||
|
||||
testCfg := chainntnfs.CacheConfig{
|
||||
QueryDisable: false,
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user