Skip to content

Commit

Permalink
test: Added operational test
Browse files Browse the repository at this point in the history
  • Loading branch information
fubuloubu committed Dec 12, 2019
1 parent 6c91010 commit dd1aac4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/parser/syntax/test_chainid.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,14 @@ def check_chain_id(c: uint256) -> bool:
@pytest.mark.parametrize('good_code', valid_list)
def test_chain_success(good_code):
assert compiler.compile_code(good_code) is not None


def test_chainid_operation(get_contract_with_gas_estimation):
code = """
@public
@constant
def get_chain_id() -> uint256:
return chain.id
"""
c = get_contract_with_gas_estimation(code)
assert c.get_chain_id() == 0 # Default value of py-evm

0 comments on commit dd1aac4

Please sign in to comment.