Skip to content

Commit 2870496

Browse files
committed
core: don't import genesis block in TestDAOForkRangeExtradata
The genesis block doesn't have a valid ancestor.
1 parent 30d706c commit 2870496

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/dao_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func TestDAOForkRangeExtradata(t *testing.T) {
6262
gspec.MustCommit(db)
6363
bc, _ := NewBlockChain(db, conConf, ethash.NewFaker(), new(event.TypeMux), vm.Config{})
6464

65-
blocks := conBc.GetBlocksFromHash(conBc.CurrentBlock().Hash(), int(conBc.CurrentBlock().NumberU64()+1))
65+
blocks := conBc.GetBlocksFromHash(conBc.CurrentBlock().Hash(), int(conBc.CurrentBlock().NumberU64()))
6666
for j := 0; j < len(blocks)/2; j++ {
6767
blocks[j], blocks[len(blocks)-1-j] = blocks[len(blocks)-1-j], blocks[j]
6868
}
@@ -83,7 +83,7 @@ func TestDAOForkRangeExtradata(t *testing.T) {
8383
gspec.MustCommit(db)
8484
bc, _ = NewBlockChain(db, proConf, ethash.NewFaker(), new(event.TypeMux), vm.Config{})
8585

86-
blocks = proBc.GetBlocksFromHash(proBc.CurrentBlock().Hash(), int(proBc.CurrentBlock().NumberU64()+1))
86+
blocks = proBc.GetBlocksFromHash(proBc.CurrentBlock().Hash(), int(proBc.CurrentBlock().NumberU64()))
8787
for j := 0; j < len(blocks)/2; j++ {
8888
blocks[j], blocks[len(blocks)-1-j] = blocks[len(blocks)-1-j], blocks[j]
8989
}
@@ -105,7 +105,7 @@ func TestDAOForkRangeExtradata(t *testing.T) {
105105
gspec.MustCommit(db)
106106
bc, _ := NewBlockChain(db, conConf, ethash.NewFaker(), new(event.TypeMux), vm.Config{})
107107

108-
blocks := conBc.GetBlocksFromHash(conBc.CurrentBlock().Hash(), int(conBc.CurrentBlock().NumberU64()+1))
108+
blocks := conBc.GetBlocksFromHash(conBc.CurrentBlock().Hash(), int(conBc.CurrentBlock().NumberU64()))
109109
for j := 0; j < len(blocks)/2; j++ {
110110
blocks[j], blocks[len(blocks)-1-j] = blocks[len(blocks)-1-j], blocks[j]
111111
}
@@ -121,7 +121,7 @@ func TestDAOForkRangeExtradata(t *testing.T) {
121121
gspec.MustCommit(db)
122122
bc, _ = NewBlockChain(db, proConf, ethash.NewFaker(), new(event.TypeMux), vm.Config{})
123123

124-
blocks = proBc.GetBlocksFromHash(proBc.CurrentBlock().Hash(), int(proBc.CurrentBlock().NumberU64()+1))
124+
blocks = proBc.GetBlocksFromHash(proBc.CurrentBlock().Hash(), int(proBc.CurrentBlock().NumberU64()))
125125
for j := 0; j < len(blocks)/2; j++ {
126126
blocks[j], blocks[len(blocks)-1-j] = blocks[len(blocks)-1-j], blocks[j]
127127
}

0 commit comments

Comments
 (0)