mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-utils.git
synced 2026-08-12 03:31:06 +00:00
80fb0544ed
* fix(pezkuwi): finish the Asset Hub cleanup and guard it against coming back
Three things left half-done, and a check so they stay done.
## Assets that were never created on chain
chains.json and v22/android/chains_minimal.json still declared Pezkuwi Asset Hub
assetIds 1001, 1002 and 1003 as DOT, ETH and BTC. Queried against
wss://asset-hub-rpc.pezkuwichain.io on 2026-08-11, assets.asset() returns None for all
three; only 1 (PEZ) and 1000 (wUSDT) are Live. They were added from a template — the
icons pointed at Nova's own repo — and shown to users, where any transfer would fail.
This is the second removal. The first, on branch fix/remove-nonexistent-asset-hub-assets
(2026-07-09), cleaned 66 files across v10-v22 but never touched these two, and was never
opened as a PR. A third branch, feature/asset-level-balance-test-fixture, went the other
way and added all three to a regression fixture. Both branches sat for a month.
## Assets served from a working branch
252 references under chains/ fetched icons from pending/post-fix-release. Every file
they named is byte-identical on master, main and that branch, so the dependency bought
nothing — and would have broken silently the day the branch was tidied away, which
nearly happened during this cleanup. Repointed to master, the branch the apps read.
## A fixture nothing keeps in step
sync_from_nova.py publishes chains, xcm, icons and config from the overlay, but never
tests/. So tests/pezkuwi_assets_for_testBalance.json and its overlay source are kept
aligned by hand. They agree today; nothing would have said so if they stopped.
Rather than invent a publish step whose conventions I would be guessing at, the drift
is now asserted.
## The check
scripts/check_pezkuwi_integrity.py, wired into the Code Quality job. Four assertions,
one per regression above, each carrying why it exists. Two of the four have already
recurred once, and the Nova sync will keep proposing the first one back — the current
sync branch (f6c3ebb9) reverts the isSufficient declaration, which is why the second
assertion exists.
Mutation-tested: restoring a ghost asset, removing isSufficient, repointing one icon at
a working branch, and nudging the fixture each fail it; reverting each passes.
* fix(overlay): declare sufficiency at the source, not in the generated output
The isSufficient declaration was added to chains/ — which sync_from_nova.py regenerates
from nova-base plus pezkuwi-overlay on every run. So the fix had a shelf life of exactly
one sync, and the sync branch already waiting (sync/nova-base-f6c3ebb9, 2026-08-08)
reverts it: its output carries {"assetId": "1000"} with no sufficiency, because it was
generated from an overlay that does not declare any.
Editing generated files is how this repo keeps losing the same change. The phantom
Asset Hub assets were removed twice and came back twice for the same reason.
Verified rather than assumed: added the field to
pezkuwi-overlay/chains/pezkuwi-chains.json, ran scripts/sync_from_nova.py, and all three
generated files — chains.json, v22/android/chains.json, v22/android/chains_minimal.json
— came out carrying isSufficient: true. git reported no change to any of them, meaning
the sync now produces exactly what the manual edit produced, so the two agree instead of
fighting.
The phantom assets do not return either: the overlay lists only HEZ, PEZ and USDT, so
regeneration drops 1001/1002/1003 by construction rather than by anybody remembering.
157 lines
4.6 KiB
YAML
157 lines
4.6 KiB
YAML
name: Code Quality
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
python-lint:
|
|
name: Python Lint
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Install ruff
|
|
run: pip install ruff
|
|
|
|
- name: Run ruff linter
|
|
run: ruff check scripts/
|
|
continue-on-error: true
|
|
|
|
- name: Run ruff formatter check
|
|
run: ruff format --check scripts/
|
|
continue-on-error: true
|
|
|
|
json-validation:
|
|
name: JSON Validation
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Validate JSON files
|
|
run: |
|
|
ERRORS=0
|
|
echo "Validating chain config JSON files..."
|
|
|
|
for f in chains/v22/android/chains.json chains/v22/chains.json chains/v22/chains_dev.json pezkuwi-overlay/chains/pezkuwi-chains.json; do
|
|
if [ -f "$f" ]; then
|
|
if python3 -m json.tool "$f" > /dev/null 2>&1; then
|
|
echo " $f: valid"
|
|
else
|
|
echo "::error file=$f::Invalid JSON: $f"
|
|
ERRORS=$((ERRORS + 1))
|
|
fi
|
|
fi
|
|
done
|
|
|
|
exit $ERRORS
|
|
|
|
chain-integrity:
|
|
name: Chain Config Integrity
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
# Refuses the regressions this repo has already had: assets declared that do not
|
|
# exist on chain, sufficiency left undeclared, assets served from a working
|
|
# branch, and a published fixture drifting from its source.
|
|
- name: Pezkuwi integrity
|
|
run: python3 scripts/check_pezkuwi_integrity.py
|
|
|
|
- name: Verify Pezkuwi chains are present
|
|
run: |
|
|
CHAINS_FILE="chains/v22/android/chains.json"
|
|
if [ ! -f "$CHAINS_FILE" ]; then
|
|
echo "::error::$CHAINS_FILE not found"
|
|
exit 1
|
|
fi
|
|
|
|
ERRORS=0
|
|
|
|
# Pezkuwi Relay
|
|
if ! python3 -c "import json; chains=json.load(open('$CHAINS_FILE')); assert any(c['chainId'].startswith('1aa94987') for c in chains), 'Missing Pezkuwi Relay'"; then
|
|
echo "::error::Pezkuwi Relay chain missing from $CHAINS_FILE"
|
|
ERRORS=$((ERRORS + 1))
|
|
else
|
|
echo "Pezkuwi Relay: present"
|
|
fi
|
|
|
|
# Pezkuwi Asset Hub
|
|
if ! python3 -c "import json; chains=json.load(open('$CHAINS_FILE')); assert any(c['chainId'].startswith('e7c15092') for c in chains), 'Missing Asset Hub'"; then
|
|
echo "::error::Pezkuwi Asset Hub missing from $CHAINS_FILE"
|
|
ERRORS=$((ERRORS + 1))
|
|
else
|
|
echo "Pezkuwi Asset Hub: present"
|
|
fi
|
|
|
|
# Pezkuwi People
|
|
if ! python3 -c "import json; chains=json.load(open('$CHAINS_FILE')); assert any(c['chainId'].startswith('69a8d025') for c in chains), 'Missing People Chain'"; then
|
|
echo "::error::Pezkuwi People chain missing from $CHAINS_FILE"
|
|
ERRORS=$((ERRORS + 1))
|
|
else
|
|
echo "Pezkuwi People: present"
|
|
fi
|
|
|
|
# Verify Pezkuwi chains are first in array
|
|
FIRST_CHAIN=$(python3 -c "import json; print(json.load(open('$CHAINS_FILE'))[0]['chainId'][:8])")
|
|
if [ "$FIRST_CHAIN" != "1aa94987" ]; then
|
|
echo "::warning::Pezkuwi Relay is not the first chain (found: $FIRST_CHAIN)"
|
|
else
|
|
echo "Pezkuwi Relay is first chain: OK"
|
|
fi
|
|
|
|
exit $ERRORS
|
|
|
|
sync-script-test:
|
|
name: Sync Script Dry Run
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Run sync script
|
|
run: python3 scripts/sync_from_nova.py
|
|
|
|
- name: Verify output was generated
|
|
run: |
|
|
if [ ! -f "chains/v22/android/chains.json" ]; then
|
|
echo "::error::Sync script failed to generate chains/v22/android/chains.json"
|
|
exit 1
|
|
fi
|
|
COUNT=$(python3 -c "import json; print(len(json.load(open('chains/v22/android/chains.json'))))")
|
|
echo "Generated $COUNT chains"
|
|
if [ "$COUNT" -lt 4 ]; then
|
|
echo "::error::Expected at least 4 chains, got $COUNT"
|
|
exit 1
|
|
fi
|