Skip to content

Commit

Permalink
Refactor eest blockchain test flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Mdaiki0730 committed Jan 28, 2025
1 parent 688ac24 commit b735ac5
Show file tree
Hide file tree
Showing 6 changed files with 185 additions and 328 deletions.
2 changes: 2 additions & 0 deletions blockchain/chain_makers.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ func (b *BlockGen) AddTxWithChain(bc *BlockChain, tx *types.Transaction) {
b.receipts = append(b.receipts, receipt)
}

// AddTxWithChainEvenHasError is an AddTx that inherits the vmConfig of the received chain
// and does not panic even if an error occurs.
func (b *BlockGen) AddTxWithChainEvenHasError(bc *BlockChain, tx *types.Transaction) error {
b.statedb.SetTxContext(tx.Hash(), common.Hash{}, len(b.txs))
var vmConfig vm.Config
Expand Down
24 changes: 0 additions & 24 deletions tests/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,6 @@ import (
"github.com/stretchr/testify/suite"
)

func TestBlockchain(t *testing.T) {
t.Parallel()

bt := new(testMatcher)
// General state tests are 'exported' as blockchain tests, but we can run them natively.
bt.skipLoad(`^GeneralStateTests/`)
// Skip random failures due to selfish mining test.
// bt.skipLoad(`^bcForgedTest/bcForkUncle\.json`)
bt.skipLoad(`^bcMultiChainTest/(ChainAtoChainB_blockorder|CallContractFromNotBestBlock)`)
bt.skipLoad(`^bcTotalDifficultyTest/(lotsOfLeafs|lotsOfBranches|sideChainWithMoreTransactions)`)
// This test is broken
bt.fails(`blockhashNonConstArg_Constantinople`, "Broken test")

// Still failing tests
// bt.skipLoad(`^bcWalletTest.*_Byzantium$`)

// TODO-Kaia Update BlockchainTests first to enable this test, since block header has been changed in Kaia.
//bt.walk(t, blockTestDir, func(t *testing.T, name string, test *BlockTest) {
// if err := bt.checkFailure(t, name, test.Run()); err != nil {
// t.Error(err)
// }
//})
}

// TestExecutionSpecState runs the state_test fixtures from execution-spec-tests.
type ExecutionSpecBlockTestSuite struct {
suite.Suite
Expand Down
Loading

0 comments on commit b735ac5

Please sign in to comment.