Skip to content

Commit d73f5a2

Browse files
committed
Return original type from from_cbor
1 parent 991803e commit d73f5a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pycardano/serialization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,14 +461,14 @@ def to_cbor_hex(self) -> str:
461461
return self.to_cbor().hex()
462462

463463
@classmethod
464-
def from_cbor(cls, payload: Union[str, bytes]) -> CBORSerializable:
464+
def from_cbor(cls: Type[CBORBase], payload: Union[str, bytes]) -> CBORBase:
465465
"""Restore a CBORSerializable object from a CBOR.
466466
467467
Args:
468468
payload (Union[str, bytes]): CBOR bytes or hex string to restore from.
469469
470470
Returns:
471-
CBORSerializable: Restored CBORSerializable object.
471+
CBORBase: Restored CBORSerializable object of the specific subclass type.
472472
473473
Examples:
474474

0 commit comments

Comments
 (0)