mirror of
https://github.com/fusion44/blitz_api.git
synced 2026-08-16 12:20:14 +02:00
[pre-commit.ci] pre-commit autoupdate (#187)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 22.12.0 → 23.1.0](https://github.com/psf/black/compare/22.12.0...23.1.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
0fe94da897
commit
3d1dfd919c
18 changed files with 2 additions and 32 deletions
|
|
@ -14,7 +14,7 @@ repos:
|
|||
- id: debug-statements
|
||||
- id: mixed-line-ending
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 22.12.0
|
||||
rev: 23.1.0
|
||||
hooks:
|
||||
- id: black
|
||||
- repo: https://github.com/pycqa/isort
|
||||
|
|
|
|||
|
|
@ -114,7 +114,6 @@ class _PushID(object):
|
|||
)
|
||||
|
||||
def __init__(self):
|
||||
|
||||
# Timestamp of last push, used to prevent local collisions if you
|
||||
# push twice in one ms.
|
||||
self.last_push_time = 0
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ node_type = config("ln_node")
|
|||
|
||||
class RaspiBlitzApps(AppsBase):
|
||||
async def get_app_status_single(self, app_id):
|
||||
|
||||
if app_id not in available_app_ids:
|
||||
return {
|
||||
"id": f"{app_id}",
|
||||
|
|
@ -126,7 +125,6 @@ class RaspiBlitzApps(AppsBase):
|
|||
async def get_app_status(self):
|
||||
appStatusList: List = []
|
||||
for appID in available_app_ids:
|
||||
|
||||
# skip app based on node running
|
||||
if node_type == "" or node_type == "none":
|
||||
if appID == "rtl":
|
||||
|
|
@ -200,7 +198,6 @@ class RaspiBlitzApps(AppsBase):
|
|||
return jsonable_encoder({"id": app_id})
|
||||
|
||||
async def run_bonus_script(self, app_id: str, params: str):
|
||||
|
||||
# to satisfy CodeQL: test again against predefined array and don't use 'user value'
|
||||
tested_app_id = ""
|
||||
for id in available_app_ids:
|
||||
|
|
@ -275,7 +272,6 @@ class RaspiBlitzApps(AppsBase):
|
|||
)
|
||||
# nothing above consider success
|
||||
else:
|
||||
|
||||
# check if script was effective
|
||||
updatedAppData = await self.get_app_status_single(app_id)
|
||||
|
||||
|
|
|
|||
|
|
@ -327,7 +327,6 @@ class BlockchainInfo(BaseModel):
|
|||
|
||||
@classmethod
|
||||
def from_rpc(cls, r):
|
||||
|
||||
# get softfork information if available
|
||||
softforks = []
|
||||
if "softforks" in r:
|
||||
|
|
|
|||
1
app/external/sse_starlette/sse_starlette.py
vendored
1
app/external/sse_starlette/sse_starlette.py
vendored
|
|
@ -208,7 +208,6 @@ class EventSourceResponse(Response):
|
|||
|
||||
async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
|
||||
async with anyio.create_task_group() as task_group:
|
||||
|
||||
# https://trio.readthedocs.io/en/latest/reference-core.html#custom-supervisors
|
||||
async def wrap(func: Callable[[], Coroutine[None, None, None]]) -> None:
|
||||
await func()
|
||||
|
|
|
|||
|
|
@ -788,7 +788,6 @@ This will show more debug information.
|
|||
|
||||
# get fresh list of peers and their aliases
|
||||
try:
|
||||
|
||||
request = ln.NodeInfoRequest(pub_key=node_pub, include_channels=False)
|
||||
response = await self._lnd_stub.GetNodeInfo(request)
|
||||
return str(response.node.alias)
|
||||
|
|
@ -802,7 +801,6 @@ This will show more debug information.
|
|||
logging.debug(f"LND_GRPC: channel_list()")
|
||||
|
||||
try:
|
||||
|
||||
request = ln.ListChannelsRequest()
|
||||
response = await self._lnd_stub.ListChannels(request)
|
||||
|
||||
|
|
@ -839,7 +837,6 @@ This will show more debug information.
|
|||
raise ValueError("channel_id must contain : for lnd")
|
||||
|
||||
try:
|
||||
|
||||
funding_txid = channel_id.split(":")[0]
|
||||
output_index = channel_id.split(":")[1]
|
||||
|
||||
|
|
|
|||
|
|
@ -1660,7 +1660,6 @@ _sym_db.RegisterMessage(StopResponse)
|
|||
|
||||
_NODE = DESCRIPTOR.services_by_name["Node"]
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
_GETINFOREQUEST._serialized_start = 37
|
||||
_GETINFOREQUEST._serialized_end = 53
|
||||
|
|
|
|||
|
|
@ -158,7 +158,6 @@ RoutehintList = _reflection.GeneratedProtocolMessageType(
|
|||
_sym_db.RegisterMessage(RoutehintList)
|
||||
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
_CHANNELSIDE._serialized_start = 632
|
||||
_CHANNELSIDE._serialized_end = 662
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
|
|||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "lightning_pb2", globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b"Z%github.com/lightningnetwork/lnd/lnrpc"
|
||||
_TRANSACTION.fields_by_name["dest_addresses"]._options = None
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
|
|||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "routerrpc.router_pb2", globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = (
|
||||
b"Z/github.com/lightningnetwork/lnd/lnrpc/routerrpc"
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
|
|||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "signrpc.signer_pb2", globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b"Z-github.com/lightningnetwork/lnd/lnrpc/signrpc"
|
||||
_SHAREDKEYREQUEST.fields_by_name["key_loc"]._options = None
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
|
|||
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
|
||||
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "walletunlocker_pb2", globals())
|
||||
if _descriptor._USE_C_DESCRIPTORS == False:
|
||||
|
||||
DESCRIPTOR._options = None
|
||||
DESCRIPTOR._serialized_options = b"Z%github.com/lightningnetwork/lnd/lnrpc"
|
||||
_GENSEEDREQUEST._serialized_start = 48
|
||||
|
|
|
|||
|
|
@ -390,7 +390,6 @@ class RouteHint(BaseModel):
|
|||
|
||||
|
||||
class Channel(BaseModel):
|
||||
|
||||
channel_id: Optional[str]
|
||||
active: Optional[bool]
|
||||
|
||||
|
|
|
|||
|
|
@ -139,7 +139,6 @@ async def send_payment(
|
|||
async def channel_open(
|
||||
local_funding_amount: int, node_URI: str, target_confs: int
|
||||
) -> str:
|
||||
|
||||
if local_funding_amount < 1:
|
||||
raise ValueError("funding amount needs to be positive")
|
||||
|
||||
|
|
@ -192,7 +191,6 @@ async def register_lightning_listener():
|
|||
"""
|
||||
|
||||
try:
|
||||
|
||||
if ln_node == "none":
|
||||
logger.info(
|
||||
"SKIPPING register_lightning_listener -> no lightning configured"
|
||||
|
|
|
|||
|
|
@ -282,10 +282,8 @@ async def warmup_new_connections():
|
|||
is_ready = api_startup_status.is_fully_initialized()
|
||||
|
||||
if is_ready:
|
||||
|
||||
# when lightning is active
|
||||
if node_type != "" and node_type != "none":
|
||||
|
||||
res = await get_full_client_warmup_data()
|
||||
for id in new_connections:
|
||||
await asyncio.gather(
|
||||
|
|
@ -303,7 +301,6 @@ async def warmup_new_connections():
|
|||
|
||||
# when its bitcoin only
|
||||
else:
|
||||
|
||||
res = await get_full_client_warmup_data_bitcoinonly()
|
||||
for id in new_connections:
|
||||
await asyncio.gather(
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ router = APIRouter(prefix="/setup", tags=["RaspiBlitz Setup"])
|
|||
setupFilePath = "/var/cache/raspiblitz/temp/raspiblitz.setup"
|
||||
configFilePath = "/mnt/hdd/raspiblitz.conf"
|
||||
|
||||
|
||||
# can always be called without credentials to check if
|
||||
# the system needs or is in setup (setupPhase!="done")
|
||||
# for example in the beginning setupPhase can be (see controlSetupDialog.sh)
|
||||
|
|
@ -56,7 +57,6 @@ async def get_status():
|
|||
|
||||
@router.get("/setup-start-info")
|
||||
async def setup_start_info():
|
||||
|
||||
# first check that node is really in setup state
|
||||
setupPhase = await redis_get("setupPhase")
|
||||
state = await redis_get("state")
|
||||
|
|
@ -99,7 +99,6 @@ class StartDoneData(BaseModel):
|
|||
# With all this info the WebUi can run its own runs its dialogs and in the end makes a call to
|
||||
@router.post("/setup-start-done")
|
||||
async def setup_start_done(data: StartDoneData):
|
||||
|
||||
# first check that node is really in setup state
|
||||
setupPhase = await redis_get("setupPhase")
|
||||
state = await redis_get("state")
|
||||
|
|
@ -260,7 +259,6 @@ async def setup_final_info():
|
|||
# When WebUI displayed seed words & user confirmed write the calls:
|
||||
@router.post("/setup-final-done", dependencies=[Depends(JWTBearer())])
|
||||
async def setup_final_done():
|
||||
|
||||
# first check that node is really in setup state
|
||||
setupPhase = await redis_get("setupPhase")
|
||||
state = await redis_get("state")
|
||||
|
|
@ -274,7 +272,6 @@ async def setup_final_done():
|
|||
|
||||
@router.get("/shutdown")
|
||||
async def get_shutdown():
|
||||
|
||||
# only allow unauthorized shutdowns during setup
|
||||
setupPhase = await redis_get("setupPhase")
|
||||
state = await redis_get("state")
|
||||
|
|
@ -293,7 +290,6 @@ async def get_shutdown():
|
|||
# When WebUI displayed seed words & user confirmed write the calls:
|
||||
@router.post("/setup-sync-info", dependencies=[Depends(JWTBearer())])
|
||||
async def setup_sync_info():
|
||||
|
||||
# first check that node is really in setup state
|
||||
setupPhase = await redis_get("setupPhase")
|
||||
if setupPhase != "done":
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ class RaspiBlitzSystem(SystemBase):
|
|||
super().__init__()
|
||||
|
||||
async def get_system_info(self) -> SystemInfo:
|
||||
|
||||
lightning = await redis_get("lightning")
|
||||
if lightning == "" or lightning == "none":
|
||||
data_chain = await redis_get("chain")
|
||||
|
|
@ -111,7 +110,6 @@ class RaspiBlitzSystem(SystemBase):
|
|||
return True
|
||||
|
||||
async def get_connection_info(self) -> ConnectionInfo:
|
||||
|
||||
lightning = await redis_get("lightning")
|
||||
|
||||
# Bitcoin RPC
|
||||
|
|
@ -208,7 +206,6 @@ class RaspiBlitzSystem(SystemBase):
|
|||
)
|
||||
|
||||
async def change_password(self, type: str, old_password: str, new_password: str):
|
||||
|
||||
# check just allowed type values
|
||||
type = type.lower()
|
||||
if not type in ["a", "b", "c"]:
|
||||
|
|
|
|||
|
|
@ -81,7 +81,6 @@ class RawDebugLogData(BaseModel):
|
|||
|
||||
|
||||
class ConnectionInfo(BaseModel):
|
||||
|
||||
lnd_admin_macaroon: str = Query(
|
||||
"", description="lnd macaroon with admin rights in hexstring format"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue