Skip to content

Commit

Permalink
add example
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg committed Feb 28, 2022
1 parent bf34494 commit 9f0f32d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/parser/syntax/constants/test_constantGetter1_Success.vy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
VAL: constant(uint256) = 123

@external
def foo() -> uint256:
return VAL
7 changes: 7 additions & 0 deletions tests/parser/syntax/test_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,10 @@ def deposit(deposit_input: Bytes[2048]):
@pytest.mark.parametrize("good_code", valid_list)
def test_constant_success(good_code):
assert compiler.compile_code(good_code) is not None


@pytest.mark.parametrize(
"vyper_contract", ["constants/test_constantGetter1_Success.vy"], indirect=True
)
def test_constant_success_2(vyper_contract):
assert vyper_contract.foo() == 123

0 comments on commit 9f0f32d

Please sign in to comment.