Skip to content

Commit

Permalink
add view test
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg committed Mar 27, 2024
1 parent d0c5751 commit 5de3564
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/functional/codegen/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 All @@ -15,6 +17,20 @@ def foo() -> int128:
print("Passed constant function test")


@pytest.mark.requires_evm_version("cancun")
def test_transient_test(get_contract):
code = """
x: transient(uint256)
@external
@view
def foo() -> uint256:
return self.x
"""
c = get_contract(code)
assert c.foo() == 0


def test_invalid_constant_and_payable(
get_contract_with_gas_estimation_for_constants, assert_compile_failed
):
Expand Down

0 comments on commit 5de3564

Please sign in to comment.