Skip to content

Commit 049c6bf

Browse files
Remove extraneous parameter for verify
1 parent 143e843 commit 049c6bf

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

pycardano/cip/cip8.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from typing import Optional, Union
22

33
from cbor2 import CBORTag, dumps
4-
54
from cose.algorithms import EdDSA
65
from cose.headers import KID, Algorithm
76
from cose.keys import CoseKey
@@ -14,10 +13,10 @@
1413
from pycardano.address import Address
1514
from pycardano.crypto import BIP32ED25519PublicKey
1615
from pycardano.key import (
17-
PaymentVerificationKey,
18-
SigningKey,
1916
ExtendedSigningKey,
2017
ExtendedVerificationKey,
18+
PaymentVerificationKey,
19+
SigningKey,
2120
StakeExtendedSigningKey,
2221
StakeSigningKey,
2322
StakeVerificationKey,
@@ -129,7 +128,6 @@ def sign(
129128
def verify(
130129
signed_message: Union[str, dict],
131130
attach_cose_key: Optional[bool] = None,
132-
extended=False,
133131
) -> dict:
134132
"""Verify the signature of a COSESign1 message and decode its contents following CIP-0008.
135133
Supports messages signed by browser wallets or `Message.sign()`.
@@ -196,7 +194,7 @@ def verify(
196194
# attach the key to the decoded message
197195
decoded_message.key = cose_key
198196

199-
if extended:
197+
if len(verification_key) > 32:
200198
vk = BIP32ED25519PublicKey(
201199
public_key=verification_key[:32], chain_code=verification_key[32:]
202200
)

test/pycardano/test_cip8.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
)
1111
from pycardano.network import Network
1212

13-
1413
EXTENDED_SK = ExtendedSigningKey.from_json(
1514
"""{
1615
"type": "PaymentExtendedSigningKeyShelley_ed25519_bip32",
@@ -170,7 +169,7 @@ def test_extended_sign_and_verify():
170169
network=Network.TESTNET,
171170
)
172171

173-
verification = verify(signed_message, extended=True)
172+
verification = verify(signed_message)
174173
assert verification["verified"]
175174
assert verification["message"] == "Pycardano is cool."
176175
assert verification["signing_address"].payment_part == EXTENDED_VK.hash()

0 commit comments

Comments
 (0)