Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
kroos47 committed Mar 12, 2024
1 parent 8640e5e commit 9e2da56
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 27 deletions.
2 changes: 1 addition & 1 deletion packages/apps-config/src/api/params/inflation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import type { ApiPromise } from '@polkadot/api';

import { CERE_NETWORK_GENESIS, CERE_NETWORK_TESTNET_GENESIS, DOCK_POS_TESTNET_GENESIS, KUSAMA_GENESIS, NEATCOIN_GENESIS, NFTMART_GENESIS, GOLDBERG_NETWORK_TESTNET_GENESIS, COUSCOUS_NETWORK_TESTNET_GENESIS, POLKADOT_GENESIS, VARA_NETWORK_GENESIS, VARA_NETWORK_TESTNET_GENESIS } from '../constants.js';
import { CERE_NETWORK_GENESIS, CERE_NETWORK_TESTNET_GENESIS, COUSCOUS_NETWORK_TESTNET_GENESIS, DOCK_POS_TESTNET_GENESIS, GOLDBERG_NETWORK_TESTNET_GENESIS, KUSAMA_GENESIS, NEATCOIN_GENESIS, NFTMART_GENESIS, POLKADOT_GENESIS, VARA_NETWORK_GENESIS, VARA_NETWORK_TESTNET_GENESIS } from '../constants.js';

interface InflationParams {
auctionAdjust: number;
Expand Down
2 changes: 1 addition & 1 deletion packages/apps-config/src/api/spec/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ const spec: Record<string, OverrideBundleDefinition> = {
asgard: bifrostAsgard,
astar,
automata,
avail: dataavail,
bajun,
basilisk,
beresheet,
Expand All @@ -187,7 +188,6 @@ const spec: Record<string, OverrideBundleDefinition> = {
'curio-mainnet': curio,
'curio-testnet': curio,
'data-avail': dataavail,
avail: dataavail,
datahighway: westlake,

Check failure on line 191 in packages/apps-config/src/api/spec/index.ts

View workflow job for this annotation

GitHub Actions / pr (lint)

Duplicate key 'avail'

Check failure on line 191 in packages/apps-config/src/api/spec/index.ts

View workflow job for this annotation

GitHub Actions / pr (lint)

Expected object keys to be in ascending order. 'avail' should be before 'data-avail'

Check failure on line 191 in packages/apps-config/src/api/spec/index.ts

View workflow job for this annotation

GitHub Actions / pr (build:code)

An object literal cannot have multiple properties with the same name.
'datahighway-parachain': datahighwayParachain,
dawn: eave,
Expand Down
2 changes: 1 addition & 1 deletion packages/apps-config/src/variables/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2017-2024 @polkadot/apps-config authors & contributors
// SPDX-License-Identifier: Apache-2.0

// eslint-disable-next-line
const LCURL = process.env.LCURL as string || 'https://goldberg.avail.tools';
const TESTNETURL = process.env.TESTNETURL as `wss://${string}` || 'wss://goldberg.avail.tools/ws';

Expand Down
6 changes: 3 additions & 3 deletions packages/apps-routing/src/staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import type { ApiPromise } from '@polkadot/api';
import type { u32, Vec } from '@polkadot/types';
import type { PalletStakingExposure, PalletStakingStakingLedger } from '@polkadot/types/lookup';
import type { PalletStakingExposure } from '@polkadot/types/lookup';
import type { Route, TFunction } from './types.js';

import Component from '@polkadot/app-staking';
Expand All @@ -18,7 +17,8 @@ function needsApiCheck (api: ApiPromise): boolean {
unwrapStorageType(api.registry, api.query.staking.erasStakers.creator.meta.type),
{ others: [{ value: BN_ONE, who: ZERO_ACCOUNT }], own: BN_ONE, total: BN_ONE }
);
console.log("asserting")

console.log('asserting');
assert(total && own && value && who && total.eq(BN_ONE) && own.eq(BN_ONE) && value.eq(BN_ONE), 'Needs a known Exposure type');
} catch {
console.warn('Unable to create known-shape Exposure type, disabling staking route');
Expand Down
21 changes: 0 additions & 21 deletions packages/apps/src/Endpoints/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,22 +175,6 @@ function isSwitchDisabled (hasUrlChanged: boolean, apiUrl: string, isUrlValid: b
return true;
}

function isLocalForkDisabled (hasUrlChanged: boolean, apiUrl: string, isUrlValid: boolean, isLocalFork?: boolean): boolean {
if (!hasUrlChanged) {
if (isLocalFork) {
return true;
} else {
return false;
}
} else if (apiUrl.startsWith('light://')) {
return true;
} else if (isUrlValid) {
return false;
}

return true;
}

function Endpoints ({ className = '', offset, onClose }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const linkOptions = createWsEndpoints(t);
Expand Down Expand Up @@ -332,11 +316,6 @@ function Endpoints ({ className = '', offset, onClose }: Props): React.ReactElem
[hasUrlChanged, apiUrl, isUrlValid, isLocalFork]
);

const canLocalFork = useMemo(
() => isLocalForkDisabled(hasUrlChanged, apiUrl, isUrlValid, isLocalFork),
[hasUrlChanged, apiUrl, isUrlValid, isLocalFork]
);

const canLCSwitch = useMemo(
() => isSwitchDisabled(hasLcUrlChanged, lcUrl, isLcUrlValid),
[hasLcUrlChanged, lcUrl, isLcUrlValid]
Expand Down

0 comments on commit 9e2da56

Please sign in to comment.