diff --git a/.github/ss58-check.md b/.github/ss58-check.md index 6d674f026..90878f74f 100644 --- a/.github/ss58-check.md +++ b/.github/ss58-check.md @@ -4,4 +4,4 @@ labels: ci --- Discrepancies detected between https://github.com/paritytech/substrate/blob/master/ss58-registry.json and https://github.com/polkadot-js/common/blob/master/packages/networks/src/index.ts -Check the nightly cron output or run `yarn test:networks` locally. The output as found from the test includes: +Check the nightly cron output or run `yarn networks:crosscheck` locally. The output as found from the test includes: diff --git a/.github/workflows/ss58-check.yml b/.github/workflows/ss58-check.yml index 99409c3eb..ead4c30ae 100644 --- a/.github/workflows/ss58-check.yml +++ b/.github/workflows/ss58-check.yml @@ -13,7 +13,7 @@ jobs: CI_LOG: 123 run: | yarn install --immutable | grep -v 'YN0013' - yarn test:networks + yarn networks:crosscheck - name: issue if: ${{ failure() }} diff --git a/package.json b/package.json index 628009dd3..741f3aa43 100644 --- a/package.json +++ b/package.json @@ -15,10 +15,10 @@ "build:release": "polkadot-ci-ghact-build", "lint": "polkadot-dev-run-lint", "clean": "polkadot-dev-clean-build", + "networks:crosscheck": "polkadot-dev-run-test packages/networks/src/crosscheck", "postinstall": "polkadot-dev-yarn-only", - "test": "polkadot-dev-run-test --coverage --runInBand --testPathIgnorePatterns checkNetworks", - "test:one": "polkadot-dev-run-test", - "test:networks": "polkadot-dev-run-test packages/networks/src/checkNetworks" + "test": "polkadot-dev-run-test --coverage --runInBand --testPathIgnorePatterns crosscheck", + "test:one": "polkadot-dev-run-test" }, "devDependencies": { "@babel/core": "^7.12.3", diff --git a/packages/networks/src/checkNetworks.spec.ts b/packages/networks/src/crosscheck.spec.ts similarity index 92% rename from packages/networks/src/checkNetworks.spec.ts rename to packages/networks/src/crosscheck.spec.ts index 8eda56146..d22a7659c 100644 --- a/packages/networks/src/checkNetworks.spec.ts +++ b/packages/networks/src/crosscheck.spec.ts @@ -8,6 +8,7 @@ import fetch from '@polkadot/x-fetch'; import { all } from './'; +const ORIGINAL = 'https://raw.githubusercontent.com/paritytech/substrate/master/ss58-registry.json'; const OUTPUT = './.github/ss58-check.md'; function assertAndLog (check: boolean, error: string): void { @@ -25,9 +26,7 @@ describe('check latest Substrate ss58 registry', (): void => { let original: Ss58Registry; beforeAll(async (): Promise => { - const response = await fetch('https://raw.githack.com/paritytech/substrate/master/ss58-registry.json'); - - original = await response.json() as Ss58Registry; + original = (await (await fetch(ORIGINAL)).json()) as Ss58Registry; }); it('has the same number as the original', (): void => {