Check for prefix dupes (#936)

* Check for prefix dupes

* Bump deps
This commit is contained in:
Jaco Greeff
2021-04-08 10:11:18 +02:00
committed by GitHub
parent 1e778b0cc4
commit d6617f33dd
5 changed files with 35 additions and 18 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
"packages/*"
],
"resolutions": {
"typescript": "^4.2.3"
"typescript": "^4.2.4"
},
"scripts": {
"build": "polkadot-dev-build-ts",
+18 -1
View File
@@ -1,7 +1,9 @@
// Copyright 2017-2021 @polkadot/networks authors & contributors
// SPDX-License-Identifier: Apache-2.0
import filtered, { available } from '.';
import type { NetworkFromSubstrate } from './types';
import filtered, { all, available } from '.';
describe('filtered', (): void => {
it('has the correct starting order', (): void => {
@@ -11,4 +13,19 @@ describe('filtered', (): void => {
it('has no ignored networks', (): void => {
expect(available.some(({ isIgnored }) => isIgnored)).toEqual(false);
});
it('has no ss58 duplicates', (): void => {
const dupes: NetworkFromSubstrate[] = [];
const uniques: NetworkFromSubstrate[] = [];
all.forEach((a): void => {
if (uniques.some((u) => u.prefix === a.prefix)) {
dupes.push(a);
} else {
uniques.push(a);
}
});
expect(dupes).toEqual([]);
});
});
+1 -1
View File
@@ -17,7 +17,7 @@
"dependencies": {
"@babel/runtime": "^7.13.10",
"@polkadot/x-global": "6.0.6-3",
"@types/node-fetch": "^2.5.8",
"@types/node-fetch": "^2.5.10",
"node-fetch": "^2.6.1"
}
}
+1 -1
View File
@@ -14,7 +14,7 @@
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/x-global#readme",
"dependencies": {
"@babel/runtime": "^7.13.10",
"@types/node-fetch": "^2.5.8",
"@types/node-fetch": "^2.5.10",
"node-fetch": "^2.6.1"
}
}
+14 -14
View File
@@ -2088,7 +2088,7 @@ __metadata:
dependencies:
"@babel/runtime": ^7.13.10
"@polkadot/x-global": 6.0.6-3
"@types/node-fetch": ^2.5.8
"@types/node-fetch": ^2.5.10
node-fetch: ^2.6.1
languageName: unknown
linkType: soft
@@ -2098,7 +2098,7 @@ __metadata:
resolution: "@polkadot/x-global@workspace:packages/x-global"
dependencies:
"@babel/runtime": ^7.13.10
"@types/node-fetch": ^2.5.8
"@types/node-fetch": ^2.5.10
node-fetch: ^2.6.1
languageName: unknown
linkType: soft
@@ -2390,13 +2390,13 @@ __metadata:
languageName: node
linkType: hard
"@types/node-fetch@npm:^2.5.8":
version: 2.5.8
resolution: "@types/node-fetch@npm:2.5.8"
"@types/node-fetch@npm:^2.5.10":
version: 2.5.10
resolution: "@types/node-fetch@npm:2.5.10"
dependencies:
"@types/node": "*"
form-data: ^3.0.0
checksum: 608cdd6aed2c6a44a26406eb63475d4bfb8f63f78f22f747e30dd7cda309b86dc019e4427b9092011541da95d83ef03e2e6558c37d39221c0931617f32d3c4e1
checksum: 7687038f73cf0f2e4bac8ced3abdfbb77f8b2719de2f180d0064238d7460c8b4dc0b39c08da35a76d7db9f86528599ea0f7cee7c468ad7cfecfe2db1c5863641
languageName: node
linkType: hard
@@ -10689,23 +10689,23 @@ fsevents@~2.1.2:
languageName: node
linkType: hard
"typescript@npm:^4.2.3":
version: 4.2.3
resolution: "typescript@npm:4.2.3"
"typescript@npm:^4.2.4":
version: 4.2.4
resolution: "typescript@npm:4.2.4"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 06e8470f317db6f5e2fce809b20eb84a67a7d8179057abff36e5427bd1b891bd08e54581ff81f0fa36aef9b6d1eb0f54eaf6e2643c6dbd4e37a0adcc41eed256
checksum: edaede2fa77f56b7fba80ee624a2368ab1216e75b0434d968ccb47ab0a5e2f6d94f848b3b111c1237dd71e988cd376af26370dcdad3b94355c76e759f0dd0a1e
languageName: node
linkType: hard
"typescript@patch:typescript@npm%3A^4.2.3#builtin<compat/typescript>":
version: 4.2.3
resolution: "typescript@patch:typescript@npm%3A4.2.3#builtin<compat/typescript>::version=4.2.3&hash=a45b0e"
"typescript@patch:typescript@npm%3A^4.2.4#builtin<compat/typescript>":
version: 4.2.4
resolution: "typescript@patch:typescript@npm%3A4.2.4#builtin<compat/typescript>::version=4.2.4&hash=a45b0e"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: a8956044aabf730699bcc3c2475efdd3f35e509329325cf60b4989761d4c2188e2c474183e2cf92b8c201fcf976814a5a16f144508b2a832643c4f972d0ab803
checksum: 3be44317593182e8ce494c114e7ad9b0bb2553a22f3085cc6da4f0a36912c20850daa9be4c898af2ab6fc8b12f430c1c9e46ac715721867cd38643f2350d3ef9
languageName: node
linkType: hard