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 /eth/downloader | |
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 'eth/downloader')
-rw-r--r-- | eth/downloader/downloader_test.go | 4 | ||||
-rw-r--r-- | eth/downloader/testchain_test.go | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go index 1a42965d3..405d52a71 100644 --- a/eth/downloader/downloader_test.go +++ b/eth/downloader/downloader_test.go @@ -28,6 +28,7 @@ import ( ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/event" @@ -71,8 +72,9 @@ func newTester() *downloadTester { ownReceipts: map[common.Hash]types.Receipts{testGenesis.Hash(): nil}, ownChainTd: map[common.Hash]*big.Int{testGenesis.Hash(): testGenesis.Difficulty()}, } - tester.stateDb = ethdb.NewMemDatabase() + tester.stateDb = rawdb.NewMemoryDatabase() tester.stateDb.Put(testGenesis.Root().Bytes(), []byte{0x00}) + tester.downloader = New(FullSync, tester.stateDb, new(event.TypeMux), tester, nil, tester.dropPeer) return tester } diff --git a/eth/downloader/testchain_test.go b/eth/downloader/testchain_test.go index 0b5a21425..4ae342dc6 100644 --- a/eth/downloader/testchain_test.go +++ b/eth/downloader/testchain_test.go @@ -24,9 +24,9 @@ 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/crypto" - "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/params" ) @@ -34,7 +34,7 @@ import ( var ( testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") testAddress = crypto.PubkeyToAddress(testKey.PublicKey) - testDB = ethdb.NewMemDatabase() + testDB = rawdb.NewMemoryDatabase() testGenesis = core.GenesisBlockForTesting(testDB, testAddress, big.NewInt(1000000000)) ) |