erigon-pulse/tests/block_test.go

81 lines
2.9 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`)
bt.skipLoad(`^TransitionTests/bcFrontierToHomestead/blockChainFrontierWithLargerTDvsHomesteadBlockchain\.json`)
if ethconfig.EnableHistoryV3InTest {
// HistoryV3: doesn't produce receipts on execution by design
2022-10-18 04:08:14 +00:00
bt.skipLoad(`^InvalidBlocks/bcInvalidHeaderTest/log1_wrongBloom\.json`)
bt.skipLoad(`^InvalidBlocks/bcInvalidHeaderTest/wrongReceiptTrie\.json`)
bt.skipLoad(`^InvalidBlocks/bcInvalidHeaderTest/wrongGasUsed\.json`)
}
checkStateRoot := true
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, checkStateRoot)); err != nil {
t.Error(err)
}
})
}
func TestBlockchainEIP(t *testing.T) {
2023-08-25 07:58:13 +00:00
t.Skip("TODO(yperbasis): fix me")
defer log.Root().SetHandler(log.Root().GetHandler())
log.Root().SetHandler(log.LvlFilterHandler(log.LvlError, log.StderrHandler))
bt := new(testMatcher)
// EOF is not supported yet
bt.skipLoad(`^StateTests/stEOF/`)
2023-08-25 07:58:13 +00:00
checkStateRoot := true
bt.walk(t, blockEipTestDir, func(t *testing.T, name string, test *BlockTest) {
if err := bt.checkFailure(t, test.Run(t, checkStateRoot)); err != nil {
t.Error(err)
}
})
}