introduce Wallet.normalize_endpoint to remove code duplication

This commit is contained in:
Pavol Rusnak
2024-01-22 10:06:22 -06:00
parent 824a8fa7c8
commit 8eabf53642
12 changed files with 25 additions and 27 deletions
+1 -2
View File
@@ -35,8 +35,7 @@ class EclairWallet(Wallet):
if not settings.eclair_pass:
raise ValueError("cannot initialize EclairWallet: missing eclair_pass")
url = settings.eclair_url
self.url = url[:-1] if url.endswith("/") else url
self.url = self.normalize_endpoint(settings.eclair_url)
self.ws_url = f"ws://{urllib.parse.urlsplit(self.url).netloc}/ws"
password = settings.eclair_pass