mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-20 03:36:44 +00:00
fixed bypass unittest
This commit is contained in:
parent
6adee64867
commit
10694b2c6f
1 changed files with 7 additions and 17 deletions
|
|
@ -519,15 +519,6 @@ func testInsertNonceError(t *testing.T, full bool) {
|
|||
failRes int
|
||||
failNum uint64
|
||||
)
|
||||
if full {
|
||||
blocks := makeBlockChain(blockchain.CurrentBlock(), i, ethash.NewFaker(), db, 0)
|
||||
|
||||
failAt = rand.Int() % len(blocks)
|
||||
failNum = blocks[failAt].NumberU64()
|
||||
|
||||
blockchain.engine = ethash.NewFakeFailer(failNum)
|
||||
failRes, err = blockchain.InsertChain(blocks)
|
||||
} else {
|
||||
headers := makeHeaderChain(blockchain.CurrentHeader(), i, ethash.NewFaker(), db, 0)
|
||||
|
||||
failAt = rand.Int() % len(headers)
|
||||
|
|
@ -536,7 +527,6 @@ func testInsertNonceError(t *testing.T, full bool) {
|
|||
blockchain.engine = ethash.NewFakeFailer(failNum)
|
||||
blockchain.hc.engine = blockchain.engine
|
||||
failRes, err = blockchain.InsertHeaderChain(headers, 1)
|
||||
}
|
||||
// Check that the returned error indicates the failure.
|
||||
if failRes != failAt {
|
||||
t.Errorf("test %d: failure index mismatch: have %d, want %d", i, failRes, failAt)
|
||||
|
|
|
|||
Loading…
Reference in a new issue