Skip to content

Commit

Permalink
Added support for ByteString in _restore_typed_primitive (#279)
Browse files Browse the repository at this point in the history
* Added extended signing key support for cip8

* Fixed unused imports, flake8 checks pass.

* Fixed mypy error for overloaded variable

* Remove extraneous parameter for verify

* Added ByteString to _restored_typed_primitive

* Added type checking
  • Loading branch information
theeldermillenial committed Nov 3, 2023
1 parent af8afdc commit cd1f359
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pycardano/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,10 @@ def _restore_typed_primitive(
if not isinstance(v, list):
raise DeserializeException(f"Expected type list but got {type(v)}")
return IndefiniteList([_restore_typed_primitive(t, w) for w in v])
elif isclass(t) and t == ByteString:
if not isinstance(v, bytes):
raise DeserializeException(f"Expected type bytes but got {type(v)}")
return ByteString(v)
elif isclass(t) and issubclass(t, IndefiniteList):
try:
return IndefiniteList(v)
Expand Down

0 comments on commit cd1f359

Please sign in to comment.