Skip to content

Commit 42bbbba

Browse files
committed
message-capture-parser: fix out of bounds error for empty vectors
1 parent a55606c commit 42bbbba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

contrib/message-capture/message-capture-parser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ def to_jsonable(obj: Any) -> Any:
7979
val = getattr(obj, slot, None)
8080
if slot in HASH_INTS and isinstance(val, int):
8181
ret[slot] = ser_uint256(val).hex()
82-
elif slot in HASH_INT_VECTORS and isinstance(val[0], int):
82+
elif slot in HASH_INT_VECTORS:
83+
assert all(isinstance(a, int) for a in val)
8384
ret[slot] = [ser_uint256(a).hex() for a in val]
8485
else:
8586
ret[slot] = to_jsonable(val)

0 commit comments

Comments
 (0)