From dd1aac4292fc71e0da7d92a10f402f5e39fe4dcf Mon Sep 17 00:00:00 2001 From: Bryant Eisenbach Date: Thu, 12 Dec 2019 18:14:11 -0500 Subject: [PATCH] test: Added operational test --- tests/parser/syntax/test_chainid.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/parser/syntax/test_chainid.py b/tests/parser/syntax/test_chainid.py index 515f2d07e8..a7b71e21d3 100644 --- a/tests/parser/syntax/test_chainid.py +++ b/tests/parser/syntax/test_chainid.py @@ -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