Skip to content

Commit

Permalink
readability: use consistent error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
0xkarmacoma committed Jan 16, 2025
1 parent ebc6da6 commit f3bdd37
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/halmos/sevm.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,7 @@ def is_create(self) -> bool:
def calldata_slice(self, start: int, size: int) -> ByteVec:
"""Wrapper around calldata access with a size check."""
if size > MAX_MEMORY_SIZE:
raise OutOfGasError(
f"calldata slice with {start=} {size=} exceeds MAX_MEMORY_SIZE"
)
raise OutOfGasError(f"calldata read {start=} {size=} > MAX_MEMORY_SIZE")

return self.data.slice(start=start, stop=start + size)

Expand Down Expand Up @@ -689,9 +687,7 @@ def next_pc(self, pc):
def slice(self, start, size) -> ByteVec:
# large start is allowed, but we must check the size
if size > MAX_MEMORY_SIZE:
raise OutOfGasError(
f"code slice with {start=} {size=} exceeds MAX_MEMORY_SIZE"
)
raise OutOfGasError(f"code read {start=} {size=} > MAX_MEMORY_SIZE")

stop = start + size

Expand Down

0 comments on commit f3bdd37

Please sign in to comment.