Minor fixes

pull/238/head
Josselin 5 years ago
parent 8879453a27
commit 3d43c3c148
  1. 8
      utils/slither_format/formatters/naming_convention.py

@ -126,7 +126,7 @@ def _patch(slither, result, element, _target):
elif _target == "parameter": elif _target == "parameter":
contract_name = element['type_specific_fields']['parent']['type_specific_fields']['parent']['name'] contract_name = element['type_specific_fields']['parent']['type_specific_fields']['parent']['name']
function_sig = element['type_specific_fields']['parent']['signature'] function_sig = element['type_specific_fields']['parent']['type_specific_fields']['signature']
param_name = element['name'] param_name = element['name']
contract = slither.get_contract_from_name(contract_name) contract = slither.get_contract_from_name(contract_name)
function = contract.get_function_from_signature(function_sig) function = contract.get_function_from_signature(function_sig)
@ -136,7 +136,7 @@ def _patch(slither, result, element, _target):
# Local variable # Local variable
if element['type_specific_fields']['parent'] == 'function': if element['type_specific_fields']['parent'] == 'function':
contract_name = element['type_specific_fields']['parent']['type_specific_fields']['parent']['name'] contract_name = element['type_specific_fields']['parent']['type_specific_fields']['parent']['name']
function_sig = element['type_specific_fields']['parent']['signature'] function_sig = element['type_specific_fields']['parent']['type_specific_fields']['signature']
var_name = element['name'] var_name = element['name']
contract = slither.get_contract_from_name(contract_name) contract = slither.get_contract_from_name(contract_name)
function = contract.get_function_from_signature(function_sig) function = contract.get_function_from_signature(function_sig)
@ -144,13 +144,13 @@ def _patch(slither, result, element, _target):
# State variable # State variable
else: else:
contract_name = element['type_specific_fields']['parent']['name'] contract_name = element['type_specific_fields']['parent']['name']
var_name = element['type_specific_fields']['name'] var_name = element['name']
contract = slither.get_contract_from_name(contract_name) contract = slither.get_contract_from_name(contract_name)
target = contract.get_state_variable_from_name(var_name) target = contract.get_state_variable_from_name(var_name)
elif _target == "enum": elif _target == "enum":
contract_name = element['type_specific_fields']['parent']['name'] contract_name = element['type_specific_fields']['parent']['name']
enum_name = element['type_specific_fields']['name'] enum_name = element['name']
contract = slither.get_contract_from_name(contract_name) contract = slither.get_contract_from_name(contract_name)
target = contract.get_enum_from_canonical_name(enum_name) target = contract.get_enum_from_canonical_name(enum_name)

Loading…
Cancel
Save