Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg committed Dec 31, 2024
1 parent 50bcf5c commit 31f6fff
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
13 changes: 13 additions & 0 deletions tests/functional/builtins/codegen/test_raw_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,19 @@ def foo(_addr: address):
(
"""
@external
def foo(a: address):
for i: uint256 in range(
0,
extract32(raw_call(a, b"", max_outsize=32), 0, output_type=uint256),
bound = 12
):
pass
""",
StateAccessViolation,
),
(
"""
@external
def foo(_addr: address):
raw_call(_addr, method_id("foo()"), is_delegate_call=True, is_static_call=True)
""",
Expand Down
14 changes: 9 additions & 5 deletions tests/functional/syntax/test_for_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,18 +345,22 @@ def bar(t: address):
),
(
"""
interface I:
def bar() -> uint256: payable
a: DynArray[uint256, 3]
@internal
def foo() -> uint256:
return self.a.pop()
@external
def bar(t: address):
for i: uint256 in range(1, extcall I(t).bar(), bound=10):
def bar():
for i: uint256 in range(2, self.foo(), bound=5):
pass
""",
StateAccessViolation,
"May not call state modifying function within a range expression or for loop iterator.",
None,
"extcall I(t).bar()",
"self.foo()",
),
(
"""
Expand Down

0 comments on commit 31f6fff

Please sign in to comment.