mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-04-21 23:37:57 +00:00
fix: add eslint-disable for unsafe member access and fix webpack header
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2026 @polkadot/apps authors & contributors
|
||||
// Copyright 2017-2026 @pezkuwi/apps-electron authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
/* eslint-disable camelcase */
|
||||
|
||||
@@ -19,11 +19,13 @@ function needsApiCheck (api: ApiPromise): boolean {
|
||||
}
|
||||
|
||||
// we need a known Exposure type
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const { nominatorCount, own, pageCount, total } = api.registry.createType<SpStakingPagedExposureMetadata>(
|
||||
unwrapStorageType(api.registry, api.query.staking.erasStakersOverview.creator.meta.type),
|
||||
{ nominatorCount: BN_ONE, own: BN_ONE, pageCount: BN_ONE, total: BN_ONE }
|
||||
);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
||||
assert(total && own && nominatorCount && pageCount && total.eq(BN_ONE) && own.eq(BN_ONE), 'Needs a known Exposure type');
|
||||
} catch {
|
||||
console.warn('Unable to create known-shape Exposure type, disabling staking route');
|
||||
|
||||
@@ -13,11 +13,13 @@ import { assert, BN_ONE } from '@pezkuwi/util';
|
||||
function needsApiCheck (api: ApiPromise): boolean {
|
||||
try {
|
||||
// we need a known Exposure type
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const { others: [{ value, who }], own, total } = api.registry.createType<SpStakingExposure>(
|
||||
unwrapStorageType(api.registry, api.query.staking.erasStakers.creator.meta.type),
|
||||
{ others: [{ value: BN_ONE, who: ZERO_ACCOUNT }], own: BN_ONE, total: BN_ONE }
|
||||
);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
||||
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');
|
||||
|
||||
Reference in New Issue
Block a user