From 5083de294129318e9257f46ef4b3799d2fbd6838 Mon Sep 17 00:00:00 2001 From: Jaco Date: Wed, 14 Apr 2021 14:56:43 +0300 Subject: [PATCH] Sync ss58 with Substrate registry (#945) * Sync ss58 with Substrate registry * Update template --- .github/ss58-check.md | 4 ++-- packages/networks/scripts/fromSubstrate.mjs | 8 +++++--- packages/networks/src/substrate.ts | 11 ++++++++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/ss58-check.md b/.github/ss58-check.md index 142e28d2f..b871b8076 100644 --- a/.github/ss58-check.md +++ b/.github/ss58-check.md @@ -5,6 +5,6 @@ labels: ['ci', '@networks'] cc @polkadot-js/notifications -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 +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/substrate.ts -Check the nightly cron output or run `yarn networks:crosscheck` locally. The output as found from the test includes: +Check the nightly cron output (or via `yarn networks:crosscheck` locally) and run `yarn networks:sync` to update. The output as found from the test includes: diff --git a/packages/networks/scripts/fromSubstrate.mjs b/packages/networks/scripts/fromSubstrate.mjs index 5b5c1a47b..7136afffc 100644 --- a/packages/networks/scripts/fromSubstrate.mjs +++ b/packages/networks/scripts/fromSubstrate.mjs @@ -33,10 +33,10 @@ async function getSubstrateRegistry () { getSubstrateRegistry() .then((entries) => { - fs.writeFileSync('packages/networks/src/knownSubstrate.ts', `// Copyright 2017-2021 @polkadot/networks authors & contributors + fs.writeFileSync('packages/networks/src/substrate.ts', `// Copyright 2017-2021 @polkadot/networks authors & contributors // SPDX-License-Identifier: Apache-2.0 -// Auto-generated by scripts/fromSubstrate.mjs +// Auto-generated by yarn networks:sync (via scripts/fromSubstrate.mjs) // // Do not edit, rather // - make a PR to the upstream registry as per ${SUBSTRATE_REGISTRY} @@ -48,10 +48,12 @@ import type { KnownSubstrate } from './types'; export const knownSubstrate: KnownSubstrate[] = [\n${entries}\n]; `); + console.log('Completed.'); + process.exit(0); }) .catch((error) => { - console.error(error); + console.error('Error:', error.message); process.exit(-1); }); diff --git a/packages/networks/src/substrate.ts b/packages/networks/src/substrate.ts index 55402a13c..d58be88d7 100644 --- a/packages/networks/src/substrate.ts +++ b/packages/networks/src/substrate.ts @@ -1,7 +1,7 @@ // Copyright 2017-2021 @polkadot/networks authors & contributors // SPDX-License-Identifier: Apache-2.0 -// Auto-generated by scripts/fromSubstrate.mjs +// Auto-generated by yarn networks:sync (via scripts/fromSubstrate.mjs) // // Do not edit, rather // - make a PR to the upstream registry as per https://raw.githubusercontent.com/paritytech/substrate/master/ss58-registry.json @@ -479,6 +479,15 @@ export const knownSubstrate: KnownSubstrate[] = [ symbols: ['CRU'], website: 'https://crust.network' }, + { + decimals: [18], + displayName: 'SORA Network', + network: 'sora', + prefix: 69, + standardAccount: '*25519', + symbols: ['XOR'], + website: 'https://sora.org' + }, { decimals: [18], displayName: 'Social Network',