From 5525e4b3c0c97390b33e58f85f14b4159cb06ec4 Mon Sep 17 00:00:00 2001 From: Jaco Date: Tue, 4 Oct 2022 12:29:54 +0300 Subject: [PATCH] Sort light, comment around being the last (#8201) --- .../apps-config/src/endpoints/productionRelayKusama.ts | 9 ++++++--- .../apps-config/src/endpoints/productionRelayPolkadot.ts | 3 ++- packages/apps-config/src/endpoints/testingRelayRococo.ts | 3 ++- .../apps-config/src/endpoints/testingRelayWestend.ts | 3 ++- packages/apps-config/src/endpoints/util.ts | 9 ++++++++- 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/packages/apps-config/src/endpoints/productionRelayKusama.ts b/packages/apps-config/src/endpoints/productionRelayKusama.ts index 47dda275fd..b748b08dec 100644 --- a/packages/apps-config/src/endpoints/productionRelayKusama.ts +++ b/packages/apps-config/src/endpoints/productionRelayKusama.ts @@ -143,7 +143,8 @@ export const prodParasKusama: EndpointOption[] = [ TerraBioDAO: 'wss://ws-node-gm.terrabiodao.org', Leemo: 'wss://leemo.gmordie.com', 'GM Intern': 'wss://intern.gmordie.com', - 'light client': 'light://substrate-connect/kusama/gm' + // NOTE: Keep this as the last entry, nothing after it + 'light client': 'light://substrate-connect/kusama/gm' // NOTE: Keep last } }, { @@ -174,7 +175,8 @@ export const prodParasKusama: EndpointOption[] = [ providers: { 'InvArch Team': 'wss://tinker.invarch.network', OnFinality: 'wss://invarch-tinkernet.api.onfinality.io/public-ws', - 'light client': 'light://substrate-connect/kusama/tinkernet' + // NOTE: Keep this as the last entry, nothing after it + 'light client': 'light://substrate-connect/kusama/tinkernet' // NOTE: Keep last } }, { @@ -537,7 +539,8 @@ export const prodRelayKusama: EndpointOption = { Pinknode: 'wss://public-rpc.pinknode.io/kusama', // 'Geometry Labs': 'wss://kusama.geometry.io/websockets', // https://github.com/polkadot-js/apps/pull/6746 'Automata 1RPC': 'wss://1rpc.io/ksm', - 'light client': 'light://substrate-connect/kusama' + // NOTE: Keep this as the last entry, nothing after it + 'light client': 'light://substrate-connect/kusama' // NOTE: Keep last }, teleport: [1000, 1001], linked: [ diff --git a/packages/apps-config/src/endpoints/productionRelayPolkadot.ts b/packages/apps-config/src/endpoints/productionRelayPolkadot.ts index 680647b85d..9e2b2a7561 100644 --- a/packages/apps-config/src/endpoints/productionRelayPolkadot.ts +++ b/packages/apps-config/src/endpoints/productionRelayPolkadot.ts @@ -414,7 +414,8 @@ export const prodRelayPolkadot: EndpointOption = { RadiumBlock: 'wss://polkadot.public.curie.radiumblock.io/ws', // 'Geometry Labs': 'wss://polkadot.geometry.io/websockets', // https://github.com/polkadot-js/apps/pull/6746 'Automata 1RPC': 'wss://1rpc.io/dot', - 'light client': 'light://substrate-connect/polkadot' + // NOTE: Keep this as the last entry, nothing after it + 'light client': 'light://substrate-connect/polkadot' // NOTE: Keep last }, teleport: [1000], linked: [ diff --git a/packages/apps-config/src/endpoints/testingRelayRococo.ts b/packages/apps-config/src/endpoints/testingRelayRococo.ts index 917ad20dd3..2e7786799c 100644 --- a/packages/apps-config/src/endpoints/testingRelayRococo.ts +++ b/packages/apps-config/src/endpoints/testingRelayRococo.ts @@ -403,7 +403,8 @@ export const testRelayRococo: EndpointOption = { // OnFinality: 'wss://rococo.api.onfinality.io/public-ws', // After reset, node misses host functions // Pinknode: 'wss://rpc.pinknode.io/rococo/explorer' // After reset, syncs to old chain // 'Ares Protocol': 'wss://rococo.aresprotocol.com' // https://github.com/polkadot-js/apps/issues/5767 - 'light client': 'light://substrate-connect/rococo' + // NOTE: Keep this as the last entry, nothing after it + 'light client': 'light://substrate-connect/rococo' // NOTE: Keep last }, teleport: [1000, 1002], linked: [ diff --git a/packages/apps-config/src/endpoints/testingRelayWestend.ts b/packages/apps-config/src/endpoints/testingRelayWestend.ts index a60e96fc8e..e03a029558 100644 --- a/packages/apps-config/src/endpoints/testingRelayWestend.ts +++ b/packages/apps-config/src/endpoints/testingRelayWestend.ts @@ -138,7 +138,8 @@ export const testRelayWestend: EndpointOption = { Pinknode: 'wss://rpc.pinknode.io/westend/explorer', Dwellir: 'wss://westend-rpc.dwellir.com', // 'NodeFactory(Vedran)': 'wss://westend.vedran.nodefactory.io/ws', // https://github.com/polkadot-js/apps/issues/5580 - 'light client': 'light://substrate-connect/westend' + // NOTE: Keep this as the last entry, nothing after it + 'light client': 'light://substrate-connect/westend' // NOTE: Keep last }, teleport: [1000, 1002], linked: [ diff --git a/packages/apps-config/src/endpoints/util.ts b/packages/apps-config/src/endpoints/util.ts index 4fff10a4fe..b12ae6706f 100644 --- a/packages/apps-config/src/endpoints/util.ts +++ b/packages/apps-config/src/endpoints/util.ts @@ -75,7 +75,14 @@ function expandEndpoint (t: TFunction, { dnslink, genesisHash, homepage, info, i ? t('lightclient.experimental', 'light client (experimental)', { ns: 'apps-config' }) : t('rpc.hosted.via', 'via {{host}}', { ns: 'apps-config', replace: { host } }), value - })); + })) + .sort((a, b) => + a.isLightClient + ? 1 + : b.isLightClient + ? -1 + : 0 + ); if (linked) { const last = result[result.length - 1];