+1
-2
@@ -26,7 +26,6 @@
|
||||
"clean": "polkadot-dev-clean-build",
|
||||
"deno": "yarn polkadot-dev-deno-map && yarn build && deno check --import-map=import_map.json mod.ts",
|
||||
"lint": "polkadot-dev-run-lint",
|
||||
"networks:crosscheck": "polkadot-dev-run-test packages/networks/src/crosscheck",
|
||||
"postinstall": "polkadot-dev-yarn-only",
|
||||
"test": "NODE_OPTIONS=--experimental-vm-modules polkadot-dev-run-test --coverage --runInBand --testPathIgnorePatterns crosscheck --testPathIgnorePatterns toMiniSecretCmp",
|
||||
"test:mnemonicCmp": "polkadot-dev-run-test packages/util-crypto/src/mnemonic/toMiniSecretCmp.spec.ts",
|
||||
@@ -34,7 +33,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.18.6",
|
||||
"@polkadot/dev": "^0.67.80",
|
||||
"@polkadot/dev": "^0.67.81",
|
||||
"@types/jest": "^28.1.6"
|
||||
},
|
||||
"resolutions": {
|
||||
|
||||
@@ -22,10 +22,9 @@
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.18.6",
|
||||
"@polkadot/util": "10.0.3-5-x",
|
||||
"@substrate/ss58-registry": "^1.23.0"
|
||||
"@substrate/ss58-registry": "^1.24.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/hw-ledger": "10.0.3-5-x",
|
||||
"@polkadot/x-fetch": "10.0.3-5-x"
|
||||
"@polkadot/hw-ledger": "10.0.3-5-x"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
// Copyright 2017-2022 @polkadot/networks authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Ss58Registry } from './types';
|
||||
|
||||
import fs from 'fs';
|
||||
|
||||
import { objectKeys, stringify } from '@polkadot/util';
|
||||
import { fetch } from '@polkadot/x-fetch';
|
||||
|
||||
import { allNetworks } from './';
|
||||
|
||||
const REGISTRY = 'https://raw.githubusercontent.com/paritytech/ss58-registry/main/ss58-registry.json';
|
||||
const OUTPUT = './.github/ss58-check.md';
|
||||
|
||||
function assertAndLog (check: boolean, error: string): void {
|
||||
if (!check) {
|
||||
process.env.CI_LOG && fs.appendFileSync(OUTPUT, `
|
||||
|
||||
${error}
|
||||
`);
|
||||
|
||||
throw new Error(error);
|
||||
}
|
||||
}
|
||||
|
||||
describe('check latest Substrate ss58 registry', (): void => {
|
||||
let original: Ss58Registry;
|
||||
|
||||
beforeAll(async (): Promise<void> => {
|
||||
original = (await (await fetch(REGISTRY)).json()) as Ss58Registry;
|
||||
});
|
||||
|
||||
it('has the same number as the original', (): void => {
|
||||
assertAndLog(allNetworks.length === original.registry.length, `Number of entries mismatched:: Expected ${original.registry.length} found ${allNetworks.length}`);
|
||||
});
|
||||
|
||||
it('has no missing any entries', (): void => {
|
||||
const missing = original.registry
|
||||
.filter(({ prefix }) => !allNetworks.some((n) => n.prefix === prefix))
|
||||
.map(({ displayName, prefix }) => `${displayName} (${prefix})`);
|
||||
|
||||
assertAndLog(!missing.length, `Missing entries found: ${stringify(missing, 2)}`);
|
||||
});
|
||||
|
||||
it('has no extra entries', (): void => {
|
||||
const missing = allNetworks
|
||||
.filter(({ prefix }) => !original.registry.some((n) => n.prefix === prefix))
|
||||
.map(({ displayName, prefix }) => `${displayName} (${prefix})`);
|
||||
|
||||
assertAndLog(!missing.length, `Extra entries found: ${stringify(missing, 2)}`);
|
||||
});
|
||||
|
||||
it('has the same values as the original', (): void => {
|
||||
const fields = objectKeys(original.schema);
|
||||
const errors = original.registry
|
||||
.map((n): [string, string[]] => {
|
||||
const other = allNetworks.find(({ prefix }) => prefix === n.prefix);
|
||||
|
||||
return [
|
||||
`${n.displayName} (${n.prefix})`,
|
||||
other
|
||||
? fields.filter((f) =>
|
||||
['decimals', 'symbols'].includes(f)
|
||||
? stringify(n[f] || []) !== stringify(other[f] || [])
|
||||
: stringify(n[f]) !== stringify(other[f])
|
||||
)
|
||||
: []
|
||||
];
|
||||
})
|
||||
.filter(([, fields]) => fields.length);
|
||||
|
||||
assertAndLog(!errors.length, `Mismatches found: ${stringify(errors.map(([n, m]) => `${n}:: ${m.join(', ')}`), 2)}`);
|
||||
});
|
||||
});
|
||||
@@ -932,6 +932,19 @@
|
||||
"standardAccount": "*25519",
|
||||
"website": "https://invarch.network"
|
||||
},
|
||||
{
|
||||
"prefix": 126,
|
||||
"network": "joystream",
|
||||
"displayName": "Joystream",
|
||||
"symbols": [
|
||||
"JOY"
|
||||
],
|
||||
"decimals": [
|
||||
10
|
||||
],
|
||||
"standardAccount": "*25519",
|
||||
"website": "https://www.joystream.org"
|
||||
},
|
||||
{
|
||||
"prefix": 128,
|
||||
"network": "clover",
|
||||
@@ -1210,7 +1223,7 @@
|
||||
"network": "tidefi",
|
||||
"displayName": "Tidefi",
|
||||
"symbols": [
|
||||
"TIFI"
|
||||
"TDFY"
|
||||
],
|
||||
"decimals": [
|
||||
12
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../hw-ledger/tsconfig.build.json" },
|
||||
{ "path": "../util/tsconfig.build.json" },
|
||||
{ "path": "../x-fetch/tsconfig.build.json" }
|
||||
{ "path": "../util/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -2045,9 +2045,9 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/dev@npm:^0.67.80":
|
||||
version: 0.67.80
|
||||
resolution: "@polkadot/dev@npm:0.67.80"
|
||||
"@polkadot/dev@npm:^0.67.81":
|
||||
version: 0.67.81
|
||||
resolution: "@polkadot/dev@npm:0.67.81"
|
||||
dependencies:
|
||||
"@babel/cli": ^7.18.6
|
||||
"@babel/core": ^7.18.6
|
||||
@@ -2081,7 +2081,7 @@ __metadata:
|
||||
babel-plugin-styled-components: ^2.0.7
|
||||
browserslist: ^4.21.2
|
||||
coveralls: ^3.1.1
|
||||
eslint: ^8.19.0
|
||||
eslint: ^8.20.0
|
||||
eslint-config-standard: ^17.0.0
|
||||
eslint-import-resolver-node: ^0.3.6
|
||||
eslint-plugin-header: ^3.1.1
|
||||
@@ -2136,7 +2136,7 @@ __metadata:
|
||||
polkadot-exec-rollup: scripts/polkadot-exec-rollup.mjs
|
||||
polkadot-exec-tsc: scripts/polkadot-exec-tsc.mjs
|
||||
polkadot-exec-webpack: scripts/polkadot-exec-webpack.mjs
|
||||
checksum: 54fad512768ed57457b0238e78e9d54bc3e71ce5bc04a4b9a9e233aba8417fa01cf9acc0c0b46873c51a68aa533cc74162a0b5f041309ce8043df8891bc091b7
|
||||
checksum: a2e76356d8aa60cee5e43483a59eb88cad0f54a86d51c5cbdc915b2a4df2cac117a0f5f1f8dcdd7ac57153db7d00774094ff53b6fcc36e416d82f2d60f389690
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -2188,8 +2188,7 @@ __metadata:
|
||||
"@babel/runtime": ^7.18.6
|
||||
"@polkadot/hw-ledger": 10.0.3-5-x
|
||||
"@polkadot/util": 10.0.3-5-x
|
||||
"@polkadot/x-fetch": 10.0.3-5-x
|
||||
"@substrate/ss58-registry": ^1.23.0
|
||||
"@substrate/ss58-registry": ^1.24.0
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
@@ -2326,7 +2325,7 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/x-fetch@10.0.3-5-x, @polkadot/x-fetch@workspace:packages/x-fetch":
|
||||
"@polkadot/x-fetch@workspace:packages/x-fetch":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/x-fetch@workspace:packages/x-fetch"
|
||||
dependencies:
|
||||
@@ -2511,10 +2510,10 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@substrate/ss58-registry@npm:^1.23.0":
|
||||
version: 1.23.0
|
||||
resolution: "@substrate/ss58-registry@npm:1.23.0"
|
||||
checksum: 6544c713f4200c32ed8cdc3dfe6296bbc5f6f32c27f05c725004eab10f2c0e17f56a44631c35ab58612b5e143de98321aa599b3bdc8c2a9ff6fc41e6e9b8c26b
|
||||
"@substrate/ss58-registry@npm:^1.24.0":
|
||||
version: 1.24.0
|
||||
resolution: "@substrate/ss58-registry@npm:1.24.0"
|
||||
checksum: c0abf7a4e91f675cd06eca9b5ce37d09c37b7e260c9183e52243572be9128cb712c45d1d58076df055fcacbd30b71a848286083b0fde3e2503cac8eb7266f1a9
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -5173,9 +5172,9 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"eslint@npm:^8.19.0":
|
||||
version: 8.19.0
|
||||
resolution: "eslint@npm:8.19.0"
|
||||
"eslint@npm:^8.20.0":
|
||||
version: 8.20.0
|
||||
resolution: "eslint@npm:8.20.0"
|
||||
dependencies:
|
||||
"@eslint/eslintrc": ^1.3.0
|
||||
"@humanwhocodes/config-array": ^0.9.2
|
||||
@@ -5214,7 +5213,7 @@ __metadata:
|
||||
v8-compile-cache: ^2.0.3
|
||||
bin:
|
||||
eslint: bin/eslint.js
|
||||
checksum: 0bc9df1a3a09dcd5a781ec728f280aa8af3ab19c2d1f14e2668b5ee5b8b1fb0e72dde5c3acf738e7f4281685fb24ec149b6154255470b06cf41de76350bca7a4
|
||||
checksum: a31adf390d71d916925586bc8467b48f620e93dd0416bc1e897d99265af88b48d4eba3985b5ff4653ae5cc46311a360d373574002277e159bb38a4363abf9228
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -9447,7 +9446,7 @@ resolve@^2.0.0-next.3:
|
||||
resolution: "root-workspace-0b6124@workspace:."
|
||||
dependencies:
|
||||
"@babel/core": ^7.18.6
|
||||
"@polkadot/dev": ^0.67.80
|
||||
"@polkadot/dev": ^0.67.81
|
||||
"@types/jest": ^28.1.6
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
Reference in New Issue
Block a user