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 /miner | |
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 'miner')
-rw-r--r-- | miner/worker_test.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/miner/worker_test.go b/miner/worker_test.go index bfa9cbd21..99a671ae3 100644 --- a/miner/worker_test.go +++ b/miner/worker_test.go @@ -26,6 +26,7 @@ import ( "github.com/ethereum/go-ethereum/consensus/clique" "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" @@ -79,7 +80,7 @@ type testWorkerBackend struct { func newTestWorkerBackend(t *testing.T, chainConfig *params.ChainConfig, engine consensus.Engine, n int) *testWorkerBackend { var ( - db = ethdb.NewMemDatabase() + db = rawdb.NewMemoryDatabase() gspec = core.Genesis{ Config: chainConfig, Alloc: core.GenesisAlloc{testBankAddress: {Balance: testBankFunds}}, @@ -142,7 +143,7 @@ func TestPendingStateAndBlockEthash(t *testing.T) { testPendingStateAndBlock(t, ethashChainConfig, ethash.NewFaker()) } func TestPendingStateAndBlockClique(t *testing.T) { - testPendingStateAndBlock(t, cliqueChainConfig, clique.New(cliqueChainConfig.Clique, ethdb.NewMemDatabase())) + testPendingStateAndBlock(t, cliqueChainConfig, clique.New(cliqueChainConfig.Clique, rawdb.NewMemoryDatabase())) } func testPendingStateAndBlock(t *testing.T, chainConfig *params.ChainConfig, engine consensus.Engine) { @@ -174,7 +175,7 @@ func TestEmptyWorkEthash(t *testing.T) { testEmptyWork(t, ethashChainConfig, ethash.NewFaker()) } func TestEmptyWorkClique(t *testing.T) { - testEmptyWork(t, cliqueChainConfig, clique.New(cliqueChainConfig.Clique, ethdb.NewMemDatabase())) + testEmptyWork(t, cliqueChainConfig, clique.New(cliqueChainConfig.Clique, rawdb.NewMemoryDatabase())) } func testEmptyWork(t *testing.T, chainConfig *params.ChainConfig, engine consensus.Engine) { @@ -291,7 +292,7 @@ func TestRegenerateMiningBlockEthash(t *testing.T) { } func TestRegenerateMiningBlockClique(t *testing.T) { - testRegenerateMiningBlock(t, cliqueChainConfig, clique.New(cliqueChainConfig.Clique, ethdb.NewMemDatabase())) + testRegenerateMiningBlock(t, cliqueChainConfig, clique.New(cliqueChainConfig.Clique, rawdb.NewMemoryDatabase())) } func testRegenerateMiningBlock(t *testing.T, chainConfig *params.ChainConfig, engine consensus.Engine) { @@ -356,7 +357,7 @@ func TestAdjustIntervalEthash(t *testing.T) { } func TestAdjustIntervalClique(t *testing.T) { - testAdjustInterval(t, cliqueChainConfig, clique.New(cliqueChainConfig.Clique, ethdb.NewMemDatabase())) + testAdjustInterval(t, cliqueChainConfig, clique.New(cliqueChainConfig.Clique, rawdb.NewMemoryDatabase())) } func testAdjustInterval(t *testing.T, chainConfig *params.ChainConfig, engine consensus.Engine) { |