Better type inference of storage variables #262
6 fail, 51 pass in 43m 30s
57 tests 51 ✅ 43m 30s ⏱️
1 suites 0 💤
1 files 6 ❌
Results for commit 70fe330.
Annotations
Check warning on line 0 in test_gigahorse
github-actions / Test Results (Souffle 2.4)
test_gigahorse[storage.mapping-merged] (test_gigahorse) failed
test-results.xml [took 37s]
Raw output
AssertionError: Value for Verbatim_StructToString (struct_175 struct struct_175 { address field0_0_19; bool field0_20_20; bool field0_21_21; uint256 field1; }
) not the expected value (struct_[0-9]* struct struct_[0-9]* { uint160 field0_0_19; uint8 field0_20_20; uint8 field0_21_21; uint256 field1; }
).
assert None
+ where None = <built-in method match of re.Pattern object at 0x55db50d1d430>('struct_175\tstruct struct_175 { address field0_0_19; bool field0_20_20; bool field0_21_21; uint256 field1; }\n')
+ where <built-in method match of re.Pattern object at 0x55db50d1d430> = re.compile('struct_[0-9]*\tstruct struct_[0-9]* { uint160 field0_0_19; uint8 field0_20_20; uint8 field0_21_21; uint256 field1; }\n').match
gigahorse_test = storage.mapping-merged
@pytest.mark.parametrize("gigahorse_test", testdata)
def test_gigahorse(gigahorse_test):
> gigahorse_test.run()
test_gigahorse.py:148:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = storage.mapping-merged
def run(self):
def within_margin(actual: int, expected: int, margin: float) -> bool:
return (1 - margin) * expected <= actual <= (1 + margin) * expected
result = self.__run()
with open(join(self.working_dir, 'stdout'), 'wb') as f:
f.write(result.stdout)
with open(join(self.working_dir, 'stderr'), 'wb') as f:
f.write(result.stderr)
assert result.returncode == 0, f"Gigahorse exited with an error code: {result.returncode}"
with open(self.results_file) as f:
(_, _, _, temp_analytics), = json.load(f)
analytics = {}
for x, y in temp_analytics.items():
analytics[x] = y
for metric, expected, margin in self.expected_analytics:
assert within_margin(analytics[metric], expected, margin), f"Value for {metric} ({analytics[metric]}) not within margin of expected value ({expected})."
for metric, expected in self.expected_verbatim:
if '*' not in expected:
assert analytics[metric] == expected, f"Value for {metric} ({analytics[metric]}) not the expected value ({expected})."
else:
regex = re.compile(expected)
> assert regex.match(analytics[metric]), f"Value for {metric} ({analytics[metric]}) not the expected value ({expected})."
E AssertionError: Value for Verbatim_StructToString (struct_175 struct struct_175 { address field0_0_19; bool field0_20_20; bool field0_21_21; uint256 field1; }
E ) not the expected value (struct_[0-9]* struct struct_[0-9]* { uint160 field0_0_19; uint8 field0_20_20; uint8 field0_21_21; uint256 field1; }
E ).
E assert None
E + where None = <built-in method match of re.Pattern object at 0x55db50d1d430>('struct_175\tstruct struct_175 { address field0_0_19; bool field0_20_20; bool field0_21_21; uint256 field1; }\n')
E + where <built-in method match of re.Pattern object at 0x55db50d1d430> = re.compile('struct_[0-9]*\tstruct struct_[0-9]* { uint160 field0_0_19; uint8 field0_20_20; uint8 field0_21_21; uint256 field1; }\n').match
test_gigahorse.py:103: AssertionError
Check warning on line 0 in test_gigahorse
github-actions / Test Results (Souffle 2.4)
test_gigahorse[storage.array-merged] (test_gigahorse) failed
test-results.xml [took 37s]
Raw output
AssertionError: Value for Verbatim_StructToString (struct_163 struct struct_163 { address field0_0_19; bool field0_20_20; bool field0_21_21; }
) not the expected value (struct_[0-9]* struct struct_[0-9]* { uint160 field0_0_19; uint8 field0_20_20; uint8 field0_21_21; }
).
assert None
+ where None = <built-in method match of re.Pattern object at 0x55db50cbbf50>('struct_163\tstruct struct_163 { address field0_0_19; bool field0_20_20; bool field0_21_21; }\n')
+ where <built-in method match of re.Pattern object at 0x55db50cbbf50> = re.compile('struct_[0-9]*\tstruct struct_[0-9]* { uint160 field0_0_19; uint8 field0_20_20; uint8 field0_21_21; }\n').match
gigahorse_test = storage.array-merged
@pytest.mark.parametrize("gigahorse_test", testdata)
def test_gigahorse(gigahorse_test):
> gigahorse_test.run()
test_gigahorse.py:148:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = storage.array-merged
def run(self):
def within_margin(actual: int, expected: int, margin: float) -> bool:
return (1 - margin) * expected <= actual <= (1 + margin) * expected
result = self.__run()
with open(join(self.working_dir, 'stdout'), 'wb') as f:
f.write(result.stdout)
with open(join(self.working_dir, 'stderr'), 'wb') as f:
f.write(result.stderr)
assert result.returncode == 0, f"Gigahorse exited with an error code: {result.returncode}"
with open(self.results_file) as f:
(_, _, _, temp_analytics), = json.load(f)
analytics = {}
for x, y in temp_analytics.items():
analytics[x] = y
for metric, expected, margin in self.expected_analytics:
assert within_margin(analytics[metric], expected, margin), f"Value for {metric} ({analytics[metric]}) not within margin of expected value ({expected})."
for metric, expected in self.expected_verbatim:
if '*' not in expected:
assert analytics[metric] == expected, f"Value for {metric} ({analytics[metric]}) not the expected value ({expected})."
else:
regex = re.compile(expected)
> assert regex.match(analytics[metric]), f"Value for {metric} ({analytics[metric]}) not the expected value ({expected})."
E AssertionError: Value for Verbatim_StructToString (struct_163 struct struct_163 { address field0_0_19; bool field0_20_20; bool field0_21_21; }
E ) not the expected value (struct_[0-9]* struct struct_[0-9]* { uint160 field0_0_19; uint8 field0_20_20; uint8 field0_21_21; }
E ).
E assert None
E + where None = <built-in method match of re.Pattern object at 0x55db50cbbf50>('struct_163\tstruct struct_163 { address field0_0_19; bool field0_20_20; bool field0_21_21; }\n')
E + where <built-in method match of re.Pattern object at 0x55db50cbbf50> = re.compile('struct_[0-9]*\tstruct struct_[0-9]* { uint160 field0_0_19; uint8 field0_20_20; uint8 field0_21_21; }\n').match
test_gigahorse.py:103: AssertionError
Check warning on line 0 in test_gigahorse
github-actions / Test Results (Souffle 2.4)
test_gigahorse[storage.array1-iropt] (test_gigahorse) failed
test-results.xml [took 1m 25s]
Raw output
AssertionError: Value for Verbatim_StorageOffset_Type (0x0 address[]
) not the expected value (0x0 uint160[]
).
assert '0x0\taddress[]\n' == '0x0\tuint160[]\n'
- 0x0 uint160[]
+ 0x0 address[]
gigahorse_test = storage.array1-iropt
@pytest.mark.parametrize("gigahorse_test", testdata)
def test_gigahorse(gigahorse_test):
> gigahorse_test.run()
test_gigahorse.py:148:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = storage.array1-iropt
def run(self):
def within_margin(actual: int, expected: int, margin: float) -> bool:
return (1 - margin) * expected <= actual <= (1 + margin) * expected
result = self.__run()
with open(join(self.working_dir, 'stdout'), 'wb') as f:
f.write(result.stdout)
with open(join(self.working_dir, 'stderr'), 'wb') as f:
f.write(result.stderr)
assert result.returncode == 0, f"Gigahorse exited with an error code: {result.returncode}"
with open(self.results_file) as f:
(_, _, _, temp_analytics), = json.load(f)
analytics = {}
for x, y in temp_analytics.items():
analytics[x] = y
for metric, expected, margin in self.expected_analytics:
assert within_margin(analytics[metric], expected, margin), f"Value for {metric} ({analytics[metric]}) not within margin of expected value ({expected})."
for metric, expected in self.expected_verbatim:
if '*' not in expected:
> assert analytics[metric] == expected, f"Value for {metric} ({analytics[metric]}) not the expected value ({expected})."
E AssertionError: Value for Verbatim_StorageOffset_Type (0x0 address[]
E ) not the expected value (0x0 uint160[]
E ).
E assert '0x0\taddress[]\n' == '0x0\tuint160[]\n'
E
E - 0x0 uint160[]
E + 0x0 address[]
test_gigahorse.py:100: AssertionError
Check warning on line 0 in test_gigahorse
github-actions / Test Results (Souffle 2.4)
test_gigahorse[storage.map1] (test_gigahorse) failed
test-results.xml [took 37s]
Raw output
AssertionError: Value for Verbatim_StorageOffset_Type (0x0 mapping (uint256 => bool)
) not the expected value (0x0 mapping (uint256 => uint8)
).
assert '0x0\tmapping...56 => bool)\n' == '0x0\tmapping...6 => uint8)\n'
- 0x0 mapping (uint256 => uint8)
? ^^^^^
+ 0x0 mapping (uint256 => bool)
? ^^^^
gigahorse_test = storage.map1
@pytest.mark.parametrize("gigahorse_test", testdata)
def test_gigahorse(gigahorse_test):
> gigahorse_test.run()
test_gigahorse.py:148:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = storage.map1
def run(self):
def within_margin(actual: int, expected: int, margin: float) -> bool:
return (1 - margin) * expected <= actual <= (1 + margin) * expected
result = self.__run()
with open(join(self.working_dir, 'stdout'), 'wb') as f:
f.write(result.stdout)
with open(join(self.working_dir, 'stderr'), 'wb') as f:
f.write(result.stderr)
assert result.returncode == 0, f"Gigahorse exited with an error code: {result.returncode}"
with open(self.results_file) as f:
(_, _, _, temp_analytics), = json.load(f)
analytics = {}
for x, y in temp_analytics.items():
analytics[x] = y
for metric, expected, margin in self.expected_analytics:
assert within_margin(analytics[metric], expected, margin), f"Value for {metric} ({analytics[metric]}) not within margin of expected value ({expected})."
for metric, expected in self.expected_verbatim:
if '*' not in expected:
> assert analytics[metric] == expected, f"Value for {metric} ({analytics[metric]}) not the expected value ({expected})."
E AssertionError: Value for Verbatim_StorageOffset_Type (0x0 mapping (uint256 => bool)
E ) not the expected value (0x0 mapping (uint256 => uint8)
E ).
E assert '0x0\tmapping...56 => bool)\n' == '0x0\tmapping...6 => uint8)\n'
E
E - 0x0 mapping (uint256 => uint8)
E ? ^^^^^
E + 0x0 mapping (uint256 => bool)
E ? ^^^^
test_gigahorse.py:100: AssertionError
Check warning on line 0 in test_gigahorse
github-actions / Test Results (Souffle 2.4)
test_gigahorse[storage.array1-opt] (test_gigahorse) failed
test-results.xml [took 1m 25s]
Raw output
AssertionError: Value for Verbatim_StorageOffset_Type (0x0 address[]
) not the expected value (0x0 uint160[]
).
assert '0x0\taddress[]\n' == '0x0\tuint160[]\n'
- 0x0 uint160[]
+ 0x0 address[]
gigahorse_test = storage.array1-opt
@pytest.mark.parametrize("gigahorse_test", testdata)
def test_gigahorse(gigahorse_test):
> gigahorse_test.run()
test_gigahorse.py:148:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = storage.array1-opt
def run(self):
def within_margin(actual: int, expected: int, margin: float) -> bool:
return (1 - margin) * expected <= actual <= (1 + margin) * expected
result = self.__run()
with open(join(self.working_dir, 'stdout'), 'wb') as f:
f.write(result.stdout)
with open(join(self.working_dir, 'stderr'), 'wb') as f:
f.write(result.stderr)
assert result.returncode == 0, f"Gigahorse exited with an error code: {result.returncode}"
with open(self.results_file) as f:
(_, _, _, temp_analytics), = json.load(f)
analytics = {}
for x, y in temp_analytics.items():
analytics[x] = y
for metric, expected, margin in self.expected_analytics:
assert within_margin(analytics[metric], expected, margin), f"Value for {metric} ({analytics[metric]}) not within margin of expected value ({expected})."
for metric, expected in self.expected_verbatim:
if '*' not in expected:
> assert analytics[metric] == expected, f"Value for {metric} ({analytics[metric]}) not the expected value ({expected})."
E AssertionError: Value for Verbatim_StorageOffset_Type (0x0 address[]
E ) not the expected value (0x0 uint160[]
E ).
E assert '0x0\taddress[]\n' == '0x0\tuint160[]\n'
E
E - 0x0 uint160[]
E + 0x0 address[]
test_gigahorse.py:100: AssertionError
Check warning on line 0 in test_gigahorse
github-actions / Test Results (Souffle 2.4)
test_gigahorse[storage.array1] (test_gigahorse) failed
test-results.xml [took 1m 26s]
Raw output
AssertionError: Value for Verbatim_StorageOffset_Type (0x0 address[]
) not the expected value (0x0 uint160[]
).
assert '0x0\taddress[]\n' == '0x0\tuint160[]\n'
- 0x0 uint160[]
+ 0x0 address[]
gigahorse_test = storage.array1
@pytest.mark.parametrize("gigahorse_test", testdata)
def test_gigahorse(gigahorse_test):
> gigahorse_test.run()
test_gigahorse.py:148:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = storage.array1
def run(self):
def within_margin(actual: int, expected: int, margin: float) -> bool:
return (1 - margin) * expected <= actual <= (1 + margin) * expected
result = self.__run()
with open(join(self.working_dir, 'stdout'), 'wb') as f:
f.write(result.stdout)
with open(join(self.working_dir, 'stderr'), 'wb') as f:
f.write(result.stderr)
assert result.returncode == 0, f"Gigahorse exited with an error code: {result.returncode}"
with open(self.results_file) as f:
(_, _, _, temp_analytics), = json.load(f)
analytics = {}
for x, y in temp_analytics.items():
analytics[x] = y
for metric, expected, margin in self.expected_analytics:
assert within_margin(analytics[metric], expected, margin), f"Value for {metric} ({analytics[metric]}) not within margin of expected value ({expected})."
for metric, expected in self.expected_verbatim:
if '*' not in expected:
> assert analytics[metric] == expected, f"Value for {metric} ({analytics[metric]}) not the expected value ({expected})."
E AssertionError: Value for Verbatim_StorageOffset_Type (0x0 address[]
E ) not the expected value (0x0 uint160[]
E ).
E assert '0x0\taddress[]\n' == '0x0\tuint160[]\n'
E
E - 0x0 uint160[]
E + 0x0 address[]
test_gigahorse.py:100: AssertionError