database_test.go 260 B

12345678910111213141516171819
  1. package ethdb
  2. import (
  3. "os"
  4. "path"
  5. "github.com/ethereum/go-ethereum/common"
  6. )
  7. func newDb() *LDBDatabase {
  8. file := path.Join("/", "tmp", "ldbtesttmpfile")
  9. if common.FileExist(file) {
  10. os.RemoveAll(file)
  11. }
  12. db, _ := NewLDBDatabase(file)
  13. return db
  14. }