Sync with paritytech/ss58-registry (#1138)

* Sync with paritytech/ss58-registry

* Since registry location

* Adjust defaults with json location

* Adjust

* Adjust comments

* prefix 42
This commit is contained in:
Jaco
2021-10-23 12:34:53 +03:00
committed by GitHub
parent 6982380aff
commit 2cdaf71c4b
8 changed files with 68 additions and 28 deletions
+2 -2
View File
@@ -8,10 +8,10 @@ import fs from 'fs';
import { stringify } from '@polkadot/util';
import { fetch } from '@polkadot/x-fetch';
import { substrateRegistry } from './defaults';
import { allNetworks } from './';
const OUTPUT = './.github/ss58-check.md';
const SUBSTRATE_REGISTRY = 'https://raw.githubusercontent.com/paritytech/substrate/master/ss58-registry.json';
function assertAndLog (check: boolean, error: string): void {
if (!check) {
@@ -28,7 +28,7 @@ describe('check latest Substrate ss58 registry', (): void => {
let original: Ss58Registry;
beforeAll(async (): Promise<void> => {
original = (await (await fetch(SUBSTRATE_REGISTRY)).json()) as Ss58Registry;
original = (await (await fetch(substrateRegistry)).json()) as Ss58Registry;
});
it('has the same number as the original', (): void => {
+4
View File
@@ -3,6 +3,8 @@
import type { KnownGenesis, KnownIcon, KnownLedger, KnownTestnet } from './types';
export const substrateRegistry = 'https://raw.githubusercontent.com/paritytech/ss58-registry/main/ss58-registry.json';
// NOTE: In the case where the network was hard-spooned and multiple genesisHashes
// are provided, it needs to be in reverse order, i.e. most-recent first, oldest
// last. This make lookups for the current a simple genesisHash[0]
@@ -90,6 +92,8 @@ export const knownLedger: KnownLedger = {
// testnets should not allow selection
export const knownTestnet: KnownTestnet = {
'': true, // this is the default non-network entry
'cess-testnet': true,
'dock-testnet': true,
jupiter: true,
'mathchain-testnet': true,
+1 -1
View File
@@ -18,7 +18,7 @@ export const allNetworks = knownSubstrate.map((o): SubstrateNetwork => {
n.genesisHash = knownGenesis[network] || [];
n.icon = knownIcon[network] || 'substrate';
n.isIgnored = !network || !!knownTestnet[network] || !o.standardAccount;
n.isIgnored = !!knownTestnet[network] || (!(o.standardAccount && o.decimals && o.symbols) && o.prefix !== 42);
return n;
});
+43 -19
View File
@@ -1,11 +1,17 @@
// Copyright 2017-2021 @polkadot/networks authors & contributors
// SPDX-License-Identifier: Apache-2.0
//
// 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
// - yarn networks:sync
// This file should never be edited manually. Rather the process is as follow -
//
// - make a PR to the upstream registry found at https://github.com/paritytech/ss58-registry/
// - ensure the PR gets merged
// - yarn networks:sync in this repo to sync
//
// Any manual changes to this file will make CI cron checks fail and will be
// lost when the registry is updated alongside the above sync.
//
import type { KnownSubstrate } from './types';
@@ -23,9 +29,9 @@ export const knownSubstrate: KnownSubstrate[] = [
{
decimals: null,
displayName: 'Bare 32-bit Schnorr/Ristretto (S/R 25519) public key.',
network: null,
network: 'BareSr25519',
prefix: 1,
standardAccount: null,
standardAccount: 'Sr25519',
symbols: null,
website: null
},
@@ -41,9 +47,9 @@ export const knownSubstrate: KnownSubstrate[] = [
{
decimals: null,
displayName: 'Bare 32-bit Ed25519 public key.',
network: null,
network: 'BareEd25519',
prefix: 3,
standardAccount: null,
standardAccount: 'Ed25519',
symbols: null,
website: null
},
@@ -387,14 +393,14 @@ export const knownSubstrate: KnownSubstrate[] = [
prefix: 42,
standardAccount: '*25519',
symbols: null,
website: 'https://docs.substrate.io/'
website: 'https://substrate.io/'
},
{
decimals: null,
displayName: 'Bare 32-bit ECDSA SECP-256k1 public key.',
network: null,
network: 'BareSecp256k1',
prefix: 43,
standardAccount: null,
standardAccount: 'secp256k1',
symbols: null,
website: null
},
@@ -623,6 +629,15 @@ export const knownSubstrate: KnownSubstrate[] = [
symbols: ['NET'],
website: 'https://social.network'
},
{
decimals: [15],
displayName: 'QUARTZ by UNIQUE',
network: 'quartz_mainnet',
prefix: 255,
standardAccount: '*25519',
symbols: ['QTZ'],
website: 'https://unique.network'
},
{
decimals: [18],
displayName: 'Moonbeam',
@@ -641,15 +656,6 @@ export const knownSubstrate: KnownSubstrate[] = [
symbols: ['MOVR'],
website: 'https://moonbeam.network'
},
{
decimals: [18],
displayName: 'Automata Mainnet',
network: 'automata',
prefix: 2349,
standardAccount: '*25519',
symbols: ['ATA'],
website: 'https://ata.network'
},
{
decimals: [12],
displayName: 'Basilisk',
@@ -659,6 +665,24 @@ export const knownSubstrate: KnownSubstrate[] = [
symbols: ['BSX'],
website: 'https://bsx.fi'
},
{
decimals: [12],
displayName: 'CESS Testnet',
network: 'cess-testnet',
prefix: 10042,
standardAccount: '*25519',
symbols: ['TCESS'],
website: 'https://cess.cloud'
},
{
decimals: [12],
displayName: 'CESS',
network: 'cess',
prefix: 10043,
standardAccount: '*25519',
symbols: ['CESS'],
website: 'https://cess.cloud'
},
{
decimals: [18],
displayName: 'Automata ContextFree',
+1 -1
View File
@@ -8,7 +8,7 @@ export interface KnownSubstrate {
displayName: string;
network: string | null;
prefix: number;
standardAccount: '*25519' | 'secp256k1' | null;
standardAccount: '*25519' | 'Ed25519' | 'Sr25519' | 'secp256k1' | null;
symbols: string[] | null;
website: string | null;
}