mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-23 22:47:05 +01:00
[CHORE] cln.py pyln-client is not optional (#1859)
* [refactor] pyln-client is not optional some time ago we added pyln do main dependencies, its need for think like, saas or docker. so this import was dead code * stubs for pyln.client
This commit is contained in:
parent
2434518d21
commit
511a0fd895
2 changed files with 2 additions and 10 deletions
|
@ -1,14 +1,10 @@
|
|||
try:
|
||||
from pyln.client import LightningRpc, RpcError # type: ignore
|
||||
except ImportError: # pragma: nocover
|
||||
LightningRpc = None
|
||||
|
||||
import asyncio
|
||||
import random
|
||||
from functools import partial, wraps
|
||||
from typing import AsyncGenerator, Optional
|
||||
|
||||
from loguru import logger
|
||||
from pyln.client import LightningRpc, RpcError
|
||||
|
||||
from lnbits import bolt11 as lnbits_bolt11
|
||||
from lnbits.settings import settings
|
||||
|
@ -44,11 +40,6 @@ def _paid_invoices_stream(ln, last_pay_index):
|
|||
|
||||
class CoreLightningWallet(Wallet):
|
||||
def __init__(self):
|
||||
if LightningRpc is None: # pragma: nocover
|
||||
raise ImportError(
|
||||
"The `pyln-client` library must be installed to use `CoreLightningWallet`."
|
||||
)
|
||||
|
||||
self.rpc = settings.corelightning_rpc or settings.clightning_rpc
|
||||
self.ln = LightningRpc(self.rpc)
|
||||
|
||||
|
|
|
@ -94,6 +94,7 @@ module = [
|
|||
"ecdsa.*",
|
||||
"psycopg2.*",
|
||||
"pyngrok.*",
|
||||
"pyln.client.*",
|
||||
]
|
||||
ignore_missing_imports = "True"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue