Skip to content

Commit a8e643c

Browse files
committed
fix: verify modified gas limit
1 parent 4f2b956 commit a8e643c

File tree

1 file changed

+6
-10
lines changed
  • packages/testing/src/execution_testing/specs

1 file changed

+6
-10
lines changed

packages/testing/src/execution_testing/specs/state.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ def verify_modified_gas_limit(
167167
f"Traces are not equivalent (gas_limit={current_gas_limit})"
168168
)
169169
return False
170+
modified_tool_alloc = modified_tool_output.alloc.get_alloc()
170171
try:
171-
self.post.verify_post_alloc(modified_tool_output.alloc.get_alloc())
172+
self.post.verify_post_alloc(modified_tool_alloc)
172173
except Exception as e:
173174
logger.debug(
174175
f"Post alloc is not equivalent (gas_limit={current_gas_limit})"
@@ -187,29 +188,24 @@ def verify_modified_gas_limit(
187188
)
188189
logger.debug(e)
189190
return False
190-
if len(base_tool_alloc.root) != len(
191-
modified_tool_output.alloc.get_alloc().root
192-
):
191+
if len(base_tool_alloc.root) != len(modified_tool_alloc.root):
193192
logger.debug(
194193
f"Post alloc is not equivalent (gas_limit={current_gas_limit})"
195194
)
196195
return False
197-
if (
198-
modified_tool_output.alloc.get_alloc().root.keys()
199-
!= modified_tool_output.alloc.get_alloc().root.keys()
200-
):
196+
if base_tool_alloc.root.keys() != modified_tool_alloc.root.keys():
201197
logger.debug(
202198
f"Post alloc is not equivalent (gas_limit={current_gas_limit})"
203199
)
204200
return False
205201
for k in base_tool_alloc.root.keys():
206-
if k not in modified_tool_output.alloc.get_alloc():
202+
if k not in modified_tool_alloc:
207203
logger.debug(
208204
f"Post alloc is not equivalent (gas_limit={current_gas_limit})"
209205
)
210206
return False
211207
base_account = base_tool_alloc[k]
212-
modified_account = modified_tool_output.alloc.get_alloc()[k]
208+
modified_account = modified_tool_alloc[k]
213209
if (modified_account is None) != (base_account is None):
214210
logger.debug(
215211
f"Post alloc is not equivalent (gas_limit={current_gas_limit})"

0 commit comments

Comments
 (0)