formatting

This commit is contained in:
dni ⚡ 2023-02-06 11:56:48 +01:00
parent 69c0cd0276
commit 72386033a9
No known key found for this signature in database
GPG Key ID: 886317704CC4E618

View File

@ -69,7 +69,7 @@ def decode(pr: str) -> Invoice:
# pull out date # pull out date
date_bin = data.read(35) date_bin = data.read(35)
invoice.date = date_bin.uint #type: ignore invoice.date = date_bin.uint # type: ignore
while data.pos != data.len: while data.pos != data.len:
tag, tagdata, data = _pull_tagged(data) tag, tagdata, data = _pull_tagged(data)
@ -82,7 +82,7 @@ def decode(pr: str) -> Invoice:
elif tag == "p" and data_length == 52: elif tag == "p" and data_length == 52:
invoice.payment_hash = _trim_to_bytes(tagdata).hex() invoice.payment_hash = _trim_to_bytes(tagdata).hex()
elif tag == "x": elif tag == "x":
invoice.expiry = tagdata.uint #type: ignore invoice.expiry = tagdata.uint # type: ignore
elif tag == "n": elif tag == "n":
invoice.payee = _trim_to_bytes(tagdata).hex() invoice.payee = _trim_to_bytes(tagdata).hex()
# this won't work in most cases, we must extract the payee # this won't work in most cases, we must extract the payee
@ -92,11 +92,11 @@ def decode(pr: str) -> Invoice:
elif tag == "r": elif tag == "r":
s = bitstring.ConstBitStream(tagdata) s = bitstring.ConstBitStream(tagdata)
while s.pos + 264 + 64 + 32 + 32 + 16 < s.len: while s.pos + 264 + 64 + 32 + 32 + 16 < s.len:
pubkey = s.read(264) #type: ignore pubkey = s.read(264) # type: ignore
short_channel_id = s.read(64) #type: ignore short_channel_id = s.read(64) # type: ignore
base_fee_msat = s.read(32) #type: ignore base_fee_msat = s.read(32) # type: ignore
ppm_fee = s.read(32) #type: ignore ppm_fee = s.read(32) # type: ignore
cltv = s.read(16) #type: ignore cltv = s.read(16) # type: ignore
route = Route( route = Route(
pubkey=pubkey.tobytes().hex(), pubkey=pubkey.tobytes().hex(),
short_channel_id=_readable_scid(short_channel_id.intbe), short_channel_id=_readable_scid(short_channel_id.intbe),