From aba525f40287d774750c4c5b636a97c1898210ea Mon Sep 17 00:00:00 2001 From: Josselin Date: Tue, 14 Apr 2020 15:30:34 +0200 Subject: [PATCH] Echidna printer: use get_name everywhere --- slither/printers/guidance/echidna.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/slither/printers/guidance/echidna.py b/slither/printers/guidance/echidna.py index 7d63f84f3..037a2c9f3 100644 --- a/slither/printers/guidance/echidna.py +++ b/slither/printers/guidance/echidna.py @@ -184,10 +184,10 @@ def _extract_constants(slither: Slither) -> Tuple[Dict[str, Dict[str, List]], Di # Note: use list(set()) instead of set # As this is meant to be serialized in JSON, and JSON does not support set if all_cst_used: - ret_cst_used[contract.name][function.full_name] = list(set(all_cst_used)) + ret_cst_used[contract.name][_get_name(function)] = list(set(all_cst_used)) if all_cst_used_in_binary: - ret_cst_used_in_binary[contract.name][function.full_name] = {k: list(set(v)) for k, v in - all_cst_used_in_binary.items()} + ret_cst_used_in_binary[contract.name][_get_name(function)] = {k: list(set(v)) for k, v in + all_cst_used_in_binary.items()} return ret_cst_used, ret_cst_used_in_binary @@ -196,19 +196,19 @@ def _extract_function_relations(slither: Slither) -> Dict[str, Dict[str, Dict[st ret: Dict[str, Dict[str, Dict[str, List[str]]]] = defaultdict(dict) for contract in slither.contracts: ret[contract.name] = defaultdict(dict) - written = {function.full_name: function.all_state_variables_written() + written = {_get_name(function): function.all_state_variables_written() for function in contract.functions_entry_points} - read = {function.full_name: function.all_state_variables_read() + read = {_get_name(function): function.all_state_variables_read() for function in contract.functions_entry_points} for function in contract.functions_entry_points: - ret[contract.name][function.full_name] = {"impacts": [], + ret[contract.name][_get_name(function)] = {"impacts": [], "is_impacted_by": []} for candidate, varsWritten in written.items(): if any((r in varsWritten for r in function.all_state_variables_read())): - ret[contract.name][function.full_name]["is_impacted_by"].append(candidate) + ret[contract.name][_get_name(function)]["is_impacted_by"].append(candidate) for candidate, varsRead in read.items(): if any((r in varsRead for r in function.all_state_variables_written())): - ret[contract.name][function.full_name]["impacts"].append(candidate) + ret[contract.name][_get_name(function)]["impacts"].append(candidate) return ret