From 082960f68382d6315b6f35837f9d1a6e1ff2f0c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Fri, 19 Jul 2024 07:40:27 +0200 Subject: [PATCH] format --- bolt11/encode.py | 4 +++- bolt11/models/signature.py | 5 +++-- tests/test_signature.py | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bolt11/encode.py b/bolt11/encode.py index 54ad927..d86f6cc 100644 --- a/bolt11/encode.py +++ b/bolt11/encode.py @@ -93,7 +93,9 @@ def encode( data_part = timestamp + tags if private_key: - invoice.signature = Signature.from_private_key(hrp=hrp, private_key=private_key, signing_data=data_part.tobytes()) + invoice.signature = Signature.from_private_key( + hrp=hrp, private_key=private_key, signing_data=data_part.tobytes() + ) if not invoice.signature: raise Bolt11NoSignatureException() diff --git a/bolt11/models/signature.py b/bolt11/models/signature.py index 52eebe6..7258d52 100644 --- a/bolt11/models/signature.py +++ b/bolt11/models/signature.py @@ -13,7 +13,9 @@ class Signature: signature_data: bytes @classmethod - def from_signature_data(cls, hrp: str, signature_data: bytes, signing_data: bytes) -> "Signature": + def from_signature_data( + cls, hrp: str, signature_data: bytes, signing_data: bytes + ) -> "Signature": return cls(hrp=hrp, signature_data=signature_data, signing_data=signing_data) @classmethod @@ -36,7 +38,6 @@ def verify(self, payee: str) -> bool: # pubkey.verify(self.signature_data, message) return True - def recover_public_key(self) -> str: if not self.signature_data: raise ValueError("No signature data") diff --git a/tests/test_signature.py b/tests/test_signature.py index 2944e6c..2d14e5c 100644 --- a/tests/test_signature.py +++ b/tests/test_signature.py @@ -2,7 +2,7 @@ ex = { "private_key": "e126f68f7eafcc8b74f54d269fe206be715000f94dac067d1c04a8ca3b2db734", - "public_key": "03e7156ae33b0a208d0744199163177e909e80176e55d97a2f221ede0f934dd9ad" + "public_key": "03e7156ae33b0a208d0744199163177e909e80176e55d97a2f221ede0f934dd9ad", }