From c7c7d3756bd6c73305e323544a521da7234c9c3d Mon Sep 17 00:00:00 2001 From: tserg <8017125+tserg@users.noreply.github.com> Date: Mon, 7 Aug 2023 17:38:58 +0800 Subject: [PATCH] add test --- tests/parser/features/decorators/test_view.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/parser/features/decorators/test_view.py b/tests/parser/features/decorators/test_view.py index 25a78db279..280be07e61 100644 --- a/tests/parser/features/decorators/test_view.py +++ b/tests/parser/features/decorators/test_view.py @@ -1,3 +1,5 @@ +import pytest + from vyper.exceptions import FunctionDeclarationException @@ -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)