Skip to content

Commit 67add7a

Browse files
Added type checking
1 parent 1bf3f81 commit 67add7a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pycardano/serialization.py

+2
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,8 @@ def _restore_typed_primitive(
533533
raise DeserializeException(f"Expected type list but got {type(v)}")
534534
return IndefiniteList([_restore_typed_primitive(t, w) for w in v])
535535
elif isclass(t) and t == ByteString:
536+
if not isinstance(v, bytes):
537+
raise DeserializeException(f"Expected type bytes but got {type(v)}")
536538
return ByteString(v)
537539
elif isclass(t) and issubclass(t, IndefiniteList):
538540
try:

0 commit comments

Comments
 (0)