mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-utils.git
synced 2026-10-20 18:56:26 +00:00
test: add per-asset balance fixture covering full Pezkuwi ecosystem (#43)
chains_for_testBalance.json only has one entry per chain (native balance via a raw RPC query, bypassing the app's real sync pipeline entirely - this is why it couldn't catch the 2026-07-09 HEZ-on-Asset-Hub silent sync failure). This new fixture covers individual assets (HEZ/PEZ/USDT/ DOT/ETH/BTC across Pezkuwi's 3 chains) and is meant to drive a test that goes through the real BalancesUpdateSystem -> AssetCache pipeline, which is what actually caught that bug.
This commit is contained in:
1 parent
b54c168719
commit
dab727c43d
3 files changed
+119
No files matched your search
@@ -0,0 +1,55 @@
|
|||||||
|
{
|
||||||
|
"description": "Per-asset fixture for exercising the REAL BalancesUpdateSystem -> AssetCache/AssetDao pipeline (not a raw low-level RPC query like chains_for_testBalance.json/BalancesIntegrationTest uses). Each entry asserts an `assets` DB row eventually gets written for that (chainId, assetId) pair for the mainnet Founder account - this is what actually caught the 2026-07-09 HEZ-on-Asset-Hub silent sync failure, which chains_for_testBalance.json's raw-query test could NOT have caught since it bypasses BalancesUpdateSystem entirely. The assertion is 'a row exists', not 'balance is non-zero' - a written zero-balance row is still valid proof the sync pipeline completed for that asset.",
|
||||||
|
"last_updated": "2026-07-09",
|
||||||
|
"account": "5CyuFfbF95rzBxru7c9yEsX4XmQXUxpLUcbj9RLg9K1cGiiF",
|
||||||
|
"assets": [
|
||||||
|
{
|
||||||
|
"chainId": "1aa94987791a5544e9667ec249d2cef1b8fdd6083c85b93fc37892d54a1156ca",
|
||||||
|
"chainName": "Pezkuwi",
|
||||||
|
"assetId": 0,
|
||||||
|
"symbol": "HEZ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"chainId": "e7c15092dcbe3f320260ddbbc685bfceed9125a3b3d8436db2766201dec3b949",
|
||||||
|
"chainName": "Pezkuwi Asset Hub",
|
||||||
|
"assetId": 0,
|
||||||
|
"symbol": "HEZ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"chainId": "e7c15092dcbe3f320260ddbbc685bfceed9125a3b3d8436db2766201dec3b949",
|
||||||
|
"chainName": "Pezkuwi Asset Hub",
|
||||||
|
"assetId": 1,
|
||||||
|
"symbol": "PEZ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"chainId": "e7c15092dcbe3f320260ddbbc685bfceed9125a3b3d8436db2766201dec3b949",
|
||||||
|
"chainName": "Pezkuwi Asset Hub",
|
||||||
|
"assetId": 1000,
|
||||||
|
"symbol": "USDT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"chainId": "e7c15092dcbe3f320260ddbbc685bfceed9125a3b3d8436db2766201dec3b949",
|
||||||
|
"chainName": "Pezkuwi Asset Hub",
|
||||||
|
"assetId": 1001,
|
||||||
|
"symbol": "DOT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"chainId": "e7c15092dcbe3f320260ddbbc685bfceed9125a3b3d8436db2766201dec3b949",
|
||||||
|
"chainName": "Pezkuwi Asset Hub",
|
||||||
|
"assetId": 1002,
|
||||||
|
"symbol": "ETH"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"chainId": "e7c15092dcbe3f320260ddbbc685bfceed9125a3b3d8436db2766201dec3b949",
|
||||||
|
"chainName": "Pezkuwi Asset Hub",
|
||||||
|
"assetId": 1003,
|
||||||
|
"symbol": "BTC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"chainId": "69a8d025ab7b63363935d7d9397e0f652826c94271c1bc55c4fdfe72cccf1cfa",
|
||||||
|
"chainName": "Pezkuwi People",
|
||||||
|
"assetId": 0,
|
||||||
|
"symbol": "HEZ"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -349,6 +349,15 @@ def sync_tests():
|
|||||||
save_json(OUTPUT_TESTS / "chains_for_testBalance.json", filtered)
|
save_json(OUTPUT_TESTS / "chains_for_testBalance.json", filtered)
|
||||||
print(f" chains_for_testBalance.json: {len(fixture)} - {dropped} not in {latest_version.name} + {added} Pezkuwi = {len(filtered)}")
|
print(f" chains_for_testBalance.json: {len(fixture)} - {dropped} not in {latest_version.name} + {added} Pezkuwi = {len(filtered)}")
|
||||||
|
|
||||||
|
# Per-asset fixture (pezkuwi_assets_for_testBalance.json) - unlike chains_for_testBalance.json above,
|
||||||
|
# this drives a test that goes through the REAL BalancesUpdateSystem/AssetCache pipeline rather than a
|
||||||
|
# raw RPC query, and covers individual assets (HEZ/PEZ/USDT/DOT/ETH/BTC) rather than just one native
|
||||||
|
# balance per chain. It's Pezkuwi's own curated list, published as-is - no Nova fixture to filter against.
|
||||||
|
pezkuwi_assets_file = PEZKUWI_OVERLAY / "tests" / "pezkuwi_assets_for_testBalance.json"
|
||||||
|
if pezkuwi_assets_file.exists():
|
||||||
|
save_json(OUTPUT_TESTS / "pezkuwi_assets_for_testBalance.json", load_json(pezkuwi_assets_file))
|
||||||
|
print(f" pezkuwi_assets_for_testBalance.json: {len(load_json(pezkuwi_assets_file)['assets'])} asset(s)")
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
print("=" * 60)
|
print("=" * 60)
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
{
|
||||||
|
"description": "Per-asset fixture for exercising the REAL BalancesUpdateSystem -> AssetCache/AssetDao pipeline (not a raw low-level RPC query like chains_for_testBalance.json/BalancesIntegrationTest uses). Each entry asserts an `assets` DB row eventually gets written for that (chainId, assetId) pair for the mainnet Founder account - this is what actually caught the 2026-07-09 HEZ-on-Asset-Hub silent sync failure, which chains_for_testBalance.json's raw-query test could NOT have caught since it bypasses BalancesUpdateSystem entirely. The assertion is 'a row exists', not 'balance is non-zero' - a written zero-balance row is still valid proof the sync pipeline completed for that asset.",
|
||||||
|
"last_updated": "2026-07-09",
|
||||||
|
"account": "5CyuFfbF95rzBxru7c9yEsX4XmQXUxpLUcbj9RLg9K1cGiiF",
|
||||||
|
"assets": [
|
||||||
|
{
|
||||||
|
"chainId": "1aa94987791a5544e9667ec249d2cef1b8fdd6083c85b93fc37892d54a1156ca",
|
||||||
|
"chainName": "Pezkuwi",
|
||||||
|
"assetId": 0,
|
||||||
|
"symbol": "HEZ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"chainId": "e7c15092dcbe3f320260ddbbc685bfceed9125a3b3d8436db2766201dec3b949",
|
||||||
|
"chainName": "Pezkuwi Asset Hub",
|
||||||
|
"assetId": 0,
|
||||||
|
"symbol": "HEZ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"chainId": "e7c15092dcbe3f320260ddbbc685bfceed9125a3b3d8436db2766201dec3b949",
|
||||||
|
"chainName": "Pezkuwi Asset Hub",
|
||||||
|
"assetId": 1,
|
||||||
|
"symbol": "PEZ"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"chainId": "e7c15092dcbe3f320260ddbbc685bfceed9125a3b3d8436db2766201dec3b949",
|
||||||
|
"chainName": "Pezkuwi Asset Hub",
|
||||||
|
"assetId": 1000,
|
||||||
|
"symbol": "USDT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"chainId": "e7c15092dcbe3f320260ddbbc685bfceed9125a3b3d8436db2766201dec3b949",
|
||||||
|
"chainName": "Pezkuwi Asset Hub",
|
||||||
|
"assetId": 1001,
|
||||||
|
"symbol": "DOT"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"chainId": "e7c15092dcbe3f320260ddbbc685bfceed9125a3b3d8436db2766201dec3b949",
|
||||||
|
"chainName": "Pezkuwi Asset Hub",
|
||||||
|
"assetId": 1002,
|
||||||
|
"symbol": "ETH"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"chainId": "e7c15092dcbe3f320260ddbbc685bfceed9125a3b3d8436db2766201dec3b949",
|
||||||
|
"chainName": "Pezkuwi Asset Hub",
|
||||||
|
"assetId": 1003,
|
||||||
|
"symbol": "BTC"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"chainId": "69a8d025ab7b63363935d7d9397e0f652826c94271c1bc55c4fdfe72cccf1cfa",
|
||||||
|
"chainName": "Pezkuwi People",
|
||||||
|
"assetId": 0,
|
||||||
|
"symbol": "HEZ"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in new issue
Block a user