Adjust teleport Ids (#8202)
* Adjust teleport Ids * Auto-extract teleport ids
This commit is contained in:
parent
5525e4b3c0
commit
10b12267e7
@ -4,6 +4,7 @@
|
||||
import type { EndpointOption } from './types';
|
||||
|
||||
import { KUSAMA_GENESIS } from '../api/constants';
|
||||
import { getTeleports } from './util';
|
||||
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
@ -542,7 +543,7 @@ export const prodRelayKusama: EndpointOption = {
|
||||
// NOTE: Keep this as the last entry, nothing after it
|
||||
'light client': 'light://substrate-connect/kusama' // NOTE: Keep last
|
||||
},
|
||||
teleport: [1000, 1001],
|
||||
teleport: getTeleports(prodParasKusamaCommon),
|
||||
linked: [
|
||||
...prodParasKusamaCommon,
|
||||
...prodParasKusama
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
import type { EndpointOption } from './types';
|
||||
|
||||
import { POLKADOT_GENESIS } from '../api/constants';
|
||||
import { getTeleports } from './util';
|
||||
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
@ -417,7 +418,7 @@ export const prodRelayPolkadot: EndpointOption = {
|
||||
// NOTE: Keep this as the last entry, nothing after it
|
||||
'light client': 'light://substrate-connect/polkadot' // NOTE: Keep last
|
||||
},
|
||||
teleport: [1000],
|
||||
teleport: getTeleports(prodParasPolkadotCommon),
|
||||
linked: [
|
||||
...prodParasPolkadotCommon,
|
||||
...prodParasPolkadot
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
import type { EndpointOption } from './types';
|
||||
|
||||
import { ROCOCO_GENESIS } from '../api/constants';
|
||||
import { getTeleports } from './util';
|
||||
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
@ -406,7 +407,7 @@ export const testRelayRococo: EndpointOption = {
|
||||
// NOTE: Keep this as the last entry, nothing after it
|
||||
'light client': 'light://substrate-connect/rococo' // NOTE: Keep last
|
||||
},
|
||||
teleport: [1000, 1002],
|
||||
teleport: getTeleports(testParasRococoCommon),
|
||||
linked: [
|
||||
...testParasRococoCommon,
|
||||
...testParasRococo
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
import type { EndpointOption } from './types';
|
||||
|
||||
import { WESTEND_GENESIS } from '../api/constants';
|
||||
import { getTeleports } from './util';
|
||||
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
@ -141,7 +142,7 @@ export const testRelayWestend: EndpointOption = {
|
||||
// NOTE: Keep this as the last entry, nothing after it
|
||||
'light client': 'light://substrate-connect/westend' // NOTE: Keep last
|
||||
},
|
||||
teleport: [1000, 1002],
|
||||
teleport: getTeleports(testParasWestendCommon),
|
||||
linked: [
|
||||
...testParasWestendCommon,
|
||||
...testParasWestend
|
||||
|
||||
@ -108,3 +108,10 @@ export function expandEndpoints (t: TFunction, input: EndpointOption[], firstOnl
|
||||
.reduce((all: LinkOption[], e) =>
|
||||
all.concat(expandEndpoint(t, e, firstOnly, withSort)), []);
|
||||
}
|
||||
|
||||
export function getTeleports (input: EndpointOption[]): number[] {
|
||||
return input
|
||||
.filter(({ teleport }) => !!teleport && teleport[0] === -1)
|
||||
.map(({ paraId }) => paraId)
|
||||
.filter((id): id is number => !!id);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user