Compare commits
5 Commits
feat/ci-te
...
e537c323c2
| Author | SHA1 | Date | |
|---|---|---|---|
|
e537c323c2
|
|||
|
812fc84d3e
|
|||
|
6d318a597b
|
|||
|
83bd6b9643
|
|||
|
c93b2652f5
|
@@ -1,10 +1,10 @@
|
|||||||
name: Test Python Compatibility
|
name: Tests and Linting
|
||||||
run-name: Test Python Compatibility
|
run-name: Python Compatibility and Linting tests
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Python-Compatibility:
|
Tests-Linting:
|
||||||
runs-on: [ubuntu-latest, amd]
|
runs-on: [ubuntu-latest, amd]
|
||||||
container: catthehacker/ubuntu:act-latest
|
container: catthehacker/ubuntu:act-latest
|
||||||
strategy:
|
strategy:
|
||||||
@@ -29,7 +29,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
pip install pytest ruff
|
pip install pytest ruff
|
||||||
|
|
||||||
- name: Run tests
|
- name: Test with pytest
|
||||||
run: |
|
run: |
|
||||||
echo "Testing with Python ${{ matrix.python-version }}"
|
echo "Testing with Python ${{ matrix.python-version }}"
|
||||||
python -m pytest main.py
|
python -m pytest main.py
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -17,6 +17,6 @@ cache/
|
|||||||
build/
|
build/
|
||||||
dist/
|
dist/
|
||||||
hsd/
|
hsd/
|
||||||
hsd-data/
|
hsd_data/
|
||||||
hsd.lock
|
hsd.lock
|
||||||
hsdconfig.json
|
hsdconfig.json
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ LABEL org.opencontainers.image.title="FireWallet (HSD)" \
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
VOLUME ["/app/hsd-data", "/app/user_data"]
|
VOLUME ["/app/hsd_data", "/app/user_data"]
|
||||||
|
|
||||||
|
|
||||||
ENTRYPOINT ["python3"]
|
ENTRYPOINT ["python3"]
|
||||||
|
|||||||
Binary file not shown.
@@ -1582,9 +1582,7 @@ def resendTXs():
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def zapTXs(account):
|
def zapTXs(account, age=1200):
|
||||||
age = 60 * 20 # 20 minutes
|
|
||||||
|
|
||||||
account_name = check_account(account)
|
account_name = check_account(account)
|
||||||
|
|
||||||
if not account_name:
|
if not account_name:
|
||||||
@@ -1902,7 +1900,7 @@ def hsdStart():
|
|||||||
chain_migrate = HSD_CONFIG.get("chainMigrate", False)
|
chain_migrate = HSD_CONFIG.get("chainMigrate", False)
|
||||||
wallet_migrate = HSD_CONFIG.get("walletMigrate", False)
|
wallet_migrate = HSD_CONFIG.get("walletMigrate", False)
|
||||||
spv = HSD_CONFIG.get("spv", False)
|
spv = HSD_CONFIG.get("spv", False)
|
||||||
prefix = HSD_CONFIG.get("prefix", os.path.join(os.getcwd(), "hsd-data"))
|
prefix = HSD_CONFIG.get("prefix", os.path.join(os.getcwd(), "hsd_data"))
|
||||||
|
|
||||||
|
|
||||||
# Base command
|
# Base command
|
||||||
@@ -1978,7 +1976,6 @@ def hsdRestart():
|
|||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
hsdStart()
|
hsdStart()
|
||||||
|
|
||||||
|
|
||||||
hsdInit()
|
hsdInit()
|
||||||
hsdStart()
|
hsdStart()
|
||||||
# endregion
|
# endregion
|
||||||
@@ -4,10 +4,8 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "5000:5000"
|
- "5000:5000"
|
||||||
volumes:
|
volumes:
|
||||||
- hsd_data:/app/hsd-data
|
- hsd_data:/app/hsd_data
|
||||||
- user_data:/app/user_data
|
- user_data:/app/user_data
|
||||||
environment:
|
|
||||||
- INTERNAL_HSD=true
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
hsd_data:
|
hsd_data:
|
||||||
|
|||||||
22
main.py
22
main.py
@@ -1200,7 +1200,15 @@ def settings_action(action):
|
|||||||
|
|
||||||
|
|
||||||
if action == "zap":
|
if action == "zap":
|
||||||
resp = account_module.zapTXs(request.cookies.get("account"))
|
age = request.args.get("age", 1200)
|
||||||
|
try:
|
||||||
|
age = int(age)
|
||||||
|
except ValueError:
|
||||||
|
age = 1200
|
||||||
|
if age < 0:
|
||||||
|
age = 1200
|
||||||
|
|
||||||
|
resp = account_module.zapTXs(request.cookies.get("account"),age)
|
||||||
if type(resp) is dict and 'error' in resp:
|
if type(resp) is dict and 'error' in resp:
|
||||||
return redirect("/settings?error=" + str(resp['error']))
|
return redirect("/settings?error=" + str(resp['error']))
|
||||||
return redirect("/settings?success=Zapped transactions")
|
return redirect("/settings?success=Zapped transactions")
|
||||||
@@ -1222,6 +1230,18 @@ def settings_action(action):
|
|||||||
title="Restarting",
|
title="Restarting",
|
||||||
content="The node is restarting. This may take a minute or two. You can close this window.")
|
content="The node is restarting. This may take a minute or two. You can close this window.")
|
||||||
|
|
||||||
|
if action == "api-info":
|
||||||
|
content = f"API URL: <code>http://{account_module.HSD_IP}:{account_module.HSD_NODE_PORT}</code><br>"
|
||||||
|
content += f"Wallet URL: <code>http://{account_module.HSD_IP}:{account_module.HSD_WALLET_PORT}</code><br>"
|
||||||
|
content += f"API Key: <code>{account_module.HSD_API}</code><br><br>"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return render_template("message.html", account=account,
|
||||||
|
title="API Information",
|
||||||
|
content=content)
|
||||||
|
|
||||||
|
|
||||||
return redirect("/settings?error=Invalid action")
|
return redirect("/settings?error=Invalid action")
|
||||||
|
|
||||||
@app.route('/settings/upload', methods=['POST'])
|
@app.route('/settings/upload', methods=['POST'])
|
||||||
|
|||||||
@@ -85,6 +85,12 @@
|
|||||||
<h3>Delete unconfirmed transactions</h3><span>This will only remove pending tx from the wallet older than 20 minutes (~ 2 blocks)</span>
|
<h3>Delete unconfirmed transactions</h3><span>This will only remove pending tx from the wallet older than 20 minutes (~ 2 blocks)</span>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<div><a class="btn btn-primary stick-right" role="button" href="/settings/api-info">API Info</a>
|
||||||
|
<h3>View API Information</h3><span>View information about the connected HSD node's API</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
{% if internal %}
|
{% if internal %}
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<div><a class="btn btn-primary stick-right" role="button" href="/settings/restart">Restart Node</a>
|
<div><a class="btn btn-primary stick-right" role="button" href="/settings/restart">Restart Node</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user