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 -6
View File
@@ -58,12 +58,7 @@ class LndRestWallet(Wallet):
"This only works if you have a publicly issued certificate."
)
endpoint = settings.lnd_rest_endpoint
endpoint = endpoint[:-1] if endpoint.endswith("/") else endpoint
endpoint = (
f"https://{endpoint}" if not endpoint.startswith("http") else endpoint
)
self.endpoint = endpoint
self.endpoint = self.normalize_endpoint(settings.lnd_rest_endpoint)
# if no cert provided it should be public so we set verify to True
# and it will still check for validity of certificate and fail if its not valid