Skip to content

Commit

Permalink
add comments to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Jan 15, 2025
1 parent 0ccac1f commit b501329
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/functional/codegen/types/test_dynamic_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1918,6 +1918,7 @@ def foo(a: DynArray[uint256, 4000]) -> uint256:
assert c.foo(dynarray) == 2
gas_used = env.last_result.gas_used
with tx_failed(EvmError): # catch reverts *and* exceptional halt from oog
# should fail pre-cancun due to identity precompile returning 0
c.foo(dynarray, gas=gas_used - 1)


Expand All @@ -1938,4 +1939,5 @@ def foo(x: String[1000000], y: String[1000000]) -> DynArray[String[1000000], 2]:
assert c.foo(calldata0, calldata1) == [calldata0, calldata1]
gas_used = env.last_result.gas_used
with tx_failed(EvmError): # catch reverts *and* exceptional halt from oog
# should fail pre-cancun due to identity precompile returning 0
c.foo(calldata0, calldata1, gas=gas_used - 1)
4 changes: 4 additions & 0 deletions tests/functional/codegen/types/test_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,8 @@ def foo(x: uint256[3000]) -> uint256:
assert c.foo(array) == array[0]
gas_used = env.last_result.gas_used
with tx_failed(EvmError): # catch reverts *and* exceptional halt from oog
# depends on EVM version. pre-cancun, will revert due to checking
# success flag from identity precompile.
c.foo(array, gas=gas_used - 1)


Expand All @@ -895,4 +897,6 @@ def foo(x: uint256[2500]) -> uint256:
assert c.foo(array) == array[0]
gas_used = env.last_result.gas_used
with tx_failed(EvmError): # catch reverts *and* exceptional halt from oog
# depends on EVM version. pre-cancun, will revert due to checking
# success flag from identity precompile.
c.foo(array, gas=gas_used - 1)

0 comments on commit b501329

Please sign in to comment.