Skip to content

Commit c1e9fc9

Browse files
committed
removed unnecessary offset update
1 parent e9a5740 commit c1e9fc9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/prague/eip7002_el_triggerable_withdrawals/test_modified_withdrawal_contract.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ def test_extra_withdrawals_pseudo_contract(
202202
"""Test how clients were to behave when more than 16 withdrawals would be allowed per block."""
203203
modified_code: Bytecode = Bytecode()
204204
memory_offset: int = 0
205+
amount_of_requests: int = 0
205206

206207
# Goal: Have contract return a bunch of withdrawal requests
207208
# Problem: EVM has no concept of withdrawal request, it just return bytes from memory
@@ -227,9 +228,13 @@ def test_extra_withdrawals_pseudo_contract(
227228
memory_offset += 32
228229

229230
modified_code += Op.MSTORE(memory_offset, withdrawal_request_chunk_3_3_12bytes)
230-
memory_offset += 12
231+
# memory_offset += 32 # MSTORE ALWAYS writes 32 bytes, no need to update memory offset tho
231232

232-
modified_code += Op.RETURN(0, 76)
233+
amount_of_requests += 1
234+
235+
modified_code += Op.RETURN(
236+
0, 76 * amount_of_requests
237+
) # don't care about the zeroes added by MSTORE at [76,96] bytes
233238

234239
pre[Spec_EIP7002.WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS] = Account(
235240
code=modified_code,

0 commit comments

Comments
 (0)