From e819161507b99d3f3cee7e1956b86e5fbdabc001 Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Tue, 19 Mar 2024 09:00:32 -0400 Subject: [PATCH] update another storage slot test for cancun --- tests/unit/semantics/test_storage_slots.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/unit/semantics/test_storage_slots.py b/tests/unit/semantics/test_storage_slots.py index 7cbe71cf29..be0b0c3159 100644 --- a/tests/unit/semantics/test_storage_slots.py +++ b/tests/unit/semantics/test_storage_slots.py @@ -1,5 +1,6 @@ import pytest +from vyper.evm.opcodes import version_check from vyper.exceptions import StorageLayoutException code = """ @@ -97,10 +98,17 @@ def test_reentrancy_lock(get_contract): def test_allocator_overflow(get_contract): - code = """ -# --> global nonreentrancy slot allocated here <-- + # cancun allocates reeentrancy slot in transient storage, + # so allocate an actual storage variable + if version_check(begin="cancun"): + slot1 = "x: uint256" + else: + slot1 = "# --> global nonreentrancy slot allocated here <--" + code = f""" +{slot1} y: uint256[max_value(uint256)] """ + with pytest.raises( StorageLayoutException, match=f"Invalid storage slot, tried to allocate slots 1 through {2**256}",