Skip to content

Commit

Permalink
reduce max string length
Browse files Browse the repository at this point in the history
  • Loading branch information
dni committed Apr 17, 2023
1 parent 0af22a6 commit 0b596c0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
max-line-length = 300
max-line-length = 150
exclude = lnbits/wallets/lnd_grpc_files/, lnbits/extensions/
ignore =
# E402: module level import not at top of file
Expand Down
5 changes: 4 additions & 1 deletion lnbits/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,10 @@ def __init__(self):
self.padding = 0
self.minimal_fmt: str = "<green>{time:YYYY-MM-DD HH:mm:ss.SS}</green> | <level>{level}</level> | <level>{message}</level>\n"
if settings.debug:
self.fmt: str = "<green>{time:YYYY-MM-DD HH:mm:ss.SS}</green> | <level>{level: <4}</level> | <cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> | <level>{message}</level>\n"
self.fmt: str = (
"<green>{time:YYYY-MM-DD HH:mm:ss.SS}</green> | <level>{level: <4}</level> | "
"<cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> | <level>{message}</level>\n"
)
else:
self.fmt: str = self.minimal_fmt

Expand Down
3 changes: 2 additions & 1 deletion lnbits/core/migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ async def m004_ensure_fees_are_always_negative(db):

async def m005_balance_check_balance_notify(db):
"""
Keep track of balanceCheck-enabled lnurl-withdrawals to be consumed by an LNbits wallet and of balanceNotify URLs supplied by users to empty their wallets.
Keep track of balanceCheck-enabled lnurl-withdrawals to be consumed by an
LNbits wallet and of balanceNotify URLs supplied by users to empty their wallets.
"""

await db.execute(
Expand Down
3 changes: 2 additions & 1 deletion lnbits/core/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ def int_to_bytes_suitable_der(x: int) -> bytes:

def encode_strict_der(r: int, s: int, order: int):
# if s > order/2 verification will fail sometimes
# so we must fix it here (see https://github.com/indutny/elliptic/blob/e71b2d9359c5fe9437fbf46f1f05096de447de57/lib/elliptic/ec/index.js#L146-L147)
# so we must fix it here see:
# https://github.com/indutny/elliptic/blob/e71b2d9359c5fe9437fbf46f1f05096de447de57/lib/elliptic/ec/index.js#L146-L147
if s > order // 2:
s = order - s

Expand Down
7 changes: 4 additions & 3 deletions lnbits/wallets/void.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ async def create_invoice(
raise Unsupported("")

async def status(self) -> StatusResponse:
logger.warning(
"This backend does nothing, it is here just as a placeholder, you must configure an actual backend before being able to do anything useful with LNbits."
)
logger.warning((
"This backend does nothing, it is here just as a placeholder, you must configure an "
"actual backend before being able to do anything useful with LNbits."
))
return StatusResponse(None, 0)

async def pay_invoice(self, bolt11: str, fee_limit_msat: int) -> PaymentResponse:
Expand Down

0 comments on commit 0b596c0

Please sign in to comment.