MCPcopy
hub / github.com/ethereum/research / apply_test

Function apply_test

spec_pythonizer/apply_test_suite.py:18–31  ·  view source on GitHub ↗
(config, initial_state, blocks, expected_state, expected_state_root)

Source from the content-addressed store, hash-verified

16print("Test suite: {0[test_suite]}, fork: {0[fork]}, version: {0[version]}".format(j))
17
18def apply_test(config, initial_state, blocks, expected_state, expected_state_root):
19 print("Applying config")
20 print(json.dumps(config, indent=4))
21 for key, value in config.items():
22 setattr(spec, key, value)
23 state = deepcopy(initial_state)
24 for block in blocks:
25 spec.state_transition(state, block)
26
27 assert state == expected_state
28 if expected_state_root:
29 assert spec.hash_tree_root(state) == expected_state_root
30
31 print("Test passed\n")
32
33for i, test_case in enumerate(j["test_cases"]):
34 config = test_case["config"]

Callers 1

Calls 2

deepcopyFunction · 0.85
hash_tree_rootMethod · 0.45

Tested by

no test coverage detected