fix merge/fmt

pull/1951/head
alpharush 1 year ago
parent 45517d73b4
commit 96b103225f
  1. 8
      slither/solc_parsing/declarations/function.py
  2. 9
      tests/unit/core/test_arithmetic.py

@ -726,7 +726,9 @@ class FunctionSolc(CallerContextExpression):
self._parse_catch(clause, node, catch_scope, False)
return node
def _parse_catch(self, statement: Dict, node: NodeSolc, scope: Scope, add_param: bool) -> NodeSolc:
def _parse_catch(
self, statement: Dict, node: NodeSolc, scope: Scope, add_param: bool
) -> NodeSolc:
block = statement.get("block", None)
if block is None:
@ -874,7 +876,7 @@ class FunctionSolc(CallerContextExpression):
self.get_children("children"): [variable, init],
}
new_node = self._parse_variable_definition(new_statement, new_node)
new_node = self._parse_variable_definition(new_statement, new_node, scope)
else:
# If we have
# var (a, b) = f()
@ -893,7 +895,7 @@ class FunctionSolc(CallerContextExpression):
variables.append(variable)
new_node = self._parse_variable_definition_init_tuple(
new_statement, i, new_node
new_statement, i, new_node, scope
)
i = i + 1
var_identifiers = []

@ -8,15 +8,6 @@ from slither.slithir.variables.temporary import TemporaryVariable
TEST_DATA_DIR = Path(__file__).resolve().parent / "test_data" / "arithmetic_usage"
def test_arithmetic_usage(solc_binary_path) -> None:
solc_path = solc_binary_path("0.8.15")
slither = Slither(Path(TEST_DATA_DIR, "test.sol").as_posix(), solc=solc_path)
assert {
f.source_mapping.content_hash for f in unchecked_arithemtic_usage(slither.contracts[0])
} == {"2b4bc73cf59d486dd9043e840b5028b679354dd9", "e4ecd4d0fda7e762d29aceb8425f2c5d4d0bf962"}
def test_arithmetic_usage(solc_binary_path) -> None:
solc_path = solc_binary_path("0.8.15")
slither = Slither(Path(TEST_DATA_DIR, "test.sol").as_posix(), solc=solc_path)

Loading…
Cancel
Save