From 91bfae97b89834fb17699e9dfbfa030d54a5b518 Mon Sep 17 00:00:00 2001 From: Josselin Date: Tue, 10 Nov 2020 12:34:13 +0100 Subject: [PATCH] Run black --- slither/slithir/convert.py | 2 +- slither/visitors/slithir/expression_to_slithir.py | 12 ++---------- tests/test_ast_parsing.py | 1 + 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/slither/slithir/convert.py b/slither/slithir/convert.py index 1e1b8f746..4f2bfea7b 100644 --- a/slither/slithir/convert.py +++ b/slither/slithir/convert.py @@ -1417,7 +1417,7 @@ def remove_unused(result): # Remove type(X) if X is an elementary type # This assume that type(X) is only used with min/max # If Solidity introduces other operation, we might remove this removal - if isinstance(ins, SolidityCall) and ins.function == SolidityFunction('type()'): + if isinstance(ins, SolidityCall) and ins.function == SolidityFunction("type()"): if isinstance(ins.arguments[0], ElementaryType): to_remove.append(ins) diff --git a/slither/visitors/slithir/expression_to_slithir.py b/slither/visitors/slithir/expression_to_slithir.py index d3ccf4858..1fc024fb8 100644 --- a/slither/visitors/slithir/expression_to_slithir.py +++ b/slither/visitors/slithir/expression_to_slithir.py @@ -370,17 +370,9 @@ class ExpressionToSlithIR(ExpressionVisitor): assert isinstance(type_expression_found, ElementaryTypeNameExpression) type_found = type_expression_found.type if expression.member_name == "min:": - op = Assignment( - val, - Constant(str(type_found.min), type_found), - type_found, - ) + op = Assignment(val, Constant(str(type_found.min), type_found), type_found,) else: - op = Assignment( - val, - Constant(str(type_found.max), type_found), - type_found, - ) + op = Assignment(val, Constant(str(type_found.max), type_found), type_found,) self._result.append(op) set_val(expression, val) return diff --git a/tests/test_ast_parsing.py b/tests/test_ast_parsing.py index a60756adb..9f70d830b 100644 --- a/tests/test_ast_parsing.py +++ b/tests/test_ast_parsing.py @@ -502,6 +502,7 @@ def generate_output(sl: Slither) -> Dict[str, Dict[str, str]]: ALL_TESTS = get_all_test() + def set_solc(test_item: Item): # hacky hack hack to pick the solc version we want env = dict(os.environ)