Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions pycardano/cip/cip8.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,14 @@ def sign(

msg.key = cose_key # attach the key to the message

if isinstance(signing_key, ExtendedSigningKey):
_message = [
msg.phdr_encoded,
msg.uhdr_encoded,
msg.payload,
signing_key.sign(msg._sig_structure),
]

encoded = dumps(
CBORTag(msg.cbor_tag, _message), default=msg._custom_cbor_encoder
)

else:
encoded = msg.encode()
_message = [
msg.phdr_encoded,
msg.uhdr_encoded,
msg.payload,
signing_key.sign(msg._sig_structure),
]

encoded = dumps(CBORTag(msg.cbor_tag, _message), default=msg._custom_cbor_encoder)

# turn the enocded message into a hex string and remove the first byte
# which is always "d2"
Expand Down