Skip to content

Commit ba1ba1b

Browse files
committed
feat: add test that showcases the issue that found_index can still be True from an earlier call
1 parent 2d2ec31 commit ba1ba1b

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

packages/testing/src/execution_testing/test_types/tests/test_block_access_list_modifiers.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,34 @@ def test_modify_storage_missing_slot_raises(
262262
modify_storage(CONTRACT, 1, 99, 0xFF)(sample_bal)
263263

264264

265+
def test_modify_nonce_reused_callable_missing_index_still_raises() -> None:
266+
"""Raise even when the same modifier callable is reused across BALs."""
267+
modifier = modify_nonce(ALICE, 1, 42)
268+
valid_bal = BlockAccessList(
269+
[
270+
BalAccountChange(
271+
address=ALICE,
272+
nonce_changes=[
273+
BalNonceChange(block_access_index=1, post_nonce=1),
274+
],
275+
)
276+
]
277+
)
278+
missing_index_bal = BlockAccessList(
279+
[
280+
BalAccountChange(
281+
address=ALICE,
282+
nonce_changes=[],
283+
)
284+
]
285+
)
286+
287+
modifier(valid_bal)
288+
289+
with pytest.raises(ValueError, match="not found"):
290+
modifier(missing_index_bal)
291+
292+
265293
def test_reorder_accounts_duplicate_index_raises(
266294
sample_bal: BlockAccessList,
267295
) -> None:

0 commit comments

Comments
 (0)