Queued level db writes and batch writes. Closes #647

This commit is contained in:
obscuren
2015-04-07 22:19:01 +02:00
parent 758205b187
commit 7f32a08b60
3 changed files with 97 additions and 49 deletions

View File

@ -1,26 +1,19 @@
package ethdb
/*
import (
"bytes"
"testing"
"os"
"path"
"github.com/ethereum/go-ethereum/common"
)
func TestCompression(t *testing.T) {
db, err := NewLDBDatabase("testdb")
if err != nil {
t.Fatal(err)
func newDb() *LDBDatabase {
file := path.Join("/", "tmp", "ldbtesttmpfile")
if common.FileExist(file) {
os.RemoveAll(file)
}
in := make([]byte, 10)
db.Put([]byte("test1"), in)
out, err := db.Get([]byte("test1"))
if err != nil {
t.Fatal(err)
}
db, _ := NewLDBDatabase(file)
if bytes.Compare(out, in) != 0 {
t.Error("put get", in, out)
}
return db
}
*/