|
|
|
@ -13,7 +13,8 @@ from slither.core.solidity_types.elementary_type import ElementaryType |
|
|
|
|
def test_functions(): |
|
|
|
|
# pylint: disable=too-many-statements |
|
|
|
|
slither = Slither("tests/test_function.sol") |
|
|
|
|
functions = slither.contracts_as_dict["TestFunction"].available_functions_as_dict() |
|
|
|
|
compilation_unit = slither.compilation_units[0] |
|
|
|
|
functions = compilation_unit.contracts_as_dict["TestFunction"].available_functions_as_dict() |
|
|
|
|
|
|
|
|
|
f = functions["external_payable(uint256)"] |
|
|
|
|
assert f.name == "external_payable" |
|
|
|
@ -243,7 +244,8 @@ def test_functions(): |
|
|
|
|
|
|
|
|
|
def test_function_can_send_eth(): |
|
|
|
|
slither = Slither("tests/test_function.sol") |
|
|
|
|
functions = slither.contracts_as_dict["TestFunctionCanSendEth"].available_functions_as_dict() |
|
|
|
|
compilation_unit = slither.compilation_units[0] |
|
|
|
|
functions = compilation_unit.contracts_as_dict["TestFunctionCanSendEth"].available_functions_as_dict() |
|
|
|
|
|
|
|
|
|
assert functions["send_direct()"].can_send_eth() is True |
|
|
|
|
assert functions["transfer_direct()"].can_send_eth() is True |
|
|
|
|