aboutsummaryrefslogtreecommitdiffstats
path: root/eth/helper_test.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-09-24 20:57:49 +0800
committerPéter Szilágyi <peterke@gmail.com>2019-03-06 19:35:03 +0800
commit054412e33528e53f6deae940c870217b614707b9 (patch)
tree7ffc999bb39384e1bfa8c71d80923879fc2e866b /eth/helper_test.go
parent15eee47ebf878b4eff3c2359b9eaa57bba397448 (diff)
downloadgo-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 'eth/helper_test.go')
-rw-r--r--eth/helper_test.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/eth/helper_test.go b/eth/helper_test.go
index b18a02baf..e91429b8c 100644
--- a/eth/helper_test.go
+++ b/eth/helper_test.go
@@ -30,6 +30,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"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"
@@ -49,11 +50,11 @@ var (
// newTestProtocolManager creates a new protocol manager for testing purposes,
// with the given number of blocks already known, and potential notification
// channels for different events.
-func newTestProtocolManager(mode downloader.SyncMode, blocks int, generator func(int, *core.BlockGen), newtx chan<- []*types.Transaction) (*ProtocolManager, *ethdb.MemDatabase, error) {
+func newTestProtocolManager(mode downloader.SyncMode, blocks int, generator func(int, *core.BlockGen), newtx chan<- []*types.Transaction) (*ProtocolManager, ethdb.Database, error) {
var (
evmux = new(event.TypeMux)
engine = ethash.NewFaker()
- db = ethdb.NewMemDatabase()
+ db = rawdb.NewMemoryDatabase()
gspec = &core.Genesis{
Config: params.TestChainConfig,
Alloc: core.GenesisAlloc{testBank: {Balance: big.NewInt(1000000)}},
@@ -78,7 +79,7 @@ func newTestProtocolManager(mode downloader.SyncMode, blocks int, generator func
// with the given number of blocks already known, and potential notification
// channels for different events. In case of an error, the constructor force-
// fails the test.
-func newTestProtocolManagerMust(t *testing.T, mode downloader.SyncMode, blocks int, generator func(int, *core.BlockGen), newtx chan<- []*types.Transaction) (*ProtocolManager, *ethdb.MemDatabase) {
+func newTestProtocolManagerMust(t *testing.T, mode downloader.SyncMode, blocks int, generator func(int, *core.BlockGen), newtx chan<- []*types.Transaction) (*ProtocolManager, ethdb.Database) {
pm, db, err := newTestProtocolManager(mode, blocks, generator, newtx)
if err != nil {
t.Fatalf("Failed to create protocol manager: %v", err)