mirror of
https://github.com/pezkuwichain/pezkuwi-api.git
synced 2026-10-20 18:56:29 +00:00
types-known: empty the pezkuwi and zagros upgrade tables
The manual and e2e tables for pezkuwi, dicle and zagros were the Polkadot, Kusama and Westend runtime-upgrade histories copied under new names, keyed by genesis hashes that belong to no Pezkuwi chain. Pezkuwi and Zagros have no runtime history before metadata v14, so they need no pre-v14 upgrade table: both are empty, dicle (never launched) is removed, and the e2e generator targets the live pezkuwi and zagros endpoints. The spec asserts the exported list is empty.
This commit is contained in:
1 parent
b925eca088
commit
748e7d96ca
12 files changed
+30
-16707
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2025 @pezkuwi/types-known authors & contributors
|
||||
// Copyright 2017-2026 @pezkuwi/types-known authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@pezkuwi/dev-test/globals.d.ts" />
|
||||
@@ -14,12 +14,10 @@ import { stringify } from '@pezkuwi/util';
|
||||
import * as allMan from '../manual/index.js';
|
||||
import * as allGen from './index.js';
|
||||
|
||||
const keys = ['dicle', 'pezkuwi'] as const;
|
||||
const keys = ['pezkuwi', 'zagros'] as const;
|
||||
const urls = {
|
||||
'asset-hub-dicle': 'wss://dicle-asset-hub-rpc.pezkuwichain.io',
|
||||
'asset-hub-pezkuwi': 'wss://pezkuwi-asset-hub-rpc.pezkuwichain.io',
|
||||
dicle: 'wss://dicle-rpc.pezkuwichain.io',
|
||||
pezkuwi: 'wss://rpc.pezkuwichain.io'
|
||||
pezkuwi: 'wss://rpc.pezkuwichain.io',
|
||||
zagros: 'wss://zagros-rpc.pezkuwichain.io'
|
||||
};
|
||||
|
||||
for (const chain of keys) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2025 @pezkuwi/types-known authors & contributors
|
||||
// Copyright 2017-2026 @pezkuwi/types-known authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { upgrades as dicle } from './dicle.js';
|
||||
export { upgrades as pezkuwi } from './pezkuwi.js';
|
||||
export { upgrades as zagros } from './zagros.js';
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,41 +1,16 @@
|
||||
// Copyright 2017-2025 @pezkuwi/types-known authors & contributors
|
||||
// Copyright 2017-2026 @pezkuwi/types-known authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/// <reference types="@pezkuwi/dev-test/globals.d.ts" />
|
||||
|
||||
import type { ChainUpgradesExpanded, ChainUpgradesRaw } from './types.js';
|
||||
|
||||
import { stringify, u8aEq } from '@pezkuwi/util';
|
||||
import { stringify } from '@pezkuwi/util';
|
||||
|
||||
import * as allGen from './e2e/index.js';
|
||||
import * as allMan from './manual/index.js';
|
||||
import { upgrades } from './index.js';
|
||||
|
||||
interface TestDef {
|
||||
genesisHash: string;
|
||||
network: string;
|
||||
versions: [number, [number, number]][];
|
||||
}
|
||||
|
||||
const TESTS: TestDef[] = [
|
||||
{
|
||||
genesisHash: '0xd9d3cd7c1e5d890d969b957f4c5b71a111bbeeabc968f1d0d4538c2663f080a7',
|
||||
network: 'dicle',
|
||||
versions: [
|
||||
[0, [214356, 4]],
|
||||
[23, [4207800, 48]]
|
||||
]
|
||||
},
|
||||
{
|
||||
genesisHash: '0x41693961995d879073269a008d0a52832caa3e0ae73869f02127f3d5daa4934c',
|
||||
network: 'pezkuwi',
|
||||
versions: [
|
||||
[0, [0, 0]],
|
||||
[19, [2436698, 26]]
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
function checkOrder (network: string, versions: [number, number, ...unknown[]][]): void {
|
||||
const ooo = versions.filter((curr, index): boolean => {
|
||||
const prev = versions[index - 1];
|
||||
@@ -85,26 +60,10 @@ describe('generated', (): void => {
|
||||
});
|
||||
|
||||
describe('upgrades', (): void => {
|
||||
TESTS.forEach(({ genesisHash, network, versions }): void => {
|
||||
describe(`${network}`, (): void => {
|
||||
const chain = upgrades.find((n) => n.network === network);
|
||||
|
||||
if (!chain) {
|
||||
throw new Error(`Unable to find the entry for ${network}`);
|
||||
}
|
||||
|
||||
it('has a valid genesisHash', (): void => {
|
||||
expect(u8aEq(chain.genesisHash, genesisHash)).toBe(true);
|
||||
});
|
||||
|
||||
versions.forEach(([index, [blockNumber, specVersion]]): void => {
|
||||
it(`has a valid entry at index ${index}`, (): void => {
|
||||
const version = chain.versions[index];
|
||||
|
||||
expect(version.blockNumber.eqn(blockNumber)).toBe(true);
|
||||
expect(version.specVersion.eqn(specVersion)).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
// The tables that stood here for pezkuwi, dicle and zagros were Polkadot's
|
||||
// and Kusama's upgrade histories under placeholder genesis hashes. Until the
|
||||
// e2e generator reads ours from the live chains, none is listed.
|
||||
it('lists no upgrade history that is not one of our chains', (): void => {
|
||||
expect(upgrades).toEqual([]);
|
||||
});
|
||||
});
|
||||
@@ -1,8 +1,7 @@
|
||||
// Copyright 2017-2025 @pezkuwi/types-known authors & contributors
|
||||
// Copyright 2017-2026 @pezkuwi/types-known authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ChainUpgrades } from '@pezkuwi/types/types';
|
||||
import type { HexString } from '@pezkuwi/util/types';
|
||||
import type { ChainUpgradesExpanded } from './types.js';
|
||||
|
||||
import { selectableNetworks } from '@pezkuwi/networks';
|
||||
@@ -10,22 +9,9 @@ import { BN, hexToU8a } from '@pezkuwi/util';
|
||||
|
||||
import * as allKnown from './e2e/index.js';
|
||||
|
||||
// Pezkuwi networks - placeholder genesis hashes until mainnet launch
|
||||
const NET_EXTRA: Record<string, { genesisHash: HexString[] }> = {
|
||||
dicle: {
|
||||
genesisHash: ['0xd9d3cd7c1e5d890d969b957f4c5b71a111bbeeabc968f1d0d4538c2663f080a7']
|
||||
},
|
||||
pezkuwi: {
|
||||
genesisHash: ['0xbb4a61ab0c4b8c12f5eab71d0c86c482e03a275ecdafee678dea712474d33d75']
|
||||
},
|
||||
zagros: {
|
||||
genesisHash: ['0x297f5a4d105b4b28312586ff1915572ffe4ee015ff772b76399ecbff25a22026']
|
||||
}
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
function mapRaw ([network, versions]: [string, ChainUpgradesExpanded]): ChainUpgrades {
|
||||
const chain = selectableNetworks.find((n) => n.network === network) || NET_EXTRA[network];
|
||||
const chain = selectableNetworks.find((n) => n.network === network);
|
||||
|
||||
if (!chain) {
|
||||
throw new Error(`Unable to find info for chain ${network}`);
|
||||
@@ -43,4 +29,9 @@ function mapRaw ([network, versions]: [string, ChainUpgradesExpanded]): ChainUpg
|
||||
}
|
||||
|
||||
// Type overrides for specific spec types & versions as given in runtimeVersion
|
||||
export const upgrades = Object.entries<ChainUpgradesExpanded>(allKnown).map(mapRaw);
|
||||
// Only chains with a known history: the Pezkuwi tables stay empty until the e2e
|
||||
// generator reads them from the live chains (the relaunched mainnet included);
|
||||
// an empty table means the api reads each block's runtime from the chain.
|
||||
export const upgrades = Object.entries<ChainUpgradesExpanded>(allKnown)
|
||||
.filter(([, versions]) => versions.length)
|
||||
.map(mapRaw);
|
||||
@@ -1,27 +0,0 @@
|
||||
// Copyright 2017-2025 @pezkuwi/types-known authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ChainUpgradesRaw } from '../types.js';
|
||||
|
||||
export const upgrades: ChainUpgradesRaw = [
|
||||
[214356, 4], [392764, 7], [409740, 8], [809976, 20], [877581, 24],
|
||||
[879238, 25], [889472, 26], [902937, 27], [932751, 28], [991142, 29],
|
||||
[1030162, 31], [1119657, 32], [1199282, 33], [1342534, 34], [1392263, 35],
|
||||
[1431703, 36], [1433369, 37], [1490972, 41], [2087397, 43], [2316688, 44],
|
||||
[2549864, 45], [3925782, 46], [3925843, 47], [4207800, 48], [4627944, 49],
|
||||
[5124076, 50], [5478664, 900], [5482450, 9000], [5584305, 9010], [5784566, 9030],
|
||||
[5879822, 9031], [5896856, 9032], [5897316, 9033], [6117927, 9050], [6210274, 9070],
|
||||
[6379314, 9080], [6979141, 9090], [7568453, 9100], [7766394, 9111], [7911691, 9120],
|
||||
[7968866, 9121], [7982889, 9122], [8514322, 9130], [9091726, 9140], [9091774, 9150],
|
||||
[9406726, 9160], [9921066, 9170], [10007115, 9180], [10480973, 9190], [10578091, 9200],
|
||||
[10678509, 9210], [10811001, 9220], [11096116, 9230], [11409279, 9250], [11584820, 9251],
|
||||
[11716837, 9260], [11876919, 9261], [11987927, 9270], [12077324, 9271], [12301871, 9280],
|
||||
[12604343, 9290], [12841034, 9300], [13128237, 9310], [13272363, 9320], [13483497, 9330],
|
||||
[13649433, 9340], [13761100, 9350], [13847400, 9360], [14249200, 9370], [14576855, 9380],
|
||||
[14849830, 9390], [15146832, 9400], [15332317, 9401], [15661793, 9420], [16165469, 9430],
|
||||
[18293984, 102000], [18293991, 103000], [18451783, 104000], [18679741, 1005000], [19166695, 1006000],
|
||||
[19234157, 1006001], [19542944, 1007000], [19621258, 1007001], [19761406, 1008000], [20056997, 1009000],
|
||||
[20368318, 1010000], [20649086, 1011000], [21217837, 1011001], [21300429, 1013000], [21460051, 1014000],
|
||||
[21925427, 1015000], [22500517, 1016000], [22759684, 1016001], [23056976, 1016002], [23544582, 1017000],
|
||||
[24002343, 1017001]
|
||||
];
|
||||
@@ -1,6 +1,5 @@
|
||||
// Copyright 2017-2025 @pezkuwi/types-known authors & contributors
|
||||
// Copyright 2017-2026 @pezkuwi/types-known authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { upgrades as dicle } from './dicle.js';
|
||||
export { upgrades as pezkuwi } from './pezkuwi.js';
|
||||
export { upgrades as zagros } from './zagros.js';
|
||||
@@ -1,19 +1,6 @@
|
||||
// Copyright 2017-2025 @pezkuwi/types-known authors & contributors
|
||||
// Copyright 2017-2026 @pezkuwi/types-known authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ChainUpgradesRaw } from '../types.js';
|
||||
|
||||
export const upgrades: ChainUpgradesRaw = [
|
||||
[0, 0], [29231, 1], [188836, 5], [199405, 6], [214264, 7],
|
||||
[244358, 8], [303079, 9], [314201, 10], [342400, 11], [443963, 12],
|
||||
[528470, 13], [687751, 14], [746085, 15], [787923, 16], [799302, 17],
|
||||
[1205128, 18], [1603423, 23], [1733218, 24], [2005673, 25], [2436698, 26],
|
||||
[3613564, 27], [3899547, 28], [4345767, 29], [4876134, 30], [5661442, 9050],
|
||||
[6321619, 9080], [6713249, 9090], [7217907, 9100], [7229126, 9110], [7560558, 9122],
|
||||
[8115869, 9140], [8638103, 9151], [9280179, 9170], [9738717, 9180], [10156856, 9190],
|
||||
[10458576, 9200], [10655116, 9220], [10879371, 9230], [11328884, 9250], [11532856, 9260],
|
||||
[11933818, 9270], [12217535, 9280], [12245277, 9281], [12532644, 9291], [12876189, 9300],
|
||||
[13800015, 9340], [14188833, 9360], [14543918, 9370], [15978362, 9420], [16450000, 9430],
|
||||
[17840000, 9431], [18407475, 1000001], [19551000, 1001002], [20181758, 1001003],
|
||||
[20438530, 1002000], [21169168, 1002004], [21455374, 1002005], [21558004, 1002006], [21800141, 1002007]
|
||||
];
|
||||
export const upgrades: ChainUpgradesRaw = [];
|
||||
@@ -1,27 +1,6 @@
|
||||
// Copyright 2017-2025 @pezkuwi/types-known authors & contributors
|
||||
// Copyright 2017-2026 @pezkuwi/types-known authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ChainUpgradesRaw } from '../types.js';
|
||||
|
||||
export const upgrades: ChainUpgradesRaw = [
|
||||
[214356, 4], [392764, 7], [409740, 8], [809976, 20], [877581, 24],
|
||||
[879238, 25], [889472, 26], [902937, 27], [932751, 28], [991142, 29],
|
||||
[1030162, 31], [1119657, 32], [1199282, 33], [1342534, 34], [1392263, 35],
|
||||
[1431703, 36], [1433369, 37], [1490972, 41], [2087397, 43], [2316688, 44],
|
||||
[2549864, 45], [3925782, 46], [3925843, 47], [4207800, 48], [4627944, 49],
|
||||
[5124076, 50], [5478664, 900], [5482450, 9000], [5584305, 9010], [5784566, 9030],
|
||||
[5879822, 9031], [5896856, 9032], [5897316, 9033], [6117927, 9050], [6210274, 9070],
|
||||
[6379314, 9080], [6979141, 9090], [7568453, 9100], [7766394, 9111], [7911691, 9120],
|
||||
[7968866, 9121], [7982889, 9122], [8514322, 9130], [9091726, 9140], [9091774, 9150],
|
||||
[9406726, 9160], [9921066, 9170], [10007115, 9180], [10480973, 9190], [10578091, 9200],
|
||||
[10678509, 9210], [10811001, 9220], [11096116, 9230], [11409279, 9250], [11584820, 9251],
|
||||
[11716837, 9260], [11876919, 9261], [11987927, 9270], [12077324, 9271], [12301871, 9280],
|
||||
[12604343, 9290], [12841034, 9300], [13128237, 9310], [13272363, 9320], [13483497, 9330],
|
||||
[13649433, 9340], [13761100, 9350], [13847400, 9360], [14249200, 9370], [14576855, 9380],
|
||||
[14849830, 9390], [15146832, 9400], [15332317, 9401], [15661793, 9420], [16165469, 9430],
|
||||
[18293984, 102000], [18293991, 103000], [18451783, 104000], [18679741, 1005000], [19166695, 1006000],
|
||||
[19234157, 1006001], [19542944, 1007000], [19621258, 1007001], [19761406, 1008000], [20056997, 1009000],
|
||||
[20368318, 1010000], [20649086, 1011000], [21217837, 1011001], [21300429, 1013000], [21460051, 1014000],
|
||||
[21925427, 1015000], [22500517, 1016000], [22759684, 1016001], [23056976, 1016002], [23544582, 1017000],
|
||||
[24002343, 1017001]
|
||||
];
|
||||
export const upgrades: ChainUpgradesRaw = [];
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2025 @pezkuwi/types-known authors & contributors
|
||||
// Copyright 2017-2026 @pezkuwi/types-known authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@pezkuwi/util/types';
|
||||
|
||||
Reference in new issue
Block a user