Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
dni committed Jul 19, 2024
1 parent f813054 commit 082960f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion bolt11/encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 3 additions & 2 deletions bolt11/models/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ex = {
"private_key": "e126f68f7eafcc8b74f54d269fe206be715000f94dac067d1c04a8ca3b2db734",
"public_key": "03e7156ae33b0a208d0744199163177e909e80176e55d97a2f221ede0f934dd9ad"
"public_key": "03e7156ae33b0a208d0744199163177e909e80176e55d97a2f221ede0f934dd9ad",
}


Expand Down

0 comments on commit 082960f

Please sign in to comment.