MCPcopy Create free account
hub / github.com/CPChain/chain / TestState

Function TestState

tests/state_test.go:29–60  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27)
28
29func TestState(t *testing.T) {
30 configs.SetRunMode(configs.Testcase)
31
32 t.Parallel()
33
34 st := new(testMatcher)
35 // Long tests:
36 st.skipShortMode(`^stQuadraticComplexityTest/`)
37 // Broken tests:
38 st.skipLoad(`^stTransactionTest/OverflowGasRequire\.json`) // gasLimit > 256 bits
39 st.skipLoad(`^stTransactionTest/zeroSigTransa[^/]*\.json`) // EIP-86 is not supported yet
40 // Expected failures:
41 st.fails(`^stRevertTest/RevertPrecompiledTouch\.json/EIP158`, "bug in test")
42 st.fails(`^stRevertTest/RevertPrecompiledTouch\.json/Byzantium`, "bug in test")
43
44 st.walk(t, stateTestDir, func(t *testing.T, name string, test *StateTest) {
45 for _, subtest := range test.Subtests() {
46 subtest := subtest
47 key := fmt.Sprintf("%s/%d", subtest.Fork, subtest.Index)
48 name := name + "/" + key
49 t.Run(key, func(t *testing.T) {
50 if subtest.Fork == "Constantinople" {
51 t.Skip("constantinople not supported yet")
52 }
53 withTrace(t, test.gasLimit(subtest), func(vmconfig vm.Config) error {
54 _, err := test.Run(subtest, vmconfig)
55 return st.checkFailure(t, name, err)
56 })
57 })
58 }
59 })
60}
61
62// Transactions with gasLimit above this value will not get a VM trace on failure.
63const traceErrorLimit = 400000

Callers

nothing calls this directly

Calls 9

withTraceFunction · 0.85
skipShortModeMethod · 0.80
skipLoadMethod · 0.80
failsMethod · 0.80
walkMethod · 0.80
SubtestsMethod · 0.80
gasLimitMethod · 0.80
checkFailureMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected