You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m trying to convert back into a Transaction some cbor hex representing some signed transaction.
Currently, I’m using tx = Transaction.from_cbor(signed_tx_hex), but the type annotations for that from_cbor() function says it returns a CBORSerializable instead of the actual class calling that class method.
As a result, the type checker does not recognize it as a transaction, and isn’t happy about calling tx.id on it. So I can ignore the type checker, but I was wondering if it was possible to improve the typing annotation somehow such that the type checker doesn’t get tripped up on that. Or if there is a fundamental reason why it is CBORSerializable and not the potential subclass being use instead.
The text was updated successfully, but these errors were encountered:
I’m trying to convert back into a
Transaction
some cbor hex representing some signed transaction.Currently, I’m using
tx = Transaction.from_cbor(signed_tx_hex)
, but the type annotations for thatfrom_cbor()
function says it returns aCBORSerializable
instead of the actual class calling that class method.As a result, the type checker does not recognize it as a transaction, and isn’t happy about calling
tx.id
on it. So I can ignore the type checker, but I was wondering if it was possible to improve the typing annotation somehow such that the type checker doesn’t get tripped up on that. Or if there is a fundamental reason why it isCBORSerializable
and not the potential subclass being use instead.The text was updated successfully, but these errors were encountered: