fix: Paths and fix xpub check
This commit is contained in:
parent
8abcf48ee3
commit
52e248dfb3
@ -70,7 +70,7 @@ functions = {
|
|||||||
|
|
||||||
def initialize():
|
def initialize():
|
||||||
# Check if hns-address is installed
|
# 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 to install hns-address
|
||||||
try:
|
try:
|
||||||
print("Cloning hns-address...")
|
print("Cloning hns-address...")
|
||||||
@ -81,7 +81,7 @@ def initialize():
|
|||||||
return -1
|
return -1
|
||||||
|
|
||||||
# Check if npm install was successful
|
# 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:
|
try:
|
||||||
print("Installing hns-address dependencies...")
|
print("Installing hns-address dependencies...")
|
||||||
result = subprocess.run(["npm", "install"], cwd=hnsAddressPath, capture_output=True, text=True)
|
result = subprocess.run(["npm", "install"], cwd=hnsAddressPath, capture_output=True, text=True)
|
||||||
@ -107,7 +107,7 @@ def generate(params, authentication):
|
|||||||
if (startIndex == None):
|
if (startIndex == None):
|
||||||
startIndex = 0
|
startIndex = 0
|
||||||
|
|
||||||
if (xpub == None):
|
if (xpub == ""):
|
||||||
xpub = account.getxPub(authentication)
|
xpub = account.getxPub(authentication)
|
||||||
if (xpub == None):
|
if (xpub == None):
|
||||||
return {"result": "No xpub found"}
|
return {"result": "No xpub found"}
|
||||||
@ -126,9 +126,8 @@ def validate(params, authentication):
|
|||||||
xpub = params["xpub"]
|
xpub = params["xpub"]
|
||||||
address = params["address"]
|
address = params["address"]
|
||||||
|
|
||||||
if (xpub == None):
|
if (xpub == ""):
|
||||||
xpub = account.getxPub(authentication)
|
xpub = account.getxPub(authentication)
|
||||||
print(f"xpub: {xpub}")
|
|
||||||
if (xpub == None):
|
if (xpub == None):
|
||||||
return {"result": "No xpub found"}
|
return {"result": "No xpub found"}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user