aboutsummaryrefslogtreecommitdiffstats
path: root/core/dao_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/dao_test.go')
-rw-r--r--core/dao_test.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/core/dao_test.go b/core/dao_test.go
index 45b3235c7..c0d482630 100644
--- a/core/dao_test.go
+++ b/core/dao_test.go
@@ -34,17 +34,18 @@ func TestDAOForkRangeExtradata(t *testing.T) {
// Generate a common prefix for both pro-forkers and non-forkers
db, _ := ethdb.NewMemDatabase()
- genesis := WriteGenesisBlockForTesting(db)
+ gspec := new(Genesis)
+ genesis := gspec.MustCommit(db)
prefix, _ := GenerateChain(params.TestChainConfig, genesis, db, int(forkBlock.Int64()-1), func(i int, gen *BlockGen) {})
// Create the concurrent, conflicting two nodes
proDb, _ := ethdb.NewMemDatabase()
- WriteGenesisBlockForTesting(proDb)
+ gspec.MustCommit(proDb)
proConf := &params.ChainConfig{HomesteadBlock: big.NewInt(0), DAOForkBlock: forkBlock, DAOForkSupport: true}
proBc, _ := NewBlockChain(proDb, proConf, new(pow.FakePow), new(event.TypeMux), vm.Config{})
conDb, _ := ethdb.NewMemDatabase()
- WriteGenesisBlockForTesting(conDb)
+ gspec.MustCommit(conDb)
conConf := &params.ChainConfig{HomesteadBlock: big.NewInt(0), DAOForkBlock: forkBlock, DAOForkSupport: false}
conBc, _ := NewBlockChain(conDb, conConf, new(pow.FakePow), new(event.TypeMux), vm.Config{})
@@ -58,7 +59,7 @@ func TestDAOForkRangeExtradata(t *testing.T) {
for i := int64(0); i < params.DAOForkExtraRange.Int64(); i++ {
// Create a pro-fork block, and try to feed into the no-fork chain
db, _ = ethdb.NewMemDatabase()
- WriteGenesisBlockForTesting(db)
+ gspec.MustCommit(db)
bc, _ := NewBlockChain(db, conConf, new(pow.FakePow), new(event.TypeMux), vm.Config{})
blocks := conBc.GetBlocksFromHash(conBc.CurrentBlock().Hash(), int(conBc.CurrentBlock().NumberU64()+1))
@@ -79,7 +80,7 @@ func TestDAOForkRangeExtradata(t *testing.T) {
}
// Create a no-fork block, and try to feed into the pro-fork chain
db, _ = ethdb.NewMemDatabase()
- WriteGenesisBlockForTesting(db)
+ gspec.MustCommit(db)
bc, _ = NewBlockChain(db, proConf, new(pow.FakePow), new(event.TypeMux), vm.Config{})
blocks = proBc.GetBlocksFromHash(proBc.CurrentBlock().Hash(), int(proBc.CurrentBlock().NumberU64()+1))
@@ -101,7 +102,7 @@ func TestDAOForkRangeExtradata(t *testing.T) {
}
// Verify that contra-forkers accept pro-fork extra-datas after forking finishes
db, _ = ethdb.NewMemDatabase()
- WriteGenesisBlockForTesting(db)
+ gspec.MustCommit(db)
bc, _ := NewBlockChain(db, conConf, new(pow.FakePow), new(event.TypeMux), vm.Config{})
blocks := conBc.GetBlocksFromHash(conBc.CurrentBlock().Hash(), int(conBc.CurrentBlock().NumberU64()+1))
@@ -117,7 +118,7 @@ func TestDAOForkRangeExtradata(t *testing.T) {
}
// Verify that pro-forkers accept contra-fork extra-datas after forking finishes
db, _ = ethdb.NewMemDatabase()
- WriteGenesisBlockForTesting(db)
+ gspec.MustCommit(db)
bc, _ = NewBlockChain(db, proConf, new(pow.FakePow), new(event.TypeMux), vm.Config{})
blocks = proBc.GetBlocksFromHash(proBc.CurrentBlock().Hash(), int(proBc.CurrentBlock().NumberU64()+1))