Skip to content

Commit

Permalink
core/rawdb: simplify TestDiskSeek to use memorydb (ethereum#25182)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronbuchwald authored and maoueh committed Nov 29, 2022
1 parent 9bb31e5 commit 390e17e
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions core/state/snapshot/disklayer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@ package snapshot

import (
"bytes"
"io/ioutil"
"os"
"testing"

"github.com/VictoriaMetrics/fastcache"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/ethdb/leveldb"
"github.com/ethereum/go-ethereum/ethdb/memorydb"
"github.com/ethereum/go-ethereum/rlp"
)
Expand Down Expand Up @@ -518,18 +514,7 @@ func TestDiskMidAccountPartialMerge(t *testing.T) {
// TestDiskSeek tests that seek-operations work on the disk layer
func TestDiskSeek(t *testing.T) {
// Create some accounts in the disk layer
var db ethdb.Database

if dir, err := ioutil.TempDir("", "disklayer-test"); err != nil {
t.Fatal(err)
} else {
defer os.RemoveAll(dir)
diskdb, err := leveldb.New(dir, 256, 0, "", false, false)
if err != nil {
t.Fatal(err)
}
db = rawdb.NewDatabase(diskdb)
}
db := rawdb.NewMemoryDatabase()
// Fill even keys [0,2,4...]
for i := 0; i < 0xff; i += 2 {
acc := common.Hash{byte(i)}
Expand Down

0 comments on commit 390e17e

Please sign in to comment.