Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg committed Aug 7, 2023
1 parent acec274 commit c7c7d37
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/parser/features/decorators/test_view.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pytest

from vyper.exceptions import FunctionDeclarationException


Expand Down Expand Up @@ -28,3 +30,25 @@ def foo() -> num:
assert_compile_failed(
lambda: get_contract_with_gas_estimation_for_constants(code), FunctionDeclarationException
)


good_code = [
"""
@external
@view
def foo(x: address):
assert convert(
raw_call(
x,
b'',
max_outsize=32,
is_static_call=True,
), uint256
) > 123, "vyper"
"""
]


@pytest.mark.parametrize("code", good_code)
def test_view_call_compiles(get_contract, code):
get_contract(code)

0 comments on commit c7c7d37

Please sign in to comment.