feat: Allow multiple networks
This commit is contained in:
parent
52d9d45106
commit
2bb1fbc3a5
12
firesales.py
12
firesales.py
@ -161,7 +161,7 @@ def startListingTransfer(params, authentication):
|
|||||||
|
|
||||||
# node node_modules/shakedex/bin/shakedex transfer-lock domain -n main -w wallet -a key -p ./data --httphost host
|
# node node_modules/shakedex/bin/shakedex transfer-lock domain -n main -w wallet -a key -p ./data --httphost host
|
||||||
process = subprocess.Popen(
|
process = subprocess.Popen(
|
||||||
["node", f"{path}/node_modules/shakedex/bin/shakedex", "transfer-lock", domain, "-n", "main", "-w", wallet, "-a", api_key, "-p", f"{userData}", "--httphost", host, "-P", passphrase],
|
["node", f"{path}/node_modules/shakedex/bin/shakedex", "transfer-lock", domain, "-n", account.HSD_NETWORK, "-w", wallet, "-a", api_key, "-p", f"{userData}", "--httphost", host, "-P", passphrase],
|
||||||
text=True,
|
text=True,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT
|
stderr=subprocess.STDOUT
|
||||||
@ -169,7 +169,9 @@ def startListingTransfer(params, authentication):
|
|||||||
# Wait for the process to finish
|
# Wait for the process to finish
|
||||||
stdout, stderr = process.communicate()
|
stdout, stderr = process.communicate()
|
||||||
print(f"STDOUT: {stdout}")
|
print(f"STDOUT: {stdout}")
|
||||||
print(f"STDERR: {stderr}")
|
|
||||||
|
if stderr is None:
|
||||||
|
stderr = stdout
|
||||||
|
|
||||||
if process.returncode != 0:
|
if process.returncode != 0:
|
||||||
return {"status": f"Error: {stderr}", "txid": None}
|
return {"status": f"Error: {stderr}", "txid": None}
|
||||||
@ -189,7 +191,7 @@ def finalizeListingTransfer(params, authentication):
|
|||||||
host = "127.0.0.1"
|
host = "127.0.0.1"
|
||||||
|
|
||||||
process = subprocess.Popen(
|
process = subprocess.Popen(
|
||||||
["node", f"{path}/node_modules/shakedex/bin/shakedex", "finalize-lock", domain, "-n", "main", "-w", wallet, "-a", api_key, "-p", f"{userData}", "--httphost", host, "-P", passphrase],
|
["node", f"{path}/node_modules/shakedex/bin/shakedex", "finalize-lock", domain, "-n", account.HSD_NETWORK, "-w", wallet, "-a", api_key, "-p", f"{userData}", "--httphost", host, "-P", passphrase],
|
||||||
text=True,
|
text=True,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT
|
stderr=subprocess.STDOUT
|
||||||
@ -197,8 +199,10 @@ def finalizeListingTransfer(params, authentication):
|
|||||||
# Wait for the process to finish
|
# Wait for the process to finish
|
||||||
stdout, stderr = process.communicate()
|
stdout, stderr = process.communicate()
|
||||||
print(f"STDOUT: {stdout}")
|
print(f"STDOUT: {stdout}")
|
||||||
print(f"STDERR: {stderr}")
|
|
||||||
|
|
||||||
|
if stderr is None:
|
||||||
|
stderr = stdout
|
||||||
|
|
||||||
if process.returncode != 0:
|
if process.returncode != 0:
|
||||||
return {"status": f"Error: {stderr}", "txid": None}
|
return {"status": f"Error: {stderr}", "txid": None}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user