Skip to content

Commit dbb03fe

Browse files
holimanfjl
authored andcommitted
tests: update from ethereum/tests (#19945)
1 parent 2c50b2c commit dbb03fe

4 files changed

Lines changed: 34 additions & 23 deletions

File tree

‎tests/block_test.go‎

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,25 @@ func TestBlockchain(t *testing.T) {
2525

2626
bt := new(testMatcher)
2727
// General state tests are 'exported' as blockchain tests, but we can run them natively.
28-
bt.skipLoad(`^GeneralStateTests/`)
28+
bt.skipLoad(`^ValidBlocks/bcStateTests/`)
2929
// Skip random failures due to selfish mining test.
30-
bt.skipLoad(`^bcForgedTest/bcForkUncle\.json`)
31-
bt.skipLoad(`^bcMultiChainTest/(ChainAtoChainB_blockorder|CallContractFromNotBestBlock)`)
32-
bt.skipLoad(`^bcTotalDifficultyTest/(lotsOfLeafs|lotsOfBranches|sideChainWithMoreTransactions)`)
33-
// Slow tests
34-
bt.slow(`^bcExploitTest/DelegateCallSpam.json`)
35-
bt.slow(`^bcExploitTest/ShanghaiLove.json`)
36-
bt.slow(`^bcExploitTest/SuicideIssue.json`)
37-
bt.slow(`^bcForkStressTest/`)
38-
bt.slow(`^bcGasPricerTest/RPC_API_Test.json`)
39-
bt.slow(`^bcWalletTest/`)
30+
bt.skipLoad(`.*bcForgedTest/bcForkUncle\.json`)
31+
bt.skipLoad(`.*bcMultiChainTest/(ChainAtoChainB_blockorder|CallContractFromNotBestBlock)`)
32+
bt.skipLoad(`.*bcTotalDifficultyTest/(lotsOfLeafs|lotsOfBranches|sideChainWithMoreTransactions)`)
33+
34+
// These are not formatted like the rest -- due to the large postState, the postState
35+
// was replaced by a hash, instead of a genesisAlloc map
36+
// See https://github.com/ethereum/tests/pull/616
37+
bt.skipLoad(`.*bcExploitTest/ShanghaiLove.json`)
38+
bt.skipLoad(`.*bcExploitTest/SuicideIssue.json`)
4039

41-
// Still failing tests that we need to look into
42-
//bt.fails(`^bcStateTests/suicideThenCheckBalance.json/suicideThenCheckBalance_Constantinople`, "TODO: investigate")
43-
//bt.fails(`^bcStateTests/suicideStorageCheckVCreate2.json/suicideStorageCheckVCreate2_Constantinople`, "TODO: investigate")
44-
//bt.fails(`^bcStateTests/suicideStorageCheckVCreate.json/suicideStorageCheckVCreate_Constantinople`, "TODO: investigate")
45-
//bt.fails(`^bcStateTests/suicideStorageCheck.json/suicideStorageCheck_Constantinople`, "TODO: investigate")
40+
// Slow tests
41+
bt.slow(`.*bcExploitTest/DelegateCallSpam.json`)
42+
bt.slow(`.*bcExploitTest/ShanghaiLove.json`)
43+
bt.slow(`.*bcExploitTest/SuicideIssue.json`)
44+
bt.slow(`.*/bcForkStressTest/`)
45+
bt.slow(`.*/bcGasPricerTest/RPC_API_Test.json`)
46+
bt.slow(`.*/bcWalletTest/`)
4647

4748
bt.walk(t, blockTestDir, func(t *testing.T, name string, test *BlockTest) {
4849
if err := bt.checkFailure(t, name, test.Run()); err != nil {

‎tests/init.go‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,16 @@ var Forks = map[string]*params.ChainConfig{
107107
ByzantiumBlock: big.NewInt(0),
108108
ConstantinopleBlock: big.NewInt(5),
109109
},
110+
"ByzantiumToConstantinopleFixAt5": {
111+
ChainID: big.NewInt(1),
112+
HomesteadBlock: big.NewInt(0),
113+
EIP150Block: big.NewInt(0),
114+
EIP155Block: big.NewInt(0),
115+
EIP158Block: big.NewInt(0),
116+
ByzantiumBlock: big.NewInt(0),
117+
ConstantinopleBlock: big.NewInt(5),
118+
PetersburgBlock: big.NewInt(5),
119+
},
110120
}
111121

112122
// UnsupportedForkError is returned when a test requests a fork that isn't implemented.

‎tests/state_test.go‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ func TestState(t *testing.T) {
4646
st.skipLoad(`^stTransactionTest/OverflowGasRequire\.json`) // gasLimit > 256 bits
4747
st.skipLoad(`^stTransactionTest/zeroSigTransa[^/]*\.json`) // EIP-86 is not supported yet
4848
// Expected failures:
49-
st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Byzantium/0`, "bug in test")
50-
st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Byzantium/3`, "bug in test")
51-
st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Constantinople/0`, "bug in test")
52-
st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Constantinople/3`, "bug in test")
53-
st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/ConstantinopleFix/0`, "bug in test")
54-
st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/ConstantinopleFix/3`, "bug in test")
49+
//st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Byzantium/0`, "bug in test")
50+
//st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Byzantium/3`, "bug in test")
51+
//st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Constantinople/0`, "bug in test")
52+
//st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Constantinople/3`, "bug in test")
53+
//st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/ConstantinopleFix/0`, "bug in test")
54+
//st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/ConstantinopleFix/3`, "bug in test")
5555

5656
st.walk(t, stateTestDir, func(t *testing.T, name string, test *StateTest) {
5757
for _, subtest := range test.Subtests() {

‎tests/testdata‎

Submodule testdata updated 32574 files

0 commit comments

Comments
 (0)