erigon-pulse/tests/block_test.go

58 lines
2.3 KiB
Go
Raw Normal View History

2015-07-07 00:54:22 +00:00
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
2015-07-07 00:54:22 +00:00
//
// The go-ethereum library is free software: you can redistribute it and/or modify
2015-07-07 00:54:22 +00:00
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
2015-07-07 00:54:22 +00:00
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2015-07-07 00:54:22 +00:00
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
2015-07-07 00:54:22 +00:00
//go:build integration
package tests
import (
2021-05-20 16:46:12 +00:00
"runtime"
"testing"
"github.com/ledgerwatch/erigon/eth/ethconfig"
"github.com/ledgerwatch/log/v3"
)
func TestBlockchain(t *testing.T) {
defer log.Root().SetHandler(log.Root().GetHandler())
log.Root().SetHandler(log.LvlFilterHandler(log.LvlError, log.StderrHandler))
2021-05-20 16:46:12 +00:00
if runtime.GOOS == "windows" {
t.Skip("fix me on win please") // after remove ChainReader from consensus engine - this test can be changed to create less databases, then can enable on win. now timeout after 20min
}
bt := new(testMatcher)
// General state tests are 'exported' as blockchain tests, but we can run them natively.
// For speedier CI-runs those are skipped.
bt.skipLoad(`^GeneralStateTests/`)
// Currently it fails because SpawnStageHeaders doesn't accept any PoW blocks after PoS transition
// TODO(yperbasis): make it work
bt.skipLoad(`^TransitionTests/bcArrowGlacierToMerge/powToPosBlockRejection\.json`)
if ethconfig.EnableHistoryV3InTest {
// HistoryV3: doesn't produce receipts on execution by design
bt.skipLoad(`^TestBlockchain/InvalidBlocks/bcInvalidHeaderTest/log1_wrongBloom\.json`)
bt.skipLoad(`^TestBlockchain/InvalidBlocks/bcInvalidHeaderTest/wrongReceiptTrie\.json`)
2022-10-06 02:18:17 +00:00
bt.skipLoad(`^TestBlockchain/InvalidBlocks/bcInvalidHeaderTest/wrongGasUsed\.json`)
}
bt.walk(t, blockTestDir, func(t *testing.T, name string, test *BlockTest) {
2021-04-21 13:03:08 +00:00
// import pre accounts & construct test genesis block & state root
if err := bt.checkFailure(t, test.Run(t, false)); err != nil {
t.Error(err)
}
})
}