database_test.go 273 Bytes
Newer Older
obscuren's avatar
obscuren committed
1 2 3
package ethdb

import (
4
	"os"
5
	"path/filepath"
6 7

	"github.com/ethereum/go-ethereum/common"
obscuren's avatar
obscuren committed
8
)
9

10
func newDb() *LDBDatabase {
11
	file := filepath.Join("/", "tmp", "ldbtesttmpfile")
12 13
	if common.FileExist(file) {
		os.RemoveAll(file)
14 15
	}

16
	db, _ := NewLDBDatabase(file)
17

18
	return db
19
}