diff --git a/evmspec/data/_main.py b/evmspec/data/_main.py index 6931e81..66dda85 100644 --- a/evmspec/data/_main.py +++ b/evmspec/data/_main.py @@ -298,7 +298,7 @@ def _decode_hook(typ: Type, obj: object): ONE_EMPTY_BYTE = bytes(HexBytes("0x00")) -_MISSING_BYTES = {i: (32 - i) * ONE_EMPTY_BYTE for i in range(0, 32)} +_MISSING_BYTES = {i: (32 - i) * ONE_EMPTY_BYTE for i in range(0, 33)} """Calculate the number of missing bytes and return them. Args: @@ -340,7 +340,7 @@ def __new__(cls, v): try: missing_bytes = _MISSING_BYTES[len(input_bytes)] except KeyError as e: - raise ValueError(f"{v} is too long") from e.__cause__ + raise ValueError(f"{v} is too long: {len(input_bytes)}") from e.__cause__ return __hb_new__(cls, missing_bytes + input_bytes)