|
7 | 7 | from unittest.mock import patch |
8 | 8 |
|
9 | 9 | import pytest |
10 | | -from cryptography.exceptions import InvalidSignature |
11 | 10 | from cryptography.hazmat.primitives import serialization |
12 | 11 | from cryptography.hazmat.primitives.asymmetric.ec import SECP256K1, generate_private_key |
13 | 12 | from ecies import PrivateKey, decrypt |
14 | 13 | from uma.currency import Currency |
| 14 | +from uma.exceptions import InvalidSignatureException |
15 | 15 | from uma.kyc_status import KycStatus |
16 | 16 | from uma.payer_data import PayerDataOptions |
17 | 17 | from uma.public_key_cache import InMemoryPublicKeyCache, PubkeyResponse |
@@ -116,7 +116,7 @@ def test_pay_request_create_and_parse() -> None: |
116 | 116 | pay_request.payer_data.compliance.signature = ( # pyre-ignore: [16] |
117 | 117 | secrets.token_hex() |
118 | 118 | ) |
119 | | - with pytest.raises(InvalidSignature): |
| 119 | + with pytest.raises(InvalidSignatureException): |
120 | 120 | verify_pay_request_signature(pay_request, sender_signing_public_key_bytes) |
121 | 121 |
|
122 | 122 | # verify encryption |
@@ -191,7 +191,7 @@ def test_lnurlp_request_url_create_and_parse() -> None: |
191 | 191 |
|
192 | 192 | # test invalid signature |
193 | 193 | request.signature = secrets.token_hex() |
194 | | - with pytest.raises(InvalidSignature): |
| 194 | + with pytest.raises(InvalidSignatureException): |
195 | 195 | verify_uma_lnurlp_query_signature(request, sender_signing_public_key_bytes) |
196 | 196 |
|
197 | 197 |
|
@@ -341,7 +341,7 @@ def test_lnurlp_response_create_and_parse() -> None: |
341 | 341 |
|
342 | 342 | # test invalid signature |
343 | 343 | result_response.compliance.signature = secrets.token_hex() |
344 | | - with pytest.raises(InvalidSignature): |
| 344 | + with pytest.raises(InvalidSignatureException): |
345 | 345 | verify_uma_lnurlp_response_signature( |
346 | 346 | result_response, receiver_signing_public_key_bytes |
347 | 347 | ) |
0 commit comments