From 982a0a63ab06efac7541ef23be799b2cca7dc025 Mon Sep 17 00:00:00 2001 From: Josselin Date: Wed, 13 Feb 2019 01:12:29 +0000 Subject: [PATCH] Fix incorrect json output format for ConstantPragma and IncorrectSolc --- slither/detectors/attributes/constant_pragma.py | 5 +++-- slither/detectors/attributes/incorrect_solc.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/slither/detectors/attributes/constant_pragma.py b/slither/detectors/attributes/constant_pragma.py index eaa62e83d..eef49ec4e 100644 --- a/slither/detectors/attributes/constant_pragma.py +++ b/slither/detectors/attributes/constant_pragma.py @@ -37,8 +37,9 @@ class ConstantPragma(AbstractDetector): json = self.generate_json_result(info) # follow the same format than add_nodes_to_json - json['expressions'] = [{'expression': p.version, - 'source_mapping': p.source_mapping} for p in pragma] + json['elements'] = [{'type': 'expression', + 'expression': p.version, + 'source_mapping': p.source_mapping} for p in pragma] results.append(json) return results diff --git a/slither/detectors/attributes/incorrect_solc.py b/slither/detectors/attributes/incorrect_solc.py index f10929958..64a581ce8 100644 --- a/slither/detectors/attributes/incorrect_solc.py +++ b/slither/detectors/attributes/incorrect_solc.py @@ -93,8 +93,9 @@ We recommend avoiding complex pragma statement.''' json = self.generate_json_result(info) # follow the same format than add_nodes_to_json - json['expressions'] = [{'expression': p.version, - 'source_mapping': p.source_mapping} for (reason, p) in disallowed_pragmas] + json['elements'] = [{'type': 'expression', + 'expression': p.version, + 'source_mapping': p.source_mapping} for (reason, p) in disallowed_pragmas] results.append(json) return results