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 -5
View File
@@ -40,11 +40,7 @@ class CoreLightningRestWallet(Wallet):
"invalid corelightning_rest_macaroon provided"
)
url = settings.corelightning_rest_url
self.url = url[:-1] if url.endswith("/") else url
self.url = (
f"https://{self.url}" if not self.url.startswith("http") else self.url
)
self.url = self.normalize_endpoint(settings.corelightning_rest_url)
headers = {
"macaroon": macaroon,
"encodingtype": "hex",