Fix incorrect json output format for ConstantPragma and IncorrectSolc

pull/179/head
Josselin 6 years ago
parent d6594f2f87
commit 982a0a63ab
  1. 3
      slither/detectors/attributes/constant_pragma.py
  2. 3
      slither/detectors/attributes/incorrect_solc.py

@ -37,7 +37,8 @@ class ConstantPragma(AbstractDetector):
json = self.generate_json_result(info)
# follow the same format than add_nodes_to_json
json['expressions'] = [{'expression': p.version,
json['elements'] = [{'type': 'expression',
'expression': p.version,
'source_mapping': p.source_mapping} for p in pragma]
results.append(json)

@ -93,7 +93,8 @@ 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,
json['elements'] = [{'type': 'expression',
'expression': p.version,
'source_mapping': p.source_mapping} for (reason, p) in disallowed_pragmas]
results.append(json)

Loading…
Cancel
Save