Skip to content

Commit

Permalink
update another storage slot test for cancun
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Mar 19, 2024
1 parent 8c8d4e8 commit e819161
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/unit/semantics/test_storage_slots.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest

from vyper.evm.opcodes import version_check
from vyper.exceptions import StorageLayoutException

code = """
Expand Down Expand Up @@ -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}",
Expand Down

0 comments on commit e819161

Please sign in to comment.