pylint: Enable and fix redefined-builtin warnings

This commit is contained in:
Kamil Śliwak
2021-12-21 15:30:11 +01:00
parent 5b10ff1216
commit dece5f4de2
7 changed files with 54 additions and 55 deletions
@@ -33,12 +33,12 @@ def parse_call(call):
return function.strip(), arguments.strip(), results.strip()
def colorize(left, right, id):
def colorize(left, right, index):
red = "\x1b[31m"
yellow = "\x1b[33m"
reset = "\x1b[0m"
colors = [red, yellow]
color = colors[id % len(colors)]
color = colors[index % len(colors)]
function, _arguments, _results = parse_call(right)
left = left.replace("compileAndRun", color + "compileAndRun" + reset)
right = right.replace("constructor", color + "constructor" + reset)
+18 -18
View File
@@ -32,11 +32,11 @@ class Trace:
def get_input(self):
return self._input
def set_input(self, input):
def set_input(self, bytecode):
if self.kind == "create":
# remove cbor encoded metadata from bytecode
length = int(input[-4:], 16) * 2
self._input = input[:len(input) - length - 4]
length = int(bytecode[-4:], 16) * 2
self._input = bytecode[:len(bytecode) - length - 4]
def get_output(self):
return self._output
@@ -110,21 +110,21 @@ class TraceAnalyser:
@staticmethod
def parse_parameters(line, trace):
input = re.search(r'\s*in:\s*([a-fA-F0-9]*)', line, re.M | re.I)
if input:
trace.input = input.group(1)
output = re.search(r'\s*out:\s*([a-fA-F0-9]*)', line, re.M | re.I)
if output:
trace.output = output.group(1)
result = re.search(r'\s*result:\s*([a-fA-F0-9]*)', line, re.M | re.I)
if result:
trace.result = result.group(1)
gas_used = re.search(r'\s*gas\sused:\s*([a-fA-F0-9]*)', line, re.M | re.I)
if gas_used:
trace.gas = gas_used.group(1)
value = re.search(r'\s*value:\s*([a-fA-F0-9]*)', line, re.M | re.I)
if value:
trace.value = value.group(1)
input_match = re.search(r'\s*in:\s*([a-fA-F0-9]*)', line, re.M | re.I)
if input_match:
trace.input = input_match.group(1)
output_match = re.search(r'\s*out:\s*([a-fA-F0-9]*)', line, re.M | re.I)
if output_match:
trace.output = output_match.group(1)
result_match = re.search(r'\s*result:\s*([a-fA-F0-9]*)', line, re.M | re.I)
if result_match:
trace.result = result_match.group(1)
gas_used_match = re.search(r'\s*gas\sused:\s*([a-fA-F0-9]*)', line, re.M | re.I)
if gas_used_match:
trace.gas = gas_used_match.group(1)
value_match = re.search(r'\s*value:\s*([a-fA-F0-9]*)', line, re.M | re.I)
if value_match:
trace.value = value_match.group(1)
def diff(self, analyser):
if not self.ready: