diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-09-24 20:57:49 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2019-03-06 19:35:03 +0800 |
commit | 054412e33528e53f6deae940c870217b614707b9 (patch) | |
tree | 7ffc999bb39384e1bfa8c71d80923879fc2e866b /les/helper_test.go | |
parent | 15eee47ebf878b4eff3c2359b9eaa57bba397448 (diff) | |
download | go-tangerine-054412e33528e53f6deae940c870217b614707b9.tar go-tangerine-054412e33528e53f6deae940c870217b614707b9.tar.gz go-tangerine-054412e33528e53f6deae940c870217b614707b9.tar.bz2 go-tangerine-054412e33528e53f6deae940c870217b614707b9.tar.lz go-tangerine-054412e33528e53f6deae940c870217b614707b9.tar.xz go-tangerine-054412e33528e53f6deae940c870217b614707b9.tar.zst go-tangerine-054412e33528e53f6deae940c870217b614707b9.zip |
all: clean up and proerly abstract database access
Diffstat (limited to 'les/helper_test.go')
-rw-r--r-- | les/helper_test.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/les/helper_test.go b/les/helper_test.go index a8097708e..020c69e17 100644 --- a/les/helper_test.go +++ b/les/helper_test.go @@ -30,6 +30,7 @@ import ( "github.com/ethereum/go-ethereum/common/mclock" "github.com/ethereum/go-ethereum/consensus/ethash" "github.com/ethereum/go-ethereum/core" + "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/crypto" @@ -331,7 +332,7 @@ type TestEntity struct { // newServerEnv creates a server testing environment with a connected test peer for testing purpose. func newServerEnv(t *testing.T, blocks int, protocol int, waitIndexers func(*core.ChainIndexer, *core.ChainIndexer, *core.ChainIndexer)) (*TestEntity, func()) { - db := ethdb.NewMemDatabase() + db := rawdb.NewMemoryDatabase() cIndexer, bIndexer, btIndexer := testIndexers(db, nil, light.TestServerIndexerConfig) pm := newTestProtocolManagerMust(t, false, blocks, testChainGen, nil, nil, db, nil) @@ -363,7 +364,7 @@ func newServerEnv(t *testing.T, blocks int, protocol int, waitIndexers func(*cor // newClientServerEnv creates a client/server arch environment with a connected les server and light client pair // for testing purpose. func newClientServerEnv(t *testing.T, blocks int, protocol int, waitIndexers func(*core.ChainIndexer, *core.ChainIndexer, *core.ChainIndexer), newPeer bool) (*TestEntity, *TestEntity, func()) { - db, ldb := ethdb.NewMemDatabase(), ethdb.NewMemDatabase() + db, ldb := rawdb.NewMemoryDatabase(), rawdb.NewMemoryDatabase() peers, lPeers := newPeerSet(), newPeerSet() dist := newRequestDistributor(lPeers, make(chan struct{}), &mclock.System{}) |