Filter ss58 testnets (#822)
* Filter ss58 testnets * Remove genesisHash testnet * Ignore reserved
This commit is contained in:
+1
-1
@@ -25,5 +25,5 @@
|
||||
"@polkadot/ts": "^0.3.58",
|
||||
"@types/jest": "^26.0.19"
|
||||
},
|
||||
"version": "5.2.1"
|
||||
"version": "5.2.2"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/keyring",
|
||||
"version": "5.2.1",
|
||||
"version": "5.2.2",
|
||||
"description": "Keyring management",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"maintainers": [],
|
||||
@@ -17,11 +17,11 @@
|
||||
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/keyring#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"@polkadot/util": "5.2.1",
|
||||
"@polkadot/util-crypto": "5.2.1"
|
||||
"@polkadot/util": "5.2.2",
|
||||
"@polkadot/util-crypto": "5.2.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@polkadot/util": "5.2.1",
|
||||
"@polkadot/util-crypto": "5.2.1"
|
||||
"@polkadot/util": "5.2.2",
|
||||
"@polkadot/util-crypto": "5.2.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/networks",
|
||||
"version": "5.2.1",
|
||||
"version": "5.2.2",
|
||||
"description": "A list of all available Substrate networks and their applicable prefixes",
|
||||
"main": "index.js",
|
||||
"module": "index.mjs",
|
||||
@@ -16,7 +16,7 @@
|
||||
"@babel/runtime": "^7.12.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/util": "5.2.1",
|
||||
"@polkadot/x-fetch": "5.2.1"
|
||||
"@polkadot/util": "5.2.2",
|
||||
"@polkadot/x-fetch": "5.2.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
// Copyright 2017-2020 @polkadot/networks authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import filtered from './';
|
||||
import filtered, { available } from '.';
|
||||
|
||||
describe('filtered', (): void => {
|
||||
it('has the correct starting order', (): void => {
|
||||
expect(filtered.slice(0, 3).map(({ prefix }) => prefix)).toEqual([0, 2, 42]);
|
||||
});
|
||||
|
||||
it('has no ignored networks', (): void => {
|
||||
expect(available.some(({ isIgnored }) => isIgnored)).toEqual(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -19,6 +19,7 @@ const UNSORTED = [0, 2, 42];
|
||||
const createReserved = (prefix: number, displayName = 'This prefix is reserved.'): NetworkFromSubstrate => ({
|
||||
decimals: null,
|
||||
displayName,
|
||||
isIgnored: true,
|
||||
network: `reserved${prefix}`,
|
||||
prefix,
|
||||
standardAccount: null,
|
||||
@@ -215,7 +216,7 @@ const all: NetworkFromSubstrate[] = [
|
||||
{
|
||||
decimals: [6],
|
||||
displayName: 'Dock Testnet',
|
||||
genesisHash: ['0x3f0608444cf5d7eec977430483ffef31ff86dfa6bfc6d7114023ee80cc03ea3f'],
|
||||
isIgnored: true, // testnet
|
||||
network: 'dock-testnet',
|
||||
prefix: 21,
|
||||
standardAccount: '*25519',
|
||||
@@ -253,6 +254,7 @@ const all: NetworkFromSubstrate[] = [
|
||||
{
|
||||
decimals: [18],
|
||||
displayName: 'ZERO Alphaville',
|
||||
isIgnored: true, // testnet
|
||||
network: 'zero-alphaville',
|
||||
prefix: 25,
|
||||
standardAccount: '*25519',
|
||||
@@ -344,6 +346,7 @@ const all: NetworkFromSubstrate[] = [
|
||||
{
|
||||
decimals: [18],
|
||||
displayName: 'MathChain testnet',
|
||||
isIgnored: true, // testnet
|
||||
network: 'mathchain-testnet',
|
||||
prefix: 40,
|
||||
standardAccount: '*25519',
|
||||
@@ -384,11 +387,12 @@ const all: NetworkFromSubstrate[] = [
|
||||
];
|
||||
|
||||
// The list of available/claimed prefixes
|
||||
// - no testnets
|
||||
// - we only include those where we have a standardAccount
|
||||
// - when no icon has been specified, default to substrate
|
||||
// - sort by name, however we keep 0, 2, 42 first in the list
|
||||
const available: Network[] = all
|
||||
.filter((n) => n.standardAccount === '*25519')
|
||||
.filter((n) => !n.isIgnored)
|
||||
.map((n) => ({ ...n, genesisHash: n.genesisHash || [], icon: n.icon || 'substrate' }))
|
||||
.sort((a, b) =>
|
||||
UNSORTED.includes(a.prefix) && UNSORTED.includes(b.prefix)
|
||||
|
||||
@@ -10,6 +10,7 @@ export interface NetworkFromSubstrate {
|
||||
prefix: number;
|
||||
genesisHash?: string[] | null;
|
||||
icon?: Icon | null;
|
||||
isIgnored?: boolean;
|
||||
standardAccount: '*25519' | null;
|
||||
symbols: string[] | null;
|
||||
website: string | null;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/util-crypto",
|
||||
"version": "5.2.1",
|
||||
"version": "5.2.2",
|
||||
"description": "A collection of useful crypto utilities for @polkadot",
|
||||
"main": "index.js",
|
||||
"module": "index.mjs",
|
||||
@@ -17,10 +17,10 @@
|
||||
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/util-crypto#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"@polkadot/networks": "5.2.1",
|
||||
"@polkadot/util": "5.2.1",
|
||||
"@polkadot/networks": "5.2.2",
|
||||
"@polkadot/util": "5.2.2",
|
||||
"@polkadot/wasm-crypto": "^3.1.1",
|
||||
"@polkadot/x-randomvalues": "5.2.1",
|
||||
"@polkadot/x-randomvalues": "5.2.2",
|
||||
"base-x": "^3.0.8",
|
||||
"blakejs": "^1.1.0",
|
||||
"bn.js": "^4.11.9",
|
||||
@@ -40,6 +40,6 @@
|
||||
"@types/xxhashjs": "^0.2.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@polkadot/util": "5.2.1"
|
||||
"@polkadot/util": "5.2.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/util",
|
||||
"version": "5.2.1",
|
||||
"version": "5.2.2",
|
||||
"description": "A collection of useful utilities for @polkadot",
|
||||
"main": "index.js",
|
||||
"module": "index.mjs",
|
||||
@@ -14,8 +14,8 @@
|
||||
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/util#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.5",
|
||||
"@polkadot/x-textdecoder": "5.2.1",
|
||||
"@polkadot/x-textencoder": "5.2.1",
|
||||
"@polkadot/x-textdecoder": "5.2.2",
|
||||
"@polkadot/x-textencoder": "5.2.2",
|
||||
"@types/bn.js": "^4.11.6",
|
||||
"bn.js": "^4.11.9",
|
||||
"camelcase": "^5.3.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/x-fetch",
|
||||
"version": "5.2.1",
|
||||
"version": "5.2.2",
|
||||
"description": "A cross-environment fetch replacement",
|
||||
"browser": "browser.js",
|
||||
"main": "node.js",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/x-randomvalues",
|
||||
"version": "5.2.1",
|
||||
"version": "5.2.2",
|
||||
"description": "A cross-environment window.crypto.getRandomValues replacement",
|
||||
"browser": "browser.js",
|
||||
"main": "node.js",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/x-textdecoder",
|
||||
"version": "5.2.1",
|
||||
"version": "5.2.2",
|
||||
"description": "A TextDecoder replacement",
|
||||
"browser": "browser.js",
|
||||
"main": "node.js",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/x-textencoder",
|
||||
"version": "5.2.1",
|
||||
"version": "5.2.2",
|
||||
"description": "A TextDecoder replacement",
|
||||
"browser": "browser.js",
|
||||
"main": "node.js",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/x-ws",
|
||||
"version": "5.2.1",
|
||||
"version": "5.2.2",
|
||||
"description": "A cross-environment WebSocket replacement",
|
||||
"browser": "browser.js",
|
||||
"main": "node.js",
|
||||
|
||||
@@ -1784,21 +1784,21 @@ __metadata:
|
||||
resolution: "@polkadot/keyring@workspace:packages/keyring"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/util": 5.2.1
|
||||
"@polkadot/util-crypto": 5.2.1
|
||||
"@polkadot/util": 5.2.2
|
||||
"@polkadot/util-crypto": 5.2.2
|
||||
peerDependencies:
|
||||
"@polkadot/util": 5.2.1
|
||||
"@polkadot/util-crypto": 5.2.1
|
||||
"@polkadot/util": 5.2.2
|
||||
"@polkadot/util-crypto": 5.2.2
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/networks@5.2.1, @polkadot/networks@workspace:packages/networks":
|
||||
"@polkadot/networks@5.2.2, @polkadot/networks@workspace:packages/networks":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/networks@workspace:packages/networks"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/util": 5.2.1
|
||||
"@polkadot/x-fetch": 5.2.1
|
||||
"@polkadot/util": 5.2.2
|
||||
"@polkadot/x-fetch": 5.2.2
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
@@ -1811,15 +1811,15 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/util-crypto@5.2.1, @polkadot/util-crypto@workspace:packages/util-crypto":
|
||||
"@polkadot/util-crypto@5.2.2, @polkadot/util-crypto@workspace:packages/util-crypto":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/util-crypto@workspace:packages/util-crypto"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/networks": 5.2.1
|
||||
"@polkadot/util": 5.2.1
|
||||
"@polkadot/networks": 5.2.2
|
||||
"@polkadot/util": 5.2.2
|
||||
"@polkadot/wasm-crypto": ^3.1.1
|
||||
"@polkadot/x-randomvalues": 5.2.1
|
||||
"@polkadot/x-randomvalues": 5.2.2
|
||||
"@types/bn.js": ^4.11.6
|
||||
"@types/create-hash": ^1.2.2
|
||||
"@types/elliptic": ^6.4.12
|
||||
@@ -1836,17 +1836,17 @@ __metadata:
|
||||
tweetnacl: ^1.0.3
|
||||
xxhashjs: ^0.2.2
|
||||
peerDependencies:
|
||||
"@polkadot/util": 5.2.1
|
||||
"@polkadot/util": 5.2.2
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/util@5.2.1, @polkadot/util@workspace:packages/util":
|
||||
"@polkadot/util@5.2.2, @polkadot/util@workspace:packages/util":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/util@workspace:packages/util"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.12.5
|
||||
"@polkadot/x-textdecoder": 5.2.1
|
||||
"@polkadot/x-textencoder": 5.2.1
|
||||
"@polkadot/x-textdecoder": 5.2.2
|
||||
"@polkadot/x-textencoder": 5.2.2
|
||||
"@types/bn.js": ^4.11.6
|
||||
bn.js: ^4.11.9
|
||||
camelcase: ^5.3.1
|
||||
@@ -1886,7 +1886,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@polkadot/x-fetch@5.2.1, @polkadot/x-fetch@workspace:packages/x-fetch":
|
||||
"@polkadot/x-fetch@5.2.2, @polkadot/x-fetch@workspace:packages/x-fetch":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/x-fetch@workspace:packages/x-fetch"
|
||||
dependencies:
|
||||
@@ -1896,7 +1896,7 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/x-randomvalues@5.2.1, @polkadot/x-randomvalues@workspace:packages/x-randomvalues":
|
||||
"@polkadot/x-randomvalues@5.2.2, @polkadot/x-randomvalues@workspace:packages/x-randomvalues":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/x-randomvalues@workspace:packages/x-randomvalues"
|
||||
dependencies:
|
||||
@@ -1905,7 +1905,7 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/x-textdecoder@5.2.1, @polkadot/x-textdecoder@workspace:packages/x-textdecoder":
|
||||
"@polkadot/x-textdecoder@5.2.2, @polkadot/x-textdecoder@workspace:packages/x-textdecoder":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/x-textdecoder@workspace:packages/x-textdecoder"
|
||||
dependencies:
|
||||
@@ -1913,7 +1913,7 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/x-textencoder@5.2.1, @polkadot/x-textencoder@workspace:packages/x-textencoder":
|
||||
"@polkadot/x-textencoder@5.2.2, @polkadot/x-textencoder@workspace:packages/x-textencoder":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/x-textencoder@workspace:packages/x-textencoder"
|
||||
dependencies:
|
||||
|
||||
Reference in New Issue
Block a user