Skip to content

Commit

Permalink
use static size, not min size
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Jun 6, 2024
1 parent 536e903 commit a36a262
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/functional/builtins/codegen/abi_decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ def _read_int(payload, ofst):
def spec_decode(typ: "VyperType", payload: bytes):
abi_t = typ.abi_type

if not (abi_t.min_size() <= len(payload) <= abi_t.size_bound()):
raise DecodeError(
f"bad payload size {abi_t.min_size()}, {len(payload)}, {abi_t.size_bound()}"
)
lo, hi = abi_t.static_size(), abi_t.size_bound()
if not (lo <= len(payload) <= hi):
raise DecodeError(f"bad payload size {lo}, {len(payload)}, {hi}")

return _decode_r(abi_t, 0, payload)

Expand Down

0 comments on commit a36a262

Please sign in to comment.