diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-07-14 23:17:03 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-07-16 19:30:05 +0800 |
commit | b8c088377097f040dc51f56d3e375d039e0e9ebe (patch) | |
tree | 91dc0a6be08471c49abb1471e54ec8c3d97d3197 /eth | |
parent | 14bad7e212011337d14e40c9f975efd096ab7418 (diff) | |
download | go-tangerine-b8c088377097f040dc51f56d3e375d039e0e9ebe.tar go-tangerine-b8c088377097f040dc51f56d3e375d039e0e9ebe.tar.gz go-tangerine-b8c088377097f040dc51f56d3e375d039e0e9ebe.tar.bz2 go-tangerine-b8c088377097f040dc51f56d3e375d039e0e9ebe.tar.lz go-tangerine-b8c088377097f040dc51f56d3e375d039e0e9ebe.tar.xz go-tangerine-b8c088377097f040dc51f56d3e375d039e0e9ebe.tar.zst go-tangerine-b8c088377097f040dc51f56d3e375d039e0e9ebe.zip |
[release/1.4.10] accounts, core, eth: pass chain config for chain maker to test DAO
(cherry picked from commit 3291235711082759cd7b70253c02150a80d57011)
Diffstat (limited to 'eth')
-rw-r--r-- | eth/backend_test.go | 2 | ||||
-rw-r--r-- | eth/downloader/downloader_test.go | 2 | ||||
-rw-r--r-- | eth/fetcher/fetcher_test.go | 2 | ||||
-rw-r--r-- | eth/filters/filter_test.go | 4 | ||||
-rw-r--r-- | eth/handler.go | 2 | ||||
-rw-r--r-- | eth/handler_test.go | 2 | ||||
-rw-r--r-- | eth/helper_test.go | 2 |
7 files changed, 8 insertions, 8 deletions
diff --git a/eth/backend_test.go b/eth/backend_test.go index c2bed879b..f5889dee9 100644 --- a/eth/backend_test.go +++ b/eth/backend_test.go @@ -32,7 +32,7 @@ func TestMipmapUpgrade(t *testing.T) { addr := common.BytesToAddress([]byte("jeff")) genesis := core.WriteGenesisBlockForTesting(db) - chain, receipts := core.GenerateChain(genesis, db, 10, func(i int, gen *core.BlockGen) { + chain, receipts := core.GenerateChain(nil, genesis, db, 10, func(i int, gen *core.BlockGen) { var receipts types.Receipts switch i { case 1: diff --git a/eth/downloader/downloader_test.go b/eth/downloader/downloader_test.go index e9e051ded..fac6ef81c 100644 --- a/eth/downloader/downloader_test.go +++ b/eth/downloader/downloader_test.go @@ -55,7 +55,7 @@ func init() { // reassembly. func makeChain(n int, seed byte, parent *types.Block, parentReceipts types.Receipts, heavy bool) ([]common.Hash, map[common.Hash]*types.Header, map[common.Hash]*types.Block, map[common.Hash]types.Receipts) { // Generate the block chain - blocks, receipts := core.GenerateChain(parent, testdb, n, func(i int, block *core.BlockGen) { + blocks, receipts := core.GenerateChain(nil, parent, testdb, n, func(i int, block *core.BlockGen) { block.SetCoinbase(common.Address{seed}) // If a heavy chain is requested, delay blocks to raise difficulty diff --git a/eth/fetcher/fetcher_test.go b/eth/fetcher/fetcher_test.go index 2404c8cfa..6a32be14c 100644 --- a/eth/fetcher/fetcher_test.go +++ b/eth/fetcher/fetcher_test.go @@ -45,7 +45,7 @@ var ( // contains a transaction and every 5th an uncle to allow testing correct block // reassembly. func makeChain(n int, seed byte, parent *types.Block) ([]common.Hash, map[common.Hash]*types.Block) { - blocks, _ := core.GenerateChain(parent, testdb, n, func(i int, block *core.BlockGen) { + blocks, _ := core.GenerateChain(nil, parent, testdb, n, func(i int, block *core.BlockGen) { block.SetCoinbase(common.Address{seed}) // If the block number is multiple of 3, send a bonus transaction to the miner diff --git a/eth/filters/filter_test.go b/eth/filters/filter_test.go index b0f88ffeb..1afe78525 100644 --- a/eth/filters/filter_test.go +++ b/eth/filters/filter_test.go @@ -57,7 +57,7 @@ func BenchmarkMipmaps(b *testing.B) { defer db.Close() genesis := core.WriteGenesisBlockForTesting(db, core.GenesisAccount{Address: addr1, Balance: big.NewInt(1000000)}) - chain, receipts := core.GenerateChain(genesis, db, 100010, func(i int, gen *core.BlockGen) { + chain, receipts := core.GenerateChain(nil, genesis, db, 100010, func(i int, gen *core.BlockGen) { var receipts types.Receipts switch i { case 2403: @@ -133,7 +133,7 @@ func TestFilters(t *testing.T) { defer db.Close() genesis := core.WriteGenesisBlockForTesting(db, core.GenesisAccount{Address: addr, Balance: big.NewInt(1000000)}) - chain, receipts := core.GenerateChain(genesis, db, 1000, func(i int, gen *core.BlockGen) { + chain, receipts := core.GenerateChain(nil, genesis, db, 1000, func(i int, gen *core.BlockGen) { var receipts types.Receipts switch i { case 1: diff --git a/eth/handler.go b/eth/handler.go index 6de099305..d722cbc41 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -505,7 +505,7 @@ func (pm *ProtocolManager) handleMsg(p *peer) error { // If we already have a DAO header, we can check the peer's TD against it. If // the peer's ahead of this, it too must have a reply to the DAO check if daoHeader := pm.blockchain.GetHeaderByNumber(pm.chainconfig.DAOForkBlock.Uint64()); daoHeader != nil { - if p.Td().Cmp(pm.blockchain.GetTd(daoHeader.Hash(), daoHeader.Number.Uint64())) >= 0 { + if p.Td().Cmp(pm.blockchain.GetTd(daoHeader.Hash())) >= 0 { verifyDAO = false } } diff --git a/eth/handler_test.go b/eth/handler_test.go index e0aa35468..2d307452d 100644 --- a/eth/handler_test.go +++ b/eth/handler_test.go @@ -630,7 +630,7 @@ func testDAOChallenge(t *testing.T, localForked, remoteForked bool, timeout bool } // Create a block to reply to the challenge if no timeout is simualted if !timeout { - blocks, _ := core.GenerateChain(genesis, db, 1, func(i int, block *core.BlockGen) { + blocks, _ := core.GenerateChain(nil, genesis, db, 1, func(i int, block *core.BlockGen) { if remoteForked { block.SetExtra(params.DAOForkBlockExtra) } diff --git a/eth/helper_test.go b/eth/helper_test.go index dacb1593f..28ff69b17 100644 --- a/eth/helper_test.go +++ b/eth/helper_test.go @@ -56,7 +56,7 @@ func newTestProtocolManager(fastSync bool, blocks int, generator func(int, *core chainConfig = &core.ChainConfig{HomesteadBlock: big.NewInt(0)} // homestead set to 0 because of chain maker blockchain, _ = core.NewBlockChain(db, chainConfig, pow, evmux) ) - chain, _ := core.GenerateChain(genesis, db, blocks, generator) + chain, _ := core.GenerateChain(nil, genesis, db, blocks, generator) if _, err := blockchain.InsertChain(chain); err != nil { panic(err) } |