Compare commits
4 Commits
feat/ci-te
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
812fc84d3e
|
|||
|
6d318a597b
|
|||
|
83bd6b9643
|
|||
|
c93b2652f5
|
@@ -1,10 +1,10 @@
|
||||
name: Test Python Compatibility
|
||||
run-name: Test Python Compatibility
|
||||
name: Tests and Linting
|
||||
run-name: Python Compatibility and Linting tests
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
Python-Compatibility:
|
||||
Tests-Linting:
|
||||
runs-on: [ubuntu-latest, amd]
|
||||
container: catthehacker/ubuntu:act-latest
|
||||
strategy:
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
fi
|
||||
pip install pytest ruff
|
||||
|
||||
- name: Run tests
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
echo "Testing with Python ${{ matrix.python-version }}"
|
||||
python -m pytest main.py
|
||||
|
||||
Binary file not shown.
@@ -1582,9 +1582,7 @@ def resendTXs():
|
||||
}
|
||||
|
||||
|
||||
def zapTXs(account):
|
||||
age = 60 * 20 # 20 minutes
|
||||
|
||||
def zapTXs(account, age=1200):
|
||||
account_name = check_account(account)
|
||||
|
||||
if not account_name:
|
||||
|
||||
22
main.py
22
main.py
@@ -1200,7 +1200,15 @@ def settings_action(action):
|
||||
|
||||
|
||||
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:
|
||||
return redirect("/settings?error=" + str(resp['error']))
|
||||
return redirect("/settings?success=Zapped transactions")
|
||||
@@ -1221,6 +1229,18 @@ def settings_action(action):
|
||||
return render_template("message.html", account=account,
|
||||
title="Restarting",
|
||||
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")
|
||||
|
||||
|
||||
@@ -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>
|
||||
</div>
|
||||
</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 %}
|
||||
<li class="list-group-item">
|
||||
<div><a class="btn btn-primary stick-right" role="button" href="/settings/restart">Restart Node</a>
|
||||
|
||||
Reference in New Issue
Block a user