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": 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
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( route = Route(
pubkey=pubkey.tobytes().hex(), pubkey=s.read(264).tobytes().hex(), # type: ignore
short_channel_id=_readable_scid(short_channel_id.intbe), short_channel_id=_readable_scid(s.read(64).intbe), # type: ignore
base_fee_msat=base_fee_msat.intbe, base_fee_msat=s.read(32).intbe, # type: ignore
ppm_fee=ppm_fee.intbe, ppm_fee=s.read(32).intbe, # type: ignore
cltv=cltv.intbe, cltv=s.read(16).intbe, # type: ignore
) )
invoice.route_hints.append(route) invoice.route_hints.append(route)

View File

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

View File

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