@@ -62,44 +62,6 @@ def _get_opcode_gas_map_sources(fork_class):
6262 return "\n " .join (sources )
6363
6464
65- def _build_source_opcode_field_map (fork_class ):
66- """Build opcode→GasCosts fields map by parsing opcode_gas_map source."""
67- source = _get_opcode_gas_map_sources (fork_class )
68- valid_fields = {f .name for f in fields (GasCosts )}
69- opcode_fields = defaultdict (set )
70-
71- pattern = re .compile (
72- r"Opcodes\.(\w+)\s*:\s*(.*?)(?=Opcodes\.\w+\s*:|$)" ,
73- re .DOTALL ,
74- )
75- for match in pattern .finditer (source ):
76- opcode_name = match .group (1 )
77- value_expr = match .group (2 )
78- for field_name in valid_fields :
79- if field_name in value_expr :
80- opcode_fields [opcode_name ].add (field_name )
81-
82- helper_pattern = re .compile (
83- r"def\s+(_with_\w+|_calculate_\w+)\s*\(.*?\)\s*:"
84- r"(.*?)(?=\n (?:def |@|$))" ,
85- re .DOTALL ,
86- )
87- helper_fields = defaultdict (set )
88- for match in helper_pattern .finditer (source ):
89- helper_name = match .group (1 )
90- body = match .group (2 )
91- for field_name in valid_fields :
92- if field_name in body :
93- helper_fields [helper_name ].add (field_name )
94-
95- for opcode_name , expr_fields in opcode_fields .items ():
96- for helper_name , hf in helper_fields .items ():
97- if helper_name in source :
98- pass
99-
100- return {k : sorted (v ) for k , v in opcode_fields .items ()}
101-
102-
10365def _get_helper_method_fields (fork_class ):
10466 """Extract GasCosts fields from helper methods on the fork class."""
10567 valid_fields = {f .name for f in fields (GasCosts )}
0 commit comments