chode: lint
This commit is contained in:
@@ -93,11 +93,17 @@ class LightsparkSparkWallet(Wallet):
|
|||||||
if "error" in error_json:
|
if "error" in error_json:
|
||||||
error_message = error_json["error"]
|
error_message = error_json["error"]
|
||||||
except Exception as json_exc:
|
except Exception as json_exc:
|
||||||
logger.error(f"Failed to parse Spark error response as JSON: {json_exc}")
|
logger.error(
|
||||||
raise SparkSidecarError(error_message or f"Spark sidecar request error: '{exc}'") from exc
|
f"Failed to parse Spark error response as JSON: {json_exc}"
|
||||||
|
)
|
||||||
|
raise SparkSidecarError(
|
||||||
|
error_message or f"Spark sidecar request error: '{exc}'"
|
||||||
|
) from exc
|
||||||
|
|
||||||
if error_message or j.get("error"):
|
if error_message or j.get("error"):
|
||||||
raise SparkSidecarError(error_message or f"Spark sidecar error: {j['error']}")
|
raise SparkSidecarError(
|
||||||
|
error_message or f"Spark sidecar error: {j['error']}"
|
||||||
|
)
|
||||||
return j
|
return j
|
||||||
|
|
||||||
async def status(self) -> StatusResponse:
|
async def status(self) -> StatusResponse:
|
||||||
@@ -158,7 +164,7 @@ class LightsparkSparkWallet(Wallet):
|
|||||||
async def pay_invoice(self, bolt11: str, fee_limit_msat: int) -> PaymentResponse:
|
async def pay_invoice(self, bolt11: str, fee_limit_msat: int) -> PaymentResponse:
|
||||||
try:
|
try:
|
||||||
max_fee_sats = (int(fee_limit_msat) + 999) // 1000
|
max_fee_sats = (int(fee_limit_msat) + 999) // 1000
|
||||||
|
|
||||||
payment_hash = None
|
payment_hash = None
|
||||||
try:
|
try:
|
||||||
payment_hash = bolt11_decode(bolt11).payment_hash
|
payment_hash = bolt11_decode(bolt11).payment_hash
|
||||||
|
|||||||
Reference in New Issue
Block a user