mypy fixes.

This commit is contained in:
fiatjaf
2020-10-13 14:46:23 -03:00
parent cf0bd7ece8
commit bcdc065cc0
6 changed files with 13 additions and 16 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ class PaymentStatus(NamedTuple):
class Wallet(ABC):
@abstractmethod
def status() -> StatusResponse:
def status(self) -> StatusResponse:
pass
@abstractmethod
+1 -1
View File
@@ -23,7 +23,7 @@ class LNPayWallet(Wallet):
try:
r = httpx.get(url, headers=self.auth)
except (httpx.ConnectError, httpx.RequestError):
return StatusResponse(f"Unable to connect to '{url}'")
return StatusResponse(f"Unable to connect to '{url}'", 0)
if r.is_error:
return StatusResponse(r.text[:250], 0)
+1 -1
View File
@@ -24,7 +24,7 @@ class OpenNodeWallet(Wallet):
try:
r = httpx.get(f"{self.endpoint}/v1/account/balance", headers=self.auth)
except (httpx.ConnectError, httpx.RequestError):
return StatusResponse(f"Unable to connect to '{self.endpoint}'")
return StatusResponse(f"Unable to connect to '{self.endpoint}'", 0)
data = r.json()["message"]
if r.is_error: