diff --git a/ethdb/database_test.go b/ethdb/database_test.go index ba1d94068..0fb2b56b9 100644 --- a/ethdb/database_test.go +++ b/ethdb/database_test.go @@ -95,7 +95,7 @@ func testPutGet(db MinDatabase, t *testing.T) { t.Parallel() for _, k := range testValues { - err := db.Put(testBucket, []byte(k), []byte{1}) + err := db.Put(testBucket, []byte(k), []byte{}) if err != nil { t.Fatalf("put failed: %v", err) } @@ -106,8 +106,8 @@ func testPutGet(db MinDatabase, t *testing.T) { if err != nil { t.Fatalf("get failed: %v", err) } - if len(data) != 1 { - t.Fatalf("get returned wrong result, got %q expected 1", string(data)) + if len(data) != 0 { + t.Fatalf("get returned wrong result, got %q expected nil", string(data)) } } diff --git a/ethdb/kv_lmdb.go b/ethdb/kv_lmdb.go index b1d17219d..0519c04f2 100644 --- a/ethdb/kv_lmdb.go +++ b/ethdb/kv_lmdb.go @@ -425,9 +425,6 @@ func (b *lmdbBucket) Put(key []byte, value []byte) error { if len(key) == 0 { return fmt.Errorf("lmdb doesn't support empty keys. bucket: %s", dbutils.Buckets[b.id]) } - if len(value) == 0 { - return fmt.Errorf("lmdb doesn't support empty values. bucket: %s", dbutils.Buckets[b.id]) - } err := b.tx.tx.Put(b.dbi, key, value, 0) if err != nil { @@ -601,9 +598,6 @@ func (c *lmdbCursor) Put(key []byte, value []byte) error { if len(key) == 0 { return fmt.Errorf("lmdb doesn't support empty keys. bucket: %s", dbutils.Buckets[c.bucket.id]) } - if len(value) == 0 { - return fmt.Errorf("lmdb doesn't support empty values. bucket: %s", dbutils.Buckets[c.bucket.id]) - } if c.cursor == nil { if err := c.initCursor(); err != nil { return err