From 52e248dfb368f7b63b6d3ef9fa7e828934417eda Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Wed, 29 Jan 2025 12:50:15 +1100 Subject: [PATCH] fix: Paths and fix xpub check --- hns-address.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hns-address.py b/hns-address.py index 81a3bc1..0834893 100644 --- a/hns-address.py +++ b/hns-address.py @@ -70,7 +70,7 @@ functions = { def initialize(): # Check if hns-address is installed - if not os.path.exists("hns-address"): + if not os.path.exists(hnsAddressPath): # Try to install hns-address try: print("Cloning hns-address...") @@ -81,7 +81,7 @@ def initialize(): return -1 # Check if npm install was successful - if not os.path.exists("hns-address/node_modules"): + if not os.path.exists(f"{hnsAddressPath}/node_modules"): try: print("Installing hns-address dependencies...") result = subprocess.run(["npm", "install"], cwd=hnsAddressPath, capture_output=True, text=True) @@ -107,7 +107,7 @@ def generate(params, authentication): if (startIndex == None): startIndex = 0 - if (xpub == None): + if (xpub == ""): xpub = account.getxPub(authentication) if (xpub == None): return {"result": "No xpub found"} @@ -126,9 +126,8 @@ def validate(params, authentication): xpub = params["xpub"] address = params["address"] - if (xpub == None): + if (xpub == ""): xpub = account.getxPub(authentication) - print(f"xpub: {xpub}") if (xpub == None): return {"result": "No xpub found"}