4 Commits

Author SHA1 Message Date
812fc84d3e feat: Allow zapping txs of a different age
All checks were successful
Tests and Linting / Tests-Linting (3.11) (push) Successful in 31s
Tests and Linting / Tests-Linting (3.10) (push) Successful in 34s
Tests and Linting / Tests-Linting (3.13) (push) Successful in 35s
Build Docker / Build Images (map[dockerfile:Dockerfile.hsd tag_suffix:-hsd target:hsd]) (push) Successful in 42s
Build Docker / Build Images (map[dockerfile:Dockerfile tag_suffix: target:default]) (push) Successful in 45s
2025-09-02 17:58:40 +10:00
6d318a597b feat: Add API info to settings page
This is most useful when using an internal node with a random api key
2025-09-02 17:54:56 +10:00
83bd6b9643 feat: Reword workflow
All checks were successful
Tests and Linting / Tests-Linting (3.11) (push) Successful in 36s
Build Docker / Build Images (map[dockerfile:Dockerfile.hsd tag_suffix:-hsd target:hsd]) (push) Successful in 50s
Build Docker / Build Images (map[dockerfile:Dockerfile tag_suffix: target:default]) (push) Successful in 1m10s
Tests and Linting / Tests-Linting (3.10) (push) Successful in 3m15s
Tests and Linting / Tests-Linting (3.13) (push) Successful in 3m17s
2025-09-02 17:23:13 +10:00
c93b2652f5 Merge pull request 'Add CI workflow to test code with older versions of python' (#6) from feat/ci-testing into main
All checks were successful
Build Docker / Build Images (map[dockerfile:Dockerfile tag_suffix: target:default]) (push) Successful in 3m7s
Test Python Compatibility / Python-Compatibility (3.10) (push) Successful in 4m59s
Test Python Compatibility / Python-Compatibility (3.11) (push) Successful in 4m57s
Test Python Compatibility / Python-Compatibility (3.13) (push) Successful in 1m58s
Build Docker / Build Images (map[dockerfile:Dockerfile.hsd tag_suffix:-hsd target:hsd]) (push) Successful in 7m3s
Reviewed-on: #6
2025-09-02 16:08:35 +10:00
5 changed files with 32 additions and 8 deletions

View File

@@ -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

Binary file not shown.

View File

@@ -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:

22
main.py
View File

@@ -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")
@@ -1221,6 +1229,18 @@ def settings_action(action):
return render_template("message.html", account=account, return render_template("message.html", account=account,
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")

View File

@@ -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&#39;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>