Skip to content

Commit d0fbc02

Browse files
Fixed qa issues
1 parent 8d4a50d commit d0fbc02

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pycardano/serialization.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
CBORTag,
5050
FrozenDict,
5151
dumps,
52-
loads,
5352
undefined,
5453
)
5554
from frozenlist import FrozenList
@@ -208,7 +207,9 @@ def decode_array(self, subtype: int) -> Sequence[Any]:
208207
length = self._decode_length(subtype, allow_indefinite=True)
209208

210209
if length is None:
211-
return IndefiniteList(super().decode_array(subtype=subtype))
210+
return IndefiniteList(
211+
cast(Primitive, super().decode_array(subtype=subtype))
212+
)
212213
else:
213214
return super().decode_array(subtype=subtype)
214215

@@ -531,7 +532,7 @@ def from_cbor(cls, payload: Union[str, bytes]) -> CBORSerializable:
531532
if type(payload) is str:
532533
payload = bytes.fromhex(payload)
533534

534-
with BytesIO(payload) as fp:
535+
with BytesIO(cast(bytes, payload)) as fp:
535536
value = IndefiniteDecoder(fp).decode()
536537

537538
return cls.from_primitive(value)
@@ -555,7 +556,7 @@ def _restore_dataclass_field(
555556

556557
if "object_hook" in f.metadata:
557558
return f.metadata["object_hook"](v)
558-
return _restore_typed_primitive(f.type, v)
559+
return _restore_typed_primitive(cast(Any, f.type), v)
559560

560561

561562
def _restore_typed_primitive(

0 commit comments

Comments
 (0)