Skip to content

Commit

Permalink
Review
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchiavini committed Dec 21, 2023
1 parent be72dec commit cd07723
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions tests/functional/builtins/codegen/test_extract32.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ def extrakt32_storage(index: uint256, inp: Bytes[100]) -> bytes32:
)

for S, i in test_cases:
if i < 0 or i > len(S) - 32:
with tx_failed():
c.extrakt32(S, i)
if 0 <= i <= len(S) - 32:
expected_result = S[i : i + 32]
assert c.extrakt32(S, i) == expected_result
assert c.extrakt32_mem(S, i) == expected_result
assert c.extrakt32_storage(i, S) == expected_result
continue

This comment has been minimized.

Copy link
@charles-cooper

charles-cooper Dec 21, 2023

Member

i think clearer here to use an else instead of continue

This comment has been minimized.

Copy link
@DanielSchiavini

DanielSchiavini Dec 21, 2023

Author Contributor

expected_result = S[i : i + 32]
assert c.extrakt32(S, i) == expected_result
assert c.extrakt32_mem(S, i) == expected_result
assert c.extrakt32_storage(i, S) == expected_result
with tx_failed():
c.extrakt32(S, i)

print("Passed bytes32 extraction test")

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/codegen/features/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def test_event_logging_cannot_have_more_than_three_topics(
"""

with tx_failed(EventDeclarationException):

This comment has been minimized.

Copy link
@charles-cooper

charles-cooper Dec 21, 2023

Member

this can just be a pytest.raises(...): compile_code(...)

lambda: get_contract_with_gas_estimation(loggy_code)
get_contract_with_gas_estimation(loggy_code)


def test_event_logging_with_data(w3, tester, keccak, get_logs, get_contract_with_gas_estimation):
Expand Down

0 comments on commit cd07723

Please sign in to comment.