shorten and ignore cln.py

This commit is contained in:
callebtc 2023-02-28 15:50:06 +01:00 committed by dni ⚡
parent f766f9b2c3
commit 234b508368
No known key found for this signature in database
GPG Key ID: 886317704CC4E618
3 changed files with 7 additions and 11 deletions

View File

@ -91,17 +91,12 @@ def decode(pr: str) -> Invoice:
elif tag == "r":
s = bitstring.ConstBitStream(tagdata)
while s.pos + 264 + 64 + 32 + 32 + 16 < s.len:
pubkey = s.read(264) # type: ignore
short_channel_id = s.read(64) # type: ignore
base_fee_msat = s.read(32) # type: ignore
ppm_fee = s.read(32) # type: ignore
cltv = s.read(16) # type: ignore
route = Route(
pubkey=pubkey.tobytes().hex(),
short_channel_id=_readable_scid(short_channel_id.intbe),
base_fee_msat=base_fee_msat.intbe,
ppm_fee=ppm_fee.intbe,
cltv=cltv.intbe,
pubkey=s.read(264).tobytes().hex(), # type: ignore
short_channel_id=_readable_scid(s.read(64).intbe), # type: ignore
base_fee_msat=s.read(32).intbe, # type: ignore
ppm_fee=s.read(32).intbe, # type: ignore
cltv=s.read(16).intbe, # type: ignore
)
invoice.route_hints.append(route)

View File

@ -185,7 +185,7 @@ class Database(Compat):
async def connect(self):
await self.lock.acquire()
try:
async with self.engine.connect() as conn:
async with self.engine.connect() as conn: # type: ignore
async with conn.begin() as txn:
wconn = Connection(conn, txn, self.type, self.name, self.schema)

View File

@ -1,3 +1,4 @@
# type: ignore
try:
from pyln.client import LightningRpc, RpcError # type: ignore
except ImportError: # pragma: nocover